From: Roan Kattouw Date: Sat, 3 Mar 2018 03:54:45 +0000 (-0800) Subject: Fix master/replica race condition when creating null revisions X-Git-Tag: 1.31.0-rc.0~453^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=a1e58d245584c7a3281b3ec721ad3e3cbbd5dd4b;p=lhc%2Fweb%2Fwiklou.git Fix master/replica race condition when creating null revisions RevisionStore::newFromNullRevision() carefully reads the latest revision from the master, but then forgets to instruct emulateMainSlot_1_29() to do the same, so the lookup query for rev_text_id in the text table is done against a replica. This is not usually a problem for null revisions, but it is a problem when editing a page and then immediately moving it: this causes a null revision to be created based on a freshly created revision, which doesn't yet exist on the replica. Bug: T184670 Change-Id: Ied4db5ee770716ff3edb918d2be722934c79d0c7 --- diff --git a/includes/Storage/RevisionStore.php b/includes/Storage/RevisionStore.php index e13fc1fe7a..e00deef6cc 100644 --- a/includes/Storage/RevisionStore.php +++ b/includes/Storage/RevisionStore.php @@ -613,7 +613,7 @@ class RevisionStore $fields['title'] = Title::makeTitle( $current->page_namespace, $current->page_title ); - $mainSlot = $this->emulateMainSlot_1_29( $fields, 0, $title ); + $mainSlot = $this->emulateMainSlot_1_29( $fields, self::READ_LATEST, $title ); $revision = new MutableRevisionRecord( $title, $this->wikiId ); $this->initializeMutableRevisionFromArray( $revision, $fields ); $revision->setSlot( $mainSlot );