Remove slave servers from rotation if the slave thread is not running on them
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 25 Apr 2007 07:42:14 +0000 (07:42 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 25 Apr 2007 07:42:14 +0000 (07:42 +0000)
includes/LoadBalancer.php

index d3d072e..4ebe26c 100644 (file)
@@ -95,7 +95,9 @@ class LoadBalancer {
                # Unset excessively lagged servers
                $lags = $this->getLagTimes();
                foreach ( $lags as $i => $lag ) {
-                       if ( isset( $this->mServers[$i]['max lag'] ) && $lag > $this->mServers[$i]['max lag'] ) {
+                       if ( $i != 0 && isset( $this->mServers[$i]['max lag'] ) && 
+                               ( $lag === false || $lag > $this->mServers[$i]['max lag'] ) ) 
+                       {
                                unset( $loads[$i] );
                        }
                }