Inserting new revisions requires master by definition. Without this,
there can be problems when creating multiple revisions in a
transaction (i.e. a null revision pointed to a text_id borrowed
from a just-created revision).
Bug: T138310
Change-Id: I10773612f04b6525f9c8bc27a96bcb8a77831816
public function insertOn( $dbw ) {
global $wgDefaultExternalStore, $wgContentHandlerUseDB;
+ // We're inserting a new revision, so we have to use master anyway.
+ // If it's a null revision, it may have references to rows that
+ // are not in the replica yet (the text row).
+ $this->mQueryFlags |= self::READ_LATEST;
+
// Not allowed to have rev_page equal to 0, false, etc.
if ( !$this->mPage ) {
$title = $this->getTitle();