From 06913b853ddb971e400c2bf3829fa4b40c260afa Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Tue, 19 Sep 2017 20:38:20 -0700 Subject: [PATCH] Improve populateIpChanges.php reporting Instead of just the rows we attempted to insert, also count actually inserted ones. Change-Id: Ie747cb41873640776281794a90dbe3b6b8e3fa84 --- maintenance/populateIpChanges.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/maintenance/populateIpChanges.php b/maintenance/populateIpChanges.php index f7bcc12c3d..2b2a2b433d 100644 --- a/maintenance/populateIpChanges.php +++ b/maintenance/populateIpChanges.php @@ -72,7 +72,8 @@ TEXT ? $maxRevId : $dbw->selectField( 'revision', 'MAX(rev_id)', false, __METHOD__ ); $blockStart = $start; - $revCount = 0; + $attempted = 0; + $inserted = 0; $this->output( "Copying IP revisions to ip_changes, from rev_id $start to rev_id $end\n" ); @@ -105,7 +106,7 @@ TEXT 'ipc_hex' => IP::toHex( $row->rev_user_text ), ]; - $revCount++; + $attempted++; } } @@ -116,13 +117,15 @@ TEXT 'IGNORE' ); + $inserted += $dbw->affectedRows(); + $lbFactory->waitForReplication(); usleep( $throttle * 1000 ); $blockStart = $blockEnd + 1; } - $this->output( "$revCount IP revisions copied.\n" ); + $this->output( "Attempted to insert $attempted IP revisions, $inserted actually done.\n" ); return true; } -- 2.20.1