Page MenuHomePhabricator

Add primary key and drop unique index on translate_tmt on wmf wikis
Closed, ResolvedPublic

Description

Apply T312260 to wmf wikis

  1. ALTERs to run: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Translate/+/817873/2/sql/mysql/patch-translate_tmt-unique-to-pk.sql
  2. Where to run those changes: Active according to the config: advisorswiki, amwikimedia, bewikimedia, betawikiversity, brwikimedia, bdwikimedia, cawikimedia, collabwiki, commonswiki, testcommonswiki, foundationwiki, frwiktionary, gewikimedia, grwikimedia, hiwikimedia, idwikimedia, incubatorwiki, legalteamwiki, maiwikimedia, mediawikiwiki, metawiki, nowikimedia, otrs_wikiwiki, outreachwiki, plwikimedia, ruwikimedia, punjabiwikimedia, sourceswiki, specieswiki, sewikimedia, testwiki, uawikimedia, wbwikimedia, wikidata, wikimania2012wiki, wikimania2013wiki, wikimania2014wiki, wikimania2015wiki, wikimania2016wiki, wikimania2017wiki, wikimania2018wiki, wikimaniawiki
  3. When to run those changes: any time
  4. If the schema change is backwards compatible: Yes
  5. If the schema change has been tested already on some of the test/beta wikis: beta already running with the new schema
  6. if the data should be made available on the labs replicas and/or dumps: no change of the existing rules

Due to a bug in the schema change generator (T314138) the DROP + ALTER should be rewritten to be atomic
The table could be empty on wmf wikis (according to T289952#7317650)

Event Timeline

Marostegui moved this task from Triage to In progress on the DBA board.

Per section wikis:
s3:

advisorswiki
amwikimedia
bewikimedia
betawikiversity
brwikimedia
bdwikimedia
cawikimedia
collabwiki
foundationwiki
gewikimedia
grwikimedia
hiwikimedia
idwikimedia
incubatorwiki
legalteamwiki
maiwikimedia
mediawikiwiki
nowikimedia
otrs_wikiwiki
outreachwiki
plwikimedia
ruwikimedia
punjabiwikimedia
sourceswiki
specieswiki
sewikimedia
testwiki
testwikidatawiki
uawikimedia
wbwikimedia
testwikidatawiki
wikimania2012wiki
wikimania2013wiki
wikimania2014wiki
wikimania2015wiki
wikimania2016wiki
wikimania2017wiki
wikimania2018wiki
wikimaniawiki

s4:

commonswiki
testcommonswiki

s7:

frwiktionary
metawiki

s8:

wikidatawiki

Interestingly on s3 that table is only present on these wikis:

# find . -name translate_tmt.frm
./brwikimedia/translate_tmt.frm
./outreachwiki/translate_tmt.frm
./wikimania2013wiki/translate_tmt.frm

There's not such table on s1, s2, s4, s5, s6, s7 and s8

information_schema confirms that too:

# db-mysql db1123 information_schema -e "select table_schema from tables where table_name like 'translate_tmt%'"
+-------------------+
| table_schema      |
+-------------------+
| brwikimedia       |
| outreachwiki      |
| wikimania2013wiki |
+-------------------+

It was empty on those three so I just ran the following with replication:

alter table translate_tmt drop key tmt_sid_lang, ADD  PRIMARY KEY (tmt_sid, tmt_lang);


root@db1157.eqiad.wmnet[wikimania2013wiki]> show create table translate_tmt;
+---------------+--------------------------------------------------------------------------------------------------------------------->
| Table         | Create Table                                                                                                        >
+---------------+--------------------------------------------------------------------------------------------------------------------->
| translate_tmt | CREATE TABLE `translate_tmt` (
  `tmt_sid` int(10) unsigned NOT NULL,
  `tmt_lang` varbinary(20) NOT NULL,
  `tmt_text` mediumblob NOT NULL,
  PRIMARY KEY (`tmt_sid`,`tmt_lang`)
) ENGINE=InnoDB DEFAULT CHARSET=binary |
+---------------+--------------------------------------------------------------------------------------------------------------------->
1 row in set (0.001 sec)
Umherirrender renamed this task from Add primary key and drop unique index on translate_tmt wmf wikis to Add primary key and drop unique index on translate_tmt on wmf wikis.Aug 2 2022, 11:38 AM