Merge "Add page_restrictions to readlock in lockSearchindex"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 12 Apr 2015 18:32:19 +0000 (18:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 12 Apr 2015 18:32:19 +0000 (18:32 +0000)
1  2 
maintenance/Maintenance.php

@@@ -38,8 -38,6 +38,8 @@@ define( 'DO_MAINTENANCE', RUN_MAINTENAN
  
  $maintClass = false;
  
 +use MediaWiki\Logger\LoggerFactory;
 +
  /**
   * Abstract maintenance class for quickly writing and churning out
   * maintenance scripts with minimal effort. All that _must_ be defined
@@@ -614,11 -612,6 +614,11 @@@ abstract class Maintenance 
                        $profiler->setTemplated( true );
                        Profiler::replaceStubInstance( $profiler );
                }
 +
 +              $trxProfiler = Profiler::instance()->getTransactionProfiler();
 +              $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) );
 +              # Catch huge single updates that lead to slave lag
 +              $trxProfiler->setExpectation( 'maxAffected', 1000, __METHOD__ );
        }
  
        /**
                                        }
                                        $options[$option] = $param;
                                }
 +                      } elseif ( $arg == '-' ) {
 +                              # Lonely "-", often used to indicate stdin or stdout.
 +                              $args[] = $arg;
                        } elseif ( substr( $arg, 0, 1 ) == '-' ) {
                                # Short options
                                $argLength = strlen( $arg );
         */
        private function lockSearchindex( $db ) {
                $write = array( 'searchindex' );
-               $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user' );
+               $read = array( 'page', 'revision', 'text', 'interwiki', 'l10n_cache', 'user', 'page_restrictions' );
                $db->lockTables( $read, $write, __CLASS__ . '::' . __METHOD__ );
        }