Fixed loop in wfWaitForSlaves()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 22 Oct 2014 17:32:48 +0000 (10:32 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 22 Oct 2014 17:32:48 +0000 (10:32 -0700)
* The "break" statements should obviously be "continue" here.

Change-Id: Ia4a9bad77a9f512153aee6b77443104e71f5cd56

includes/GlobalFunctions.php

index ad20c6f..4eea662 100644 (file)
@@ -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