Page MenuHomePhabricator

"chemical" major mime type was never added to production database
Open, LowPublic

Description

It seems T68412: Updater applies patches after fresh install of MW where tables.sql already has been patched (2014) was never applied to production. For example, filearchive in enwiki is:

|  fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart')

While locally it's:

fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart','chemical')

This has caused massive drift reports:

[
    "filearchive fa_major_mime field-size-mismatch": {
        "s1": [
            "db1083:enwiki",
            "db1084:enwiki",
            "db1169:enwiki",
            "db1118:enwiki",
            "db1163:enwiki",
            "db1106:enwiki",
            "db1164:enwiki",
            "db1119:enwiki",
            "db1134:enwiki"
        ],
        "s2": [
            "db1122:svwiki",
            "db1129:svwiki",
            "db1076:svwiki",
            "db1074:svwiki"
        ],
        "s3": [
            "db1123:aswikibooks",
            "db1166:aswikibooks",
            "db1157:aswikibooks",
            "db1175:aswikibooks",
            "db1112:aswikibooks"
        ],
        "s6": [
            "db1131:ruwiki",
            "db1168:ruwiki",
            "db1085:ruwiki",
            "db1173:ruwiki"
        ],
        "s7": [
            "db1086:cawiki",
            "db1127:cawiki",
            "db1136:cawiki",
            "db1079:cawiki"
        ],
        "s8": [
            "db1104:wikidatawiki",
            "db1172:wikidatawiki",
            "db1109:wikidatawiki",
            "db1114:wikidatawiki",
            "db1126:wikidatawiki",
            "db1111:wikidatawiki",
            "db1087:wikidatawiki"
        ]
    },
    "image img_major_mime field-size-mismatch": {
        "s1": [
            "db1083:enwiki",
            "db1084:enwiki",
            "db1169:enwiki",
            "db1118:enwiki",
            "db1163:enwiki",
            "db1106:enwiki",
            "db1164:enwiki",
            "db1119:enwiki",
            "db1134:enwiki",
            "db1135:enwiki"
        ],
        "s2": [
            "db1122:svwiki",
            "db1129:svwiki",
            "db1076:svwiki",
            "db1074:svwiki"
        ],
        "s3": [
            "db1123:aswikibooks",
            "db1166:aswikibooks",
            "db1157:aswikibooks",
            "db1175:aswikibooks",
            "db1112:aswikibooks"
        ],
        "s6": [
            "db1131:ruwiki",
            "db1168:ruwiki",
            "db1085:ruwiki",
            "db1173:ruwiki"
        ],
        "s7": [
            "db1086:cawiki",
            "db1174:cawiki",
            "db1127:cawiki",
            "db1136:cawiki",
            "db1079:cawiki"
        ],
        "s8": [
            "db1104:wikidatawiki",
            "db1172:wikidatawiki",
            "db1109:wikidatawiki",
            "db1114:wikidatawiki",
            "db1126:wikidatawiki",
            "db1111:wikidatawiki",
            "db1087:wikidatawiki"
        ]
    },
    "oldimage oi_major_mime field-size-mismatch": {
        "s1": [
            "db1083:enwiki",
            "db1084:enwiki",
            "db1169:enwiki",
            "db1118:enwiki",
            "db1163:enwiki",
            "db1106:enwiki",
            "db1164:enwiki",
            "db1119:enwiki",
            "db1134:enwiki",
            "db1135:enwiki"
        ],
        "s2": [
            "db1122:svwiki",
            "db1129:svwiki",
            "db1076:svwiki",
            "db1074:svwiki"
        ],
        "s3": [
            "db1123:aswikibooks",
            "db1166:aswikibooks",
            "db1157:aswikibooks",
            "db1175:aswikibooks",
            "db1112:aswikibooks"
        ],
        "s6": [
            "db1131:ruwiki",
            "db1168:ruwiki",
            "db1085:ruwiki",
            "db1173:ruwiki"
        ],
        "s7": [
            "db1086:cawiki",
            "db1174:cawiki",
            "db1127:cawiki",
            "db1136:cawiki",
            "db1079:cawiki"
        ],
        "s8": [
            "db1104:wikidatawiki",
            "db1172:wikidatawiki",
            "db1109:wikidatawiki",
            "db1114:wikidatawiki",
            "db1126:wikidatawiki",
            "db1087:wikidatawiki"
        ]
    },
]

I assume wikis created after 2014 wouldn't have this drift. The project for this (T18491: Support for Chemical Markup Language) is stalled so no rush in fixing this but I hope it gets picked up again. It's a cool project :(

The patches for it can be found in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/135756/13/maintenance/archives/patch-img_major_mime-chemical.sql (and onwards) but I'm not 100% sure it would be work after all these years.

Also another reason why we should avoid using enums (T119173: RFC: Discourage use of MySQL's ENUM type)

Event Timeline

Adding an enum at the end of the list should be relatively easy, but the question is...given that it's not been applied since 2014 and the project is stalled, is it really worth altering every single host in production or should we maybe consider removing it from code?

I would have been 100% in agreement with you if it were something else but I have a soft spot for science (As a certified science nerd who studied physics in university). I can pick up and finish it (it's not much work left) as some of my volunteer projects are wrapping up (the new mw logo, abstract schema, considerable progress in mailman3). I can pick this up soonish and finish it. Would that convince you?

Sure, that works @Ladsgroup!. But I am not going to give this a lot priority, as we have lots of others which I consider a lot more important!

Marostegui moved this task from Refine to Ready on the DBA board.