Merge "Remove --max-slave-lag options and remnants from maintenance scripts"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 6 May 2015 20:37:41 +0000 (20:37 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 6 May 2015 20:37:41 +0000 (20:37 +0000)
maintenance/cleanupRemovedModules.php
maintenance/cleanupTable.inc
maintenance/populateCategory.php
maintenance/rebuildImages.php
maintenance/updateCollation.php
maintenance/waitForSlave.php

index e1d0ed6..a4e66ca 100644 (file)
@@ -36,13 +36,6 @@ class CleanupRemovedModules extends Maintenance {
                parent::__construct();
                $this->mDescription = 'Remove cache entries for removed ResourceLoader modules from the database';
                $this->addOption( 'batchsize', 'Delete rows in batches of this size. Default: 500', false, true );
-               $this->addOption(
-                       'max-slave-lag',
-                       'If the slave lag exceeds this many seconds, wait until it drops below this value. '
-                               . 'Default: 5',
-                       false,
-                       true
-               );
        }
 
        public function execute() {
@@ -51,7 +44,6 @@ class CleanupRemovedModules extends Maintenance {
                $moduleNames = $rl->getModuleNames();
                $moduleList = implode( ', ', array_map( array( $dbw, 'addQuotes' ), $moduleNames ) );
                $limit = max( 1, intval( $this->getOption( 'batchsize', 500 ) ) );
-               $maxlag = intval( $this->getOption( 'max-slave-lag', 5 ) );
 
                $this->output( "Cleaning up module_deps table...\n" );
                $i = 1;
@@ -63,7 +55,7 @@ class CleanupRemovedModules extends Maintenance {
                        $numRows = $dbw->affectedRows();
                        $this->output( "Batch $i: $numRows rows\n" );
                        $i++;
-                       wfWaitForSlaves( $maxlag );
+                       wfWaitForSlaves();
                } while ( $numRows > 0 );
                $this->output( "done\n" );
 
@@ -77,7 +69,7 @@ class CleanupRemovedModules extends Maintenance {
                        $numRows = $dbw->affectedRows();
                        $this->output( "Batch $i: $numRows rows\n" );
                        $i++;
-                       wfWaitForSlaves( $maxlag );
+                       wfWaitForSlaves();
                } while ( $numRows > 0 );
                $this->output( "done\n" );
 
@@ -90,7 +82,7 @@ class CleanupRemovedModules extends Maintenance {
                        $numRows = $dbw->affectedRows();
                        $this->output( "Batch $i: $numRows rows\n" );
                        $i++;
-                       wfWaitForSlaves( $maxlag );
+                       wfWaitForSlaves();
                } while ( $numRows > 0 );
                $this->output( "done\n" );
        }
index cbd1be6..f6259e9 100644 (file)
@@ -37,7 +37,6 @@ class TableCleanup extends Maintenance {
        );
 
        protected $dryrun = false;
-       protected $maxLag = 10; # if slaves are lagged more than 10 secs, wait
        public $batchSize = 100;
        public $reportInterval = 100;
 
index ab0ca1e..66553bc 100644 (file)
@@ -57,12 +57,6 @@ TEXT;
                        false,
                        true
                );
-               $this->addOption(
-                       'max-slave-lag',
-                       'If slave lag exceeds this many seconds, wait until it drops before continuing. Default: 10',
-                       false,
-                       true
-               );
                $this->addOption(
                        'throttle',
                        'Wait this many milliseconds after each category. Default: 0',
@@ -74,13 +68,9 @@ TEXT;
 
        public function execute() {
                $begin = $this->getOption( 'begin', '' );
-               $maxSlaveLag = $this->getOption( 'max-slave-lag', 10 );
                $throttle = $this->getOption( 'throttle', 0 );
                $force = $this->getOption( 'force', false );
-               $this->doPopulateCategory( $begin, $maxSlaveLag, $throttle, $force );
-       }
 
-       private function doPopulateCategory( $begin, $maxlag, $throttle, $force ) {
                $dbw = wfGetDB( DB_MASTER );
 
                if ( !$force ) {
index 5a14967..8e39978 100644 (file)
@@ -59,7 +59,6 @@ class ImageBuilder extends Maintenance {
 
        public function execute() {
                $this->dbw = wfGetDB( DB_MASTER );
-               $this->maxLag = 10; # if slaves are lagged more than 10 secs, wait
                $this->dryrun = $this->hasOption( 'dry-run' );
                if ( $this->dryrun ) {
                        $GLOBALS['wgReadOnly'] = 'Dry run mode, image upgrades are suppressed';
index 342ffba..5cf8afa 100644 (file)
@@ -24,8 +24,6 @@
  * @author Aryeh Gregor (Simetrical)
  */
 
-#$optionsWithArgs = array( 'begin', 'max-slave-lag' );
-
 require_once __DIR__ . '/Maintenance.php';
 
 /**
index c9b1abb..50665ef 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Wait until slave lag goes under a certain value.
+ * Wait for the slaves to catch up to the master position.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 require_once __DIR__ . '/Maintenance.php';
 
 /**
- * Maintenance script to wait until slave lag goes under a certain value.
+ * Maintenance script to wait for the slaves to catch up to the master position.
  *
  * @ingroup Maintenance
  */
 class WaitForSlave extends Maintenance {
-       public function __construct() {
-               parent::__construct();
-               $this->addArg( 'maxlag', 'How long to wait for the slaves, default 10 seconds', false );
-       }
-
        public function execute() {
-               wfWaitForSlaves( $this->getArg( 0, 10 ) );
+               wfWaitForSlaves();
        }
 }