Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/243072
Change subject: Modernized slave wait checks in recompressTracked.php
......................................................................
Modernized slave wait checks in recompressTracked.php
Change-Id: I5771af8135530677dc8223389f572896918c6b72
---
M maintenance/storage/recompressTracked.php
1 file changed, 5 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/72/243072/1
diff --git a/maintenance/storage/recompressTracked.php
b/maintenance/storage/recompressTracked.php
index b213929..120ccb6 100644
--- a/maintenance/storage/recompressTracked.php
+++ b/maintenance/storage/recompressTracked.php
@@ -365,7 +365,7 @@
if ( $current == $end || $this->numBatches >=
$this->reportingInterval ) {
$this->numBatches = 0;
$this->info( "$label: $current / $end" );
- $this->waitForSlaves();
+ wfWaitForSlaves();
}
}
@@ -463,7 +463,7 @@
case 'quit':
return;
}
- $this->waitForSlaves();
+ wfWaitForSlaves();
}
}
@@ -530,7 +530,7 @@
$this->debug( "$titleText: committing
blob with " . $trx->getSize() . " items" );
$trx->commit();
$trx = new CgzCopyTransaction( $this,
$this->pageBlobClass );
- $this->waitForSlaves();
+ wfWaitForSlaves();
}
}
$startId = $row->bt_text_id;
@@ -613,7 +613,7 @@
foreach ( $res as $row ) {
$this->moveTextRow( $row->bt_text_id,
$row->bt_new_url );
if ( $row->bt_text_id % 10 == 0 ) {
- $this->waitForSlaves();
+ wfWaitForSlaves();
}
}
$startId = $row->bt_text_id;
@@ -681,25 +681,11 @@
$this->debug( "[orphan]: committing blob with "
. $trx->getSize() . " rows" );
$trx->commit();
$trx = new CgzCopyTransaction( $this,
$this->orphanBlobClass );
- $this->waitForSlaves();
+ wfWaitForSlaves();
}
}
$this->debug( "[orphan]: committing blob with " .
$trx->getSize() . " rows" );
$trx->commit();
- }
-
- /**
- * Wait for slaves (quietly)
- */
- function waitForSlaves() {
- $lb = wfGetLB();
- while ( true ) {
- list( $host, $maxLag ) = $lb->getMaxLag();
- if ( $maxLag < 2 ) {
- break;
- }
- sleep( 5 );
- }
}
}
--
To view, visit https://gerrit.wikimedia.org/r/243072
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5771af8135530677dc8223389f572896918c6b72
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits