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
$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 );