X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateCollation.php;h=e70a176909f8108c120c169eaed1a7fd6b8be020;hb=bdfa96eb726c9997a010f5a194eec71925bfddc2;hp=922cc872139465c309d0e34714ad385df1bbf8ad;hpb=c0e47a90c41a7e5eeb5ce9e513ee2f63fb836dba;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 922cc87213..e70a176909 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -34,7 +34,7 @@ require_once __DIR__ . '/Maintenance.php'; */ class UpdateCollation extends Maintenance { const BATCH_SIZE = 100; // Number of rows to process in one batch - const SYNC_INTERVAL = 5; // Wait for slaves after this many batches + const SYNC_INTERVAL = 5; // Wait for replica DBs after this many batches public $sizeHistogram = []; @@ -70,7 +70,7 @@ TEXT global $wgCategoryCollation; $dbw = $this->getDB( DB_MASTER ); - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $force = $this->getOption( 'force' ); $dryRun = $this->getOption( 'dry-run' ); $verboseStats = $this->getOption( 'verbose-stats' ); @@ -101,7 +101,7 @@ TEXT 'STRAIGHT_JOIN' // per T58041 ]; - if ( $force || $dryRun ) { + if ( $force ) { $collationConds = []; } else { if ( $this->hasOption( 'previous-collation' ) ) { @@ -132,7 +132,11 @@ TEXT return; } - $this->output( "Fixing collation for $count rows.\n" ); + if ( $dryRun ) { + $this->output( "$count rows would be updated.\n" ); + } else { + $this->output( "Fixing collation for $count rows.\n" ); + } wfWaitForSlaves(); } $count = 0; @@ -220,7 +224,7 @@ TEXT $this->output( "$count done.\n" ); if ( !$dryRun && ++$batchCount % self::SYNC_INTERVAL == 0 ) { - $this->output( "Waiting for slaves ... " ); + $this->output( "Waiting for replica DBs ... " ); wfWaitForSlaves(); $this->output( "done\n" ); } @@ -238,7 +242,7 @@ TEXT * Return an SQL expression selecting rows which sort above the given row, * assuming an ordering of cl_collation, cl_to, cl_type, cl_from * @param stdClass $row - * @param DatabaseBase $dbw + * @param Database $dbw * @return string */ function getBatchCondition( $row, $dbw ) {