Page MenuHomePhabricator

MCR schema migration stage 1: Fix Legacy Archive Rows
Closed, ResolvedPublic

Description

Populate empty ar_rev_id fields:

  • Determine how many rows in archive have ar_rev_id = NULL. Let's call that number m.
  • Reserve m (or m+k, for good measure) IDs in the revision table:
  • Make a note of max( max( rev_id ), max( ar_rev_id ) ), let's call it b.
  • Insert a row with rev_id = b+m+k into the revision table, and delete it again, to bump the auto-increment counter.
  • For any row in archive that has ar_rev_id = NULL, set ar_rev_id to a unique id between b+1 and b+m+k. This could be done via a temporary table, or programmatically.

Make ar_text and ar_flags unused:

  • For each row in archive that has a non-null ar_text field, insert a row into the text table, copying ar_text to old_text and ar_flags to old_flags. Set ar_text_id to the old_id from the newly created text row.
  • Set ar_text and ar_flags to the empty string everywhere.

https://www.mediawiki.org/wiki/Multi-Content_Revisions/Content_Meta-Data#Phase_I:_Fix_Legacy_Archive_Rows
https://www.mediawiki.org/wiki/Multi-Content_Revisions/Schema_Migration

Event Timeline

daniel created this task.Dec 21 2017, 6:40 PM
daniel triaged this task as Normal priority.
daniel renamed this task from MCR schema migration stage 0: Fix Legacy Archive Rows to MCR schema migration stage 1: Fix Legacy Archive Rows.
tstarling assigned this task to Anomie.Feb 8 2018, 9:36 PM
Abit added a subscriber: Abit.Mar 6 2018, 1:49 AM

@Anomie what is this task blocked by? Is it the code review Piotr is doing?

Anomie added a comment.Mar 6 2018, 6:06 PM

It's blocked on T182678, yes.

Anomie closed this task as Resolved.Apr 6 2018, 7:21 PM

For every wiki in all.dblist (except labtestwiki, which I can't seem to get to from terbium),

  • ar_text is empty in all rows
  • ar_text_id is non-0 in all rows
  • ar_rev_id is non-0 in all rows
Anomie closed this task as Resolved.

Should be fixed now (again)