Page MenuHomePhabricator

fixProofreadIndexPagesContentModel doDBUpdates method turns infinitely
Closed, ResolvedPublic

Description

The maintenance script to update the content model doesn't finish.

FixProofreadIndexPagesContentModel::doDBUpdates
do {
    $dbw->query(
        'UPDATE page SET page_content_model = ' . $dbw->addQuotes( CONTENT_MODEL_PROOFREAD_INDEX ) .
        ' WHERE page_namespace  = ' . intval( ProofreadPage::getIndexNamespaceId() ) .
        ' AND page_content_model = ' .  $dbw->addQuotes( CONTENT_MODEL_WIKITEXT ) .
        ' ORDER BY page_namespace, page_title LIMIT ' . intval( $this->mBatchSize )
    );
    wfWaitForSlaves();
} while ( $dbw->affectedRows() > 0 );

When run on vec.wikisource, the effect on the page table is as expected, all the rows was updated to 'proofread-index' (the CONTENT_MODEL_PROOFREAD_INDEX value)

BUT

the loop runs indefinitely, as $dbw->affectedRows() always return a greater than 0 value.

@Tpt asserts it works in dev environment and stops when done.

Event Timeline

Dereckson triaged this task as High priority.EditedMay 24 2017, 8:40 PM

[ Set priority to high, as wikisource is currently affected by this issue, as content model update code has been deployed by the train. ]

I have suggested in IRC to rollack the train strictly for affected projects if user visable, until the issue is fixed, then go back to wmf 2 with the fix deployed.

Change 355523 had a related patch set uploaded (by Chad; owner: Chad):
[mediawiki/extensions/ProofreadPage@master] Properly handle batches of pages to update

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

Change 355534 had a related patch set uploaded (by Tpt; owner: Chad):
[mediawiki/extensions/ProofreadPage@wmf/1.30.0-wmf.2] Properly handle batches of pages to update

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

Change 355523 merged by jenkins-bot:
[mediawiki/extensions/ProofreadPage@master] Properly handle batches of pages to update

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

Change 355534 merged by jenkins-bot:
[mediawiki/extensions/ProofreadPage@wmf/1.30.0-wmf.2] Properly handle batches of pages to update

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

Tpt claimed this task.

The script fixed by Chad have been pushed on production and run on all wikis.

I have suggested in IRC to rollack the train strictly for affected projects if user visable, until the issue is fixed, then go back to wmf 2 with the fix deployed.

This course of action hasn't been chosen, as data migration started, and so a rollback would have fixed the unmigrated page, but would have break the migrated ones.