Made getMaxLag() skip checking the master DB
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 9 Jul 2014 19:11:32 +0000 (12:11 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 9 Jul 2014 19:11:32 +0000 (12:11 -0700)
Change-Id: I81a9102570bf9a45af56f31d04e3a0f2be72b919

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 );