Last modified: 2014-06-20 21:01:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68887, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66887 - Updater race condition when using replication
Updater race condition when using replication
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-20 20:12 UTC by Sam Reed (reedy)
Modified: 2014-06-20 21:01 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Sam Reed (reedy) 2014-06-20 20:12:31 UTC
Using update.php on a wiki with replication has the potential of hitting a race condition where the master has finished an update operation, but the slave(s) hasn't; and then a query hits the slave but fails due to missing columns etc.


This can be shown more clearly by broken replication:

[20:37:15] <jcl> I'm having trouble upgrading MW from 1.20.8 to 1.23: during the update.php script, I'm getting a db query error: "select page_namespace, etc. from page where ..." from the function Title::newFromID is erroring with "Unknown column page_content_model" in 'field list' -- I've seen a few similar results from googling but nothing I've done so far has helped. Any suggestions?
<INSERT DEBUGGING>
[20:59:59] <jcl> well there you go, the slave threads aren't running, gr...



In a lot of cases, update.php may not be the correct tool for the job for updating these wikis, but it happens.

Maybe it should bail if more than 1 server. Or maybe more sensibly, queries to the slaves should be disabled.


To go along with this, some wfWaitForSlave() type calls should probably be added between updater operations too.
Comment 1 Gerrit Notification Bot 2014-06-20 20:16:36 UTC
Change 141049 had a related patch set uploaded by Reedy:
Add wfWaitForSlaves() call in DatabaseUpdater::runUpdates()

https://gerrit.wikimedia.org/r/141049
Comment 2 Sam Reed (reedy) 2014-06-20 20:18:03 UTC
21:04:21] <bawolff> I think update.php is written with the assumption that anyone using it has a db small enough to not need replication

^ In that case, it's see bug 1

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links