From f6f5fadd397c2eb679fb7ee6e20f7a9cf961834b Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 29 Nov 2017 14:52:31 -0500 Subject: [PATCH] Add wfWaitForSlaves() to maintenance/migrateComments.php Change-Id: Idb8d21116a52c473cc4658883fe13855bad92222 --- maintenance/migrateComments.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/maintenance/migrateComments.php b/maintenance/migrateComments.php index 01ee9f84fd..c000871950 100644 --- a/maintenance/migrateComments.php +++ b/maintenance/migrateComments.php @@ -144,6 +144,7 @@ class MigrateComments extends LoggedUpdateMaintenance { $primaryKey = (array)$primaryKey; $pkFilter = array_flip( $primaryKey ); $this->output( "Beginning migration of $table.$oldField to $table.$newField\n" ); + wfWaitForSlaves(); $dbw = $this->getDB( DB_MASTER ); $next = '1=1'; @@ -206,6 +207,7 @@ class MigrateComments extends LoggedUpdateMaintenance { } $prompt = join( ' ', array_reverse( $prompt ) ); $this->output( "... $prompt\n" ); + wfWaitForSlaves(); } $this->output( @@ -231,6 +233,7 @@ class MigrateComments extends LoggedUpdateMaintenance { protected function migrateToTemp( $table, $primaryKey, $oldField, $newPrimaryKey, $newField ) { $newTable = $table . '_comment_temp'; $this->output( "Beginning migration of $table.$oldField to $newTable.$newField\n" ); + wfWaitForSlaves(); $dbw = $this->getDB( DB_MASTER ); $next = []; @@ -279,6 +282,7 @@ class MigrateComments extends LoggedUpdateMaintenance { // Calculate the "next" condition $next = [ $primaryKey . ' > ' . $dbw->addQuotes( $row->$primaryKey ) ]; $this->output( "... {$row->$primaryKey}\n" ); + wfWaitForSlaves(); } $this->output( -- 2.20.1