(bug 27975) Fix r83529 (slave catchup in updateCollation.php) to not try to wait...
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 14 Mar 2011 09:30:56 +0000 (09:30 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 14 Mar 2011 09:30:56 +0000 (09:30 +0000)
maintenance/updateCollation.php

index 30b95a5..2a01da4 100644 (file)
@@ -48,9 +48,13 @@ TEXT;
        
        public function syncDBs() {
                $lb = wfGetLB();
-               $dbw = $lb->getConnection( DB_MASTER );
-               $pos = $dbw->getMasterPos();
-               $lb->waitForAll( $pos );
+               // bug 27975 - Don't try to wait for slaves if there are none
+               // Prevents permission error when getting master position
+               if ( $lb->getServerCount() > 1 ) {
+                       $dbw = $lb->getConnection( DB_MASTER );
+                       $pos = $dbw->getMasterPos();
+                       $lb->waitForAll( $pos );
+               }
        }
 
        public function execute() {