jenkins-bot has submitted this change and it was merged.

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(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I5771af8135530677dc8223389f572896918c6b72
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to