Make LinksUpdate only wait on the DB with the link tables
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 18 May 2016 22:05:11 +0000 (15:05 -0700)
committer20after4 <mmodell@wikimedia.org>
Wed, 18 May 2016 22:07:58 +0000 (22:07 +0000)
Bug: T135690

Change-Id: If79ca385884f422e5ed11e77b29033c8cabf494c

includes/deferred/LinksUpdate.php

index ac08374..1f7f3b0 100644 (file)
@@ -389,14 +389,14 @@ class LinksUpdate extends SqlDataUpdate implements EnqueueableDataUpdate {
                foreach ( $deleteWheres as $deleteWhere ) {
                        $this->mDb->delete( $table, $deleteWhere, __METHOD__ );
                        $this->mDb->commit( __METHOD__, 'flush' );
-                       wfGetLBFactory()->waitForReplication();
+                       wfGetLBFactory()->waitForReplication( [ 'wiki' => $this->mDb->getWikiID() ] );
                }
 
                $insertBatches = array_chunk( $insertions, self::BATCH_SIZE );
                foreach ( $insertBatches as $insertBatch ) {
                        $this->mDb->insert( $table, $insertBatch, __METHOD__, 'IGNORE' );
                        $this->mDb->commit( __METHOD__, 'flush' );
-                       wfGetLBFactory()->waitForReplication();
+                       wfGetLBFactory()->waitForReplication( [ 'wiki' => $this->mDb->getWikiID() ] );
                }
 
                if ( count( $insertions ) ) {