Page MenuHomePhabricator

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

Description

Apply T312266 to wmf wikis

  1. ALTERs to run: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/817875/1/sql/mysql/patch-cx_translators-unique-to-pk.sql
  2. Where to run those changes: All wikipedias (tables on x1.wikishared) + testwiki
  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

Maybe it is better to apply the DROP + ALTER in reverse order in production to avoid that there is a time gap without unique constraint, because both statement as written in the linked file are not atomic (as far as I know, not sure if a atomic way is possible)

Progress

  • s3 (testwiki)
  • x1 (wikishared)
    • eqiad
    • codfw

Event Timeline

Marostegui added a subscriber: Marostegui.

We can just do it in the same transaction: alter table cx_translators drop key cx_translation_translators, add PRIMARY KEY ( translator_user_id, translator_translation_id );

Change 818291 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/software/schema-changes@master] drop_cx_translation_translators_T314087.py: New schema change

https://gerrit.wikimedia.org/r/818291

Change 818291 merged by jenkins-bot:

[operations/software/schema-changes@master] drop_cx_translation_translators_T314087.py: New schema change

https://gerrit.wikimedia.org/r/818291

Ran it on s3 (testwiki) with replication.

I have deployed this on x1 codfw to make sure RBR does nothing weird (it shouldn't this type of schema change). I will deploy in eqiad on Monday

We can just do it in the same transaction: alter table cx_translators drop key cx_translation_translators, add PRIMARY KEY ( translator_user_id, translator_translation_id );

Thanks for the hint, that seems to be a bug with the schema change generator, I have filled T314138 to not loss the information.

Marostegui updated the task description. (Show Details)

All done