Merge "Made getMaxLag() skip checking the master DB"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 11 Jul 2014 17:54:24 +0000 (17:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 11 Jul 2014 17:54:24 +0000 (17:54 +0000)
includes/db/LoadBalancer.php

index b3f9210..0c4188c 100644 (file)
@@ -1050,6 +1050,9 @@ class LoadBalancer {
                $maxIndex = 0;
                if ( $this->getServerCount() > 1 ) { // no replication = no lag
                        foreach ( $this->mServers as $i => $conn ) {
+                               if ( $i == $this->getWriterIndex() ) {
+                                       continue; // nothing to check
+                               }
                                $conn = false;
                                if ( $wiki === false ) {
                                        $conn = $this->getAnyOpenConnection( $i );