Legoktm has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/394241 )
Change subject: Add wfWaitForSlaves() to maintenance/migrateComments.php
......................................................................
Add wfWaitForSlaves() to maintenance/migrateComments.php
Change-Id: Idb8d21116a52c473cc4658883fe13855bad92222
(cherry picked from commit f6f5fadd397c2eb679fb7ee6e20f7a9cf961834b)
---
M maintenance/migrateComments.php
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/41/394241/1
diff --git a/maintenance/migrateComments.php b/maintenance/migrateComments.php
index 9d4e261..4af6a2a 100644
--- a/maintenance/migrateComments.php
+++ b/maintenance/migrateComments.php
@@ -144,6 +144,7 @@
$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 @@
}
$prompt = join( ' ', array_reverse( $prompt ) );
$this->output( "... $prompt\n" );
+ wfWaitForSlaves();
}
$this->output(
@@ -231,6 +233,7 @@
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 @@
// Calculate the "next" condition
$next = [ $primaryKey . ' > ' . $dbw->addQuotes(
$row->$primaryKey ) ];
$this->output( "... {$row->$primaryKey}\n" );
+ wfWaitForSlaves();
}
$this->output(
--
To view, visit https://gerrit.wikimedia.org/r/394241
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb8d21116a52c473cc4658883fe13855bad92222
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_30
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits