Index: branches/wmf-deployment/maintenance/lag.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | print("\n"); |
15 | 15 | |
16 | 16 | while( 1 ) { |
| 17 | + $lb->clearLagTimeCache(); |
17 | 18 | $lags = $lb->getLagTimes(); |
18 | 19 | unset( $lags[0] ); |
19 | 20 | print( gmdate( 'H:i:s' ) . ' ' ); |
Index: branches/wmf-deployment/maintenance/storage/recompressTracked.php |
— | — | @@ -31,11 +31,13 @@ |
32 | 32 | var $copyOnly = false; |
33 | 33 | var $isChild = false; |
34 | 34 | var $slaveId = false; |
| 35 | + var $noCount = false; |
35 | 36 | var $debugLog, $infoLog, $criticalLog; |
36 | 37 | var $store; |
37 | 38 | |
38 | 39 | static $optionsWithArgs = array( 'procs', 'slave-id', 'debug-log', 'info-log', 'critical-log' ); |
39 | 40 | static $cmdLineOptionMap = array( |
| 41 | + 'no-count' => 'noCount', |
40 | 42 | 'procs' => 'numProcs', |
41 | 43 | 'copy-only' => 'copyOnly', |
42 | 44 | 'child' => 'isChild', |
— | — | @@ -259,12 +261,16 @@ |
260 | 262 | $dbr = wfGetDB( DB_SLAVE ); |
261 | 263 | $i = 0; |
262 | 264 | $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 | + } |
269 | 275 | if ( $this->copyOnly ) { |
270 | 276 | $this->info( "Copying pages..." ); |
271 | 277 | } else { |
— | — | @@ -310,7 +316,7 @@ |
311 | 317 | if ( $current == $end || $this->numBatches >= $this->reportingInterval ) { |
312 | 318 | $this->numBatches = 0; |
313 | 319 | $this->info( "$label: $current / $end" ); |
314 | | - wfWaitForSlaves( 5 ); |
| 320 | + $this->waitForSlaves(); |
315 | 321 | } |
316 | 322 | } |
317 | 323 | |
— | — | @@ -321,12 +327,16 @@ |
322 | 328 | $dbr = wfGetDB( DB_SLAVE ); |
323 | 329 | $startId = 0; |
324 | 330 | $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 | + } |
331 | 341 | } |
332 | 342 | if ( $this->copyOnly ) { |
333 | 343 | $this->info( "Copying orphans..." ); |
— | — | @@ -404,7 +414,7 @@ |
405 | 415 | case 'quit': |
406 | 416 | return; |
407 | 417 | } |
408 | | - wfWaitForSlaves( 5 ); |
| 418 | + $this->waitForSlaves(); |
409 | 419 | } |
410 | 420 | } |
411 | 421 | |
— | — | @@ -469,6 +479,7 @@ |
470 | 480 | $this->debug( "$titleText: committing blob with " . $trx->getSize() . " items" ); |
471 | 481 | $trx->commit(); |
472 | 482 | $trx = new CgzCopyTransaction( $this, $this->pageBlobClass ); |
| 483 | + $this->waitForSlaves(); |
473 | 484 | } |
474 | 485 | } |
475 | 486 | $startId = $row->bt_text_id; |
— | — | @@ -545,6 +556,9 @@ |
546 | 557 | $this->debug( 'Incomplete: ' . $res->numRows() . ' rows' ); |
547 | 558 | foreach ( $res as $row ) { |
548 | 559 | $this->moveTextRow( $row->bt_text_id, $row->bt_new_url ); |
| 560 | + if ( $row->bt_text_id % 10 == 0 ) { |
| 561 | + $this->waitForSlaves(); |
| 562 | + } |
549 | 563 | } |
550 | 564 | $startId = $row->bt_text_id; |
551 | 565 | } |
— | — | @@ -604,11 +618,26 @@ |
605 | 619 | $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" ); |
606 | 620 | $trx->commit(); |
607 | 621 | $trx = new CgzCopyTransaction( $this, $this->orphanBlobClass ); |
| 622 | + $this->waitForSlaves(); |
608 | 623 | } |
609 | 624 | } |
610 | 625 | $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" ); |
611 | 626 | $trx->commit(); |
612 | 627 | } |
| 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 | + } |
613 | 642 | } |
614 | 643 | |
615 | 644 | /** |
Index: branches/wmf-deployment/maintenance/storage/dumpRev.php |
— | — | @@ -62,7 +62,8 @@ |
63 | 63 | $text = gzinflate( $text ); |
64 | 64 | } |
65 | 65 | if ( in_array( 'object', $flags ) ) { |
66 | | - $text = unserialize( $text ); |
| 66 | + $obj = unserialize( $text ); |
| 67 | + $text = $obj->getText(); |
67 | 68 | } |
68 | 69 | |
69 | 70 | if ( is_object( $text ) ) { |
Property changes on: branches/wmf-deployment/maintenance/storage |
___________________________________________________________________ |
Name: svn:mergeinfo |
70 | 71 | - /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 |
71 | 72 | + /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 @@ |
15 | 15 | |
16 | 16 | $optionsWithArgs = array( "o" ); |
17 | 17 | require_once( dirname(__FILE__) . '/commandLine.inc' ); |
18 | | -require( "dumpInterwiki.inc" ); |
| 18 | +require( dirname(__FILE__)."/dumpInterwiki.inc" ); |
19 | 19 | chdir( $oldCwd ); |
20 | 20 | |
21 | 21 | # Output |
Index: branches/wmf-deployment/maintenance/namespaceDupes.php |
— | — | @@ -153,20 +153,12 @@ |
154 | 154 | * @param $suffix String Suffix to append to renamed articles |
155 | 155 | */ |
156 | 156 | 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 | | - |
163 | 157 | $conflicts = $this->getConflicts( $ns, $name ); |
164 | 158 | $count = count( $conflicts ); |
165 | 159 | if( $count == 0 ) { |
166 | | - $this->output( $header . "... no conflict detected!\n" ); |
167 | 160 | return true; |
168 | 161 | } |
169 | 162 | |
170 | | - $this->output( $header . "... $count conflicts detected:\n" ); |
171 | 163 | $ok = true; |
172 | 164 | foreach( $conflicts as $row ) { |
173 | 165 | $resolvable = $this->reportConflict( $row, $suffix ); |
Property changes on: branches/wmf-deployment/maintenance |
___________________________________________________________________ |
Name: svn:mergeinfo |
174 | 166 | - /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 |
175 | 167 | + /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 @@ |
10 | 10 | exit( 1 ); |
11 | 11 | } |
12 | 12 | |
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 | + |
14 | 20 | svnExecute(); |
15 | 21 | |
16 | 22 | function svnValidate( $s ) { |
Property changes on: branches/wmf-deployment/extensions/ExtensionDistributor |
___________________________________________________________________ |
Name: svn:mergeinfo |
17 | 23 | + /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 |
18 | 24 | + svn-invoker.conf |
Index: branches/wmf-deployment/includes/db/LoadBalancer.php |
— | — | @@ -916,4 +916,11 @@ |
917 | 917 | $this->mLagTimes = $this->getLoadMonitor()->getLagTimes( array_keys( $this->mServers ), $wiki ); |
918 | 918 | return $this->mLagTimes; |
919 | 919 | } |
| 920 | + |
| 921 | + /** |
| 922 | + * Clear the cache for getLagTimes |
| 923 | + */ |
| 924 | + function clearLagTimeCache() { |
| 925 | + $this->mLagTimes = null; |
| 926 | + } |
920 | 927 | } |
Property changes on: branches/wmf-deployment/includes |
___________________________________________________________________ |
Name: svn:mergeinfo |
921 | 928 | - /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 |
922 | 929 | + /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 |
923 | 930 | - /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 |
924 | 931 | + /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 |