From f4488f8ca071359785ea85ce2b1375be7928593c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 25 Apr 2007 07:42:14 +0000 Subject: [PATCH] Remove slave servers from rotation if the slave thread is not running on them --- includes/LoadBalancer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index d3d072eed3..4ebe26c708 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -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] ); } } -- 2.20.1