Index: branches/wmf/1.16wmf4/maintenance/upgrade-1.17wmf1-initial.php |
— | — | @@ -43,6 +43,10 @@ |
44 | 44 | foreach ( $wikisBySection[$section] as $wiki ) { |
45 | 45 | $db->selectDB( $wiki ); |
46 | 46 | upgradeWiki( $db ); |
| 47 | + while ( $db->getLag() > 10 ) { |
| 48 | + echo "Waiting for $server to catch up to master.\n"; |
| 49 | + sleep( 60 ); |
| 50 | + } |
47 | 51 | } |
48 | 52 | } |
49 | 53 | } |
— | — | @@ -65,17 +69,18 @@ |
66 | 70 | |
67 | 71 | echo "$server $wiki 1.17wmf1-initial"; |
68 | 72 | |
69 | | - $db->sourceFile( dirname( __FILE__ ) .'/schema-changes-1.17wmf1-initial.sql' ); |
| 73 | + sourceUpgradeFile( $db, dirname( __FILE__ ) .'/schema-changes-1.17wmf1-initial.sql' ); |
70 | 74 | |
71 | 75 | if ( $wiki === 'commonswiki' ) { |
72 | 76 | echo " GlobalUsage"; |
73 | | - $db->sourceFile( "$IP/extensions/GlobalUsage/patches/" . |
| 77 | + sourceUpgradeFile( $db, dirname(__FILE__).'/../extensions/GlobalUsage/patches/' . |
74 | 78 | 'patch-globalimagelinks_wiki_nsid_title.sql' ); |
75 | 79 | } |
76 | 80 | |
77 | 81 | if ( $wiki === 'mediawikiwiki' ) { |
78 | 82 | echo " CodeReview"; |
79 | | - $db->sourceFile( "$IP/extensions/CodeReview/archives/code_signoffs.sql" ); |
| 83 | + sourceUpgradeFile( $db, dirname(_FILE__).'/../extensions/CodeReview/archives/' . |
| 84 | + 'code_signoffs.sql' ); |
80 | 85 | } |
81 | 86 | |
82 | 87 | $db->insert( 'updatelog', |
— | — | @@ -84,4 +89,12 @@ |
85 | 90 | echo " ok\n"; |
86 | 91 | } |
87 | 92 | |
| 93 | +function sourceUpgradeFile( $db, $file ) { |
| 94 | + if ( !file_exists( $file ) ) { |
| 95 | + echo "File missing: $file\n"; |
| 96 | + exit( 1 ); |
| 97 | + } |
| 98 | + $db->sourceFile( $file ); |
| 99 | +} |
88 | 100 | |
| 101 | + |