Page MenuHomePhabricator

Build a write duplicator system in mediawiki core
Open, MediumPublic

Description

We will be having two shared tables between s4 and x4. Page and redirect. It is also important to make sure writes involving auto_increment id (e.g. inserts) are handled corrected otherwise, any small drift will move around every row after it.

To make that happen, we need to build two systems in core:

  • One that duplicates writes on these two tables.
    • My suggestion, build a subclass of UpdateQueryBuilder and co.
  • A reconciliation maint script that compares the tables and update the secondary table based on the source of the truth.
    • We can also make use of this to run on testcommonswiki with empty tables and allow it to fill it with page table of the core db.

The updates on the secondary cluster should happen as deferred updates.

Event Timeline

Change #1228019 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] rdbms: Introduce IWriteQueryBuilder

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

Change #1228031 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):

[mediawiki/core@master] [WIP] Start write duplication

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