From: Roan Kattouw Date: Mon, 14 Mar 2011 09:30:56 +0000 (+0000) Subject: (bug 27975) Fix r83529 (slave catchup in updateCollation.php) to not try to wait... X-Git-Tag: 1.31.0-rc.0~31434 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/rappels.php?a=commitdiff_plain;h=a38fd53df27b5e0e39178b8de5b662e5c2dbeac8;p=lhc%2Fweb%2Fwiklou.git (bug 27975) Fix r83529 (slave catchup in updateCollation.php) to not try to wait for slaves if there are none. Reporter was getting a permission error for getting the master position on a single-server setup --- diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 30b95a53de..2a01da412b 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -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() {