r64051 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64050‎ | r64051 | r64052 >
Date:01:21, 23 March 2010
Author:tstarling
Status:ok
Tags:
Comment:
MFT r63764, r63897, r63898, r63899, r63900, r63901, r63902: assorted working copy patches made permanent, merged back to here via trunk.
Modified paths:
  • /branches/wmf-deployment (modified) (history)
  • /branches/wmf-deployment/extensions/ExtensionDistributor (modified) (history)
  • /branches/wmf-deployment/extensions/ExtensionDistributor/svn-invoker.conf.sample (added) (history)
  • /branches/wmf-deployment/extensions/ExtensionDistributor/svn-invoker.php (modified) (history)
  • /branches/wmf-deployment/includes (modified) (history)
  • /branches/wmf-deployment/includes/db/LoadBalancer.php (modified) (history)
  • /branches/wmf-deployment/maintenance (modified) (history)
  • /branches/wmf-deployment/maintenance/dumpInterwiki.php (modified) (history)
  • /branches/wmf-deployment/maintenance/lag.php (modified) (history)
  • /branches/wmf-deployment/maintenance/namespaceDupes.php (modified) (history)
  • /branches/wmf-deployment/maintenance/storage (modified) (history)
  • /branches/wmf-deployment/maintenance/storage/dumpRev.php (modified) (history)
  • /branches/wmf-deployment/maintenance/storage/recompressTracked.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/maintenance/lag.php
@@ -13,6 +13,7 @@
1414 print("\n");
1515
1616 while( 1 ) {
 17+ $lb->clearLagTimeCache();
1718 $lags = $lb->getLagTimes();
1819 unset( $lags[0] );
1920 print( gmdate( 'H:i:s' ) . ' ' );
Index: branches/wmf-deployment/maintenance/storage/recompressTracked.php
@@ -31,11 +31,13 @@
3232 var $copyOnly = false;
3333 var $isChild = false;
3434 var $slaveId = false;
 35+ var $noCount = false;
3536 var $debugLog, $infoLog, $criticalLog;
3637 var $store;
3738
3839 static $optionsWithArgs = array( 'procs', 'slave-id', 'debug-log', 'info-log', 'critical-log' );
3940 static $cmdLineOptionMap = array(
 41+ 'no-count' => 'noCount',
4042 'procs' => 'numProcs',
4143 'copy-only' => 'copyOnly',
4244 'child' => 'isChild',
@@ -259,12 +261,16 @@
260262 $dbr = wfGetDB( DB_SLAVE );
261263 $i = 0;
262264 $startId = 0;
263 - $numPages = $dbr->selectField( 'blob_tracking',
264 - 'COUNT(DISTINCT bt_page)',
265 - # A condition is required so that this query uses the index
266 - array( 'bt_moved' => 0 ),
267 - __METHOD__
268 - );
 265+ if ( $this->noCount ) {
 266+ $numPages = '[unknown]';
 267+ } else {
 268+ $numPages = $dbr->selectField( 'blob_tracking',
 269+ 'COUNT(DISTINCT bt_page)',
 270+ # A condition is required so that this query uses the index
 271+ array( 'bt_moved' => 0 ),
 272+ __METHOD__
 273+ );
 274+ }
269275 if ( $this->copyOnly ) {
270276 $this->info( "Copying pages..." );
271277 } else {
@@ -310,7 +316,7 @@
311317 if ( $current == $end || $this->numBatches >= $this->reportingInterval ) {
312318 $this->numBatches = 0;
313319 $this->info( "$label: $current / $end" );
314 - wfWaitForSlaves( 5 );
 320+ $this->waitForSlaves();
315321 }
316322 }
317323
@@ -321,12 +327,16 @@
322328 $dbr = wfGetDB( DB_SLAVE );
323329 $startId = 0;
324330 $i = 0;
325 - $numOrphans = $dbr->selectField( 'blob_tracking',
326 - 'COUNT(DISTINCT bt_text_id)',
327 - array( 'bt_moved' => 0, 'bt_page' => 0 ),
328 - __METHOD__ );
329 - if ( !$numOrphans ) {
330 - return;
 331+ if ( $this->noCount ) {
 332+ $numOrphans = '[unknown]';
 333+ } else {
 334+ $numOrphans = $dbr->selectField( 'blob_tracking',
 335+ 'COUNT(DISTINCT bt_text_id)',
 336+ array( 'bt_moved' => 0, 'bt_page' => 0 ),
 337+ __METHOD__ );
 338+ if ( !$numOrphans ) {
 339+ return;
 340+ }
331341 }
332342 if ( $this->copyOnly ) {
333343 $this->info( "Copying orphans..." );
@@ -404,7 +414,7 @@
405415 case 'quit':
406416 return;
407417 }
408 - wfWaitForSlaves( 5 );
 418+ $this->waitForSlaves();
409419 }
410420 }
411421
@@ -469,6 +479,7 @@
470480 $this->debug( "$titleText: committing blob with " . $trx->getSize() . " items" );
471481 $trx->commit();
472482 $trx = new CgzCopyTransaction( $this, $this->pageBlobClass );
 483+ $this->waitForSlaves();
473484 }
474485 }
475486 $startId = $row->bt_text_id;
@@ -545,6 +556,9 @@
546557 $this->debug( 'Incomplete: ' . $res->numRows() . ' rows' );
547558 foreach ( $res as $row ) {
548559 $this->moveTextRow( $row->bt_text_id, $row->bt_new_url );
 560+ if ( $row->bt_text_id % 10 == 0 ) {
 561+ $this->waitForSlaves();
 562+ }
549563 }
550564 $startId = $row->bt_text_id;
551565 }
@@ -604,11 +618,26 @@
605619 $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" );
606620 $trx->commit();
607621 $trx = new CgzCopyTransaction( $this, $this->orphanBlobClass );
 622+ $this->waitForSlaves();
608623 }
609624 }
610625 $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" );
611626 $trx->commit();
612627 }
 628+
 629+ /**
 630+ * Wait for slaves (quietly)
 631+ */
 632+ function waitForSlaves() {
 633+ $lb = wfGetLB();
 634+ while ( true ) {
 635+ list( $host, $maxLag ) = $lb->getMaxLag();
 636+ if ( $maxLag < 2 ) {
 637+ break;
 638+ }
 639+ sleep( 5 );
 640+ }
 641+ }
613642 }
614643
615644 /**
Index: branches/wmf-deployment/maintenance/storage/dumpRev.php
@@ -62,7 +62,8 @@
6363 $text = gzinflate( $text );
6464 }
6565 if ( in_array( 'object', $flags ) ) {
66 - $text = unserialize( $text );
 66+ $obj = unserialize( $text );
 67+ $text = $obj->getText();
6768 }
6869
6970 if ( is_object( $text ) ) {
Property changes on: branches/wmf-deployment/maintenance/storage
___________________________________________________________________
Name: svn:mergeinfo
7071 - /branches/REL1_15/phase3/maintenance/storage:51646
/trunk/phase3/maintenance/storage:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,56862,56867,57154-57447,57541,57916,58151,58219,58633,58816,59478,62981
7172 + /branches/REL1_15/phase3/maintenance/storage:51646
/trunk/phase3/maintenance/storage:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,56862,56867,57154-57447,57541,57916,58151,58219,58633,58816,59478,62981,63897-63901
Index: branches/wmf-deployment/maintenance/dumpInterwiki.php
@@ -14,7 +14,7 @@
1515
1616 $optionsWithArgs = array( "o" );
1717 require_once( dirname(__FILE__) . '/commandLine.inc' );
18 -require( "dumpInterwiki.inc" );
 18+require( dirname(__FILE__)."/dumpInterwiki.inc" );
1919 chdir( $oldCwd );
2020
2121 # Output
Index: branches/wmf-deployment/maintenance/namespaceDupes.php
@@ -153,20 +153,12 @@
154154 * @param $suffix String Suffix to append to renamed articles
155155 */
156156 private function checkNamespace( $ns, $name, $fix, $suffix = '' ) {
157 - if( $ns == 0 ) {
158 - $header = "Checking interwiki prefix: \"$name\"\n";
159 - } else {
160 - $header = "Checking namespace $ns: \"$name\"\n";
161 - }
162 -
163157 $conflicts = $this->getConflicts( $ns, $name );
164158 $count = count( $conflicts );
165159 if( $count == 0 ) {
166 - $this->output( $header . "... no conflict detected!\n" );
167160 return true;
168161 }
169162
170 - $this->output( $header . "... $count conflicts detected:\n" );
171163 $ok = true;
172164 foreach( $conflicts as $row ) {
173165 $resolvable = $this->reportConflict( $row, $suffix );
Property changes on: branches/wmf-deployment/maintenance
___________________________________________________________________
Name: svn:mergeinfo
174166 - /branches/REL1_15/phase3/maintenance:51646
/trunk/phase3/maintenance:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,56862,56867,57154-57447,57541,57916,58151,58219,58633,58816,59478
175167 + /branches/REL1_15/phase3/maintenance:51646
/trunk/phase3/maintenance:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,56862,56867,57154-57447,57541,57916,58151,58219,58633,58816,59478,63897-63901
Index: branches/wmf-deployment/extensions/ExtensionDistributor/svn-invoker.conf.sample
@@ -0,0 +1,4 @@
 2+<?php
 3+
 4+$wgExtDistWorkingCopy = '/path/to/mw-working-copy';
 5+
Index: branches/wmf-deployment/extensions/ExtensionDistributor/svn-invoker.php
@@ -9,7 +9,13 @@
1010 exit( 1 );
1111 }
1212
13 -$wgExtDistWorkingCopy = '/mnt/upload5/private/ExtensionDistributor/mw-snapshot';
 13+$confFile = dirname( __FILE__ ) . '/svn-invoker.conf';
 14+if ( !file_exists( $confFile ) ) {
 15+ echo "Error: please create svn-invoker.conf based on svn-invoker.conf.sample\n";
 16+ exit( 1 );
 17+}
 18+require( $confFile );
 19+
1420 svnExecute();
1521
1622 function svnValidate( $s ) {
Property changes on: branches/wmf-deployment/extensions/ExtensionDistributor
___________________________________________________________________
Name: svn:mergeinfo
1723 + /branches/REL1_15/phase3/extensions/ExtensionDistributor:51646
/trunk/extensions/ExtensionDistributor:56207,56209,56296,56333,56355,63902
/trunk/phase3/extensions/ExtensionDistributor:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816
Name: svn:ignore
1824 + svn-invoker.conf
Index: branches/wmf-deployment/includes/db/LoadBalancer.php
@@ -916,4 +916,11 @@
917917 $this->mLagTimes = $this->getLoadMonitor()->getLagTimes( array_keys( $this->mServers ), $wiki );
918918 return $this->mLagTimes;
919919 }
 920+
 921+ /**
 922+ * Clear the cache for getLagTimes
 923+ */
 924+ function clearLagTimeCache() {
 925+ $this->mLagTimes = null;
 926+ }
920927 }
Property changes on: branches/wmf-deployment/includes
___________________________________________________________________
Name: svn:mergeinfo
921928 - /branches/REL1_15/phase3/includes:51646
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57530,57541,57602,57916,58151,58219,58633,58816,59718,60704,60760,61189,61557
922929 + /branches/REL1_15/phase3/includes:51646
/branches/wmf-deployment/includes:53381
/trunk/phase3/includes:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57530,57541,57602,57916,58151,58219,58633,58816,59718,60704,60760,61189,61557,63897-63901
Property changes on: branches/wmf-deployment
___________________________________________________________________
Name: svn:mergeinfo
923930 - /branches/REL1_15/phase3:51646
/trunk/phase3:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816,59718
924931 + /branches/REL1_15/phase3:51646
/trunk/phase3:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816,59718,63897-63901

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63764(bug 19627) Fix regression from r57867 where HTMLForm would output <element c...catrope08:11, 15 March 2010
r63897* Fixed complete breakage of "lag.php -r" due to spurious line-endings introd...tstarling05:23, 18 March 2010
r63898* Quieter, more frequent slave waits...tstarling05:32, 18 March 2010
r63899Fixed object type unserialization. Based on WMF working copy patch, tested th...tstarling05:34, 18 March 2010
r63900Fixed inappropriate include_path dependency. From WMF working copy hack.tstarling05:38, 18 March 2010
r63901Don't send hundreds of lines of useless progress messages to stdout.tstarling05:42, 18 March 2010
r63902Fix for incorrect hard-coded path name in standalone script. To eliminate WMF...tstarling05:54, 18 March 2010

Status & tagging log