From: Aaron Schulz Date: Wed, 22 Oct 2014 17:32:48 +0000 (-0700) Subject: Fixed loop in wfWaitForSlaves() X-Git-Tag: 1.31.0-rc.0~13520 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=91733632d72c26a1d6f6c7a6ab942534fc2ac3fc;p=lhc%2Fweb%2Fwiklou.git Fixed loop in wfWaitForSlaves() * The "break" statements should obviously be "continue" here. Change-Id: Ia4a9bad77a9f512153aee6b77443104e71f5cd56 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index ad20c6fea6..4eea662420 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3776,7 +3776,7 @@ function wfGetNull() { * does this check, it makes since to use $ifWritesSince, particularly if * cluster is "*", to avoid excess overhead. * - * Never call this method after a big DB write that is still in a transaction. + * Never call this function after a big DB write that is still in a transaction. * This only makes sense after the possible lag inducing changes were committed. * * @param float|null $ifWritesSince Only wait if writes were done since this UNIX timestamp @@ -3813,11 +3813,11 @@ function wfWaitForSlaves( // Prevents permission error when getting master position if ( $lb->getServerCount() > 1 ) { if ( $ifWritesSince && !$lb->hasMasterConnection() ) { - break; // assume no writes done + continue; // assume no writes done } $dbw = $lb->getConnection( DB_MASTER, array(), $wiki ); if ( $ifWritesSince && $dbw->lastDoneWrites() < $ifWritesSince ) { - break; // no writes since the last wait + continue; // no writes since the last wait } $pos = $dbw->getMasterPos(); // The DBMS may not support getMasterPos() or the whole