Maintenance::commitTransaction is calling waitForReplication already.
No need to wait a second time, hopefully the lags are 0 already.
Change-Id: Id457ed2cdd6bfd9663665ba0cd5c4e3dd640b738
$this->output( "Deleting self externals from $wgServer\n" );
$db = $this->getDB( DB_MASTER );
while ( 1 ) {
- wfWaitForSlaves();
$this->commitTransaction( $db, __METHOD__ );
$q = $db->limitResult( "DELETE /* deleteSelfExternals */ FROM externallinks WHERE el_to"
. $db->buildLike( $wgServer . '/', $db->anyString() ), $this->getBatchSize() );
list( $n, $display ) = $this->makeNextCond( $dbw, [ $primaryKey ], $lastRow );
$next = [ $n ];
$this->output( "... $display\n" );
- wfWaitForSlaves();
}
$this->output(
// Calculate the "next" condition
$next = [ $primaryKey . ' > ' . $dbw->addQuotes( $row->$primaryKey ) ];
$this->output( "... {$row->$primaryKey}\n" );
- wfWaitForSlaves();
}
$this->output(
$count += $affected;
$blockStart += $batchSize;
$blockEnd += $batchSize;
- wfWaitForSlaves();
}
$this->output( "Done! $count users in group '$oldGroup' are now in '$newGroup' instead.\n" );
}
if ( $interval ) {
sleep( $interval );
}
- wfWaitForSlaves();
}
}
}
$this->commitTransaction( $db, __METHOD__ );
$blockStart += $batchSize;
$blockEnd += $batchSize;
- wfWaitForSlaves();
}
$this->output( "Done populating log_user_text field.\n" );
$blockStart += $batchSize;
$blockEnd += $batchSize;
- wfWaitForSlaves();
}
return $count;
$blockStart += $batchSize;
$blockEnd += $batchSize;
- wfWaitForSlaves();
}
return $count;
$updateSize = 0;
$this->commitTransaction( $db, __METHOD__ );
$this->output( "Commited row with ar_timestamp={$row->ar_timestamp}\n" );
- wfWaitForSlaves();
$this->beginTransaction( $db, __METHOD__ );
}
}
$this->output( "/" );
$this->commitTransaction( $dbw, __METHOD__ );
$i += $thisChunkSize;
- wfWaitForSlaves();
}
$this->output( "\n" );
}
__METHOD__
);
$this->commitTransaction( $dbw, __METHOD__ );
- $this->waitForSlaves();
}
print "$primaryId: resolved to $url\n";
print "Good stubs: $numGood\n";
}
- function waitForSlaves() {
- static $iteration = 0;
- ++$iteration;
- if ( ++$iteration > 50 == 0 ) {
- wfWaitForSlaves();
- $iteration = 0;
- }
- }
-
function findTextIdInPage( $pageId, $textId ) {
$ids = $this->getRevTextMap( $pageId );
if ( !isset( $ids[$textId] ) ) {
} else {
$this->output( "$count done.\n" );
}
-
- if ( !$dryRun && ++$batchCount % self::SYNC_INTERVAL == 0 ) {
- $this->output( "Waiting for replica DBs ... " );
- wfWaitForSlaves();
- $this->output( "done\n" );
- }
} while ( $res->numRows() == self::BATCH_SIZE );
if ( !$dryRun ) {