Fixed possible db error log spam when cluster=* in wfWaitForSlaves()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 29 Oct 2014 23:36:55 +0000 (16:36 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 29 Oct 2014 23:36:55 +0000 (16:36 -0700)
Change-Id: Idd385cddb0fa9f56bddc46d41ae584ca65bc45ed

includes/GlobalFunctions.php

index 379335a..cc7086c 100644 (file)
@@ -3729,7 +3729,9 @@ function wfWaitForSlaves(
                        if ( $ifWritesSince && !$lb->hasMasterConnection() ) {
                                continue; // assume no writes done
                        }
-                       $dbw = $lb->getConnection( DB_MASTER, array(), $wiki );
+                       // Use the empty string to not trigger selectDB() since the connection
+                       // may have been to a server that does not have a DB for the current wiki.
+                       $dbw = $lb->getConnection( DB_MASTER, array(), '' );
                        if ( $ifWritesSince && $dbw->lastDoneWrites() < $ifWritesSince ) {
                                continue; // no writes since the last wait
                        }