From: Roan Kattouw Date: Sat, 27 Nov 2010 22:39:56 +0000 (+0000) Subject: Fix bug in load balancer: filter out non-replicating slaves (or slaves otherwise... X-Git-Tag: 1.31.0-rc.0~33709 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=e9f29660a8891d536726f926650eaeb71d3c80e3;p=lhc%2Fweb%2Fwiklou.git Fix bug in load balancer: filter out non-replicating slaves (or slaves otherwise not reporting their lag) even if no max lag is specified --- diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 797c391edb..355ed9250d 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -120,11 +120,11 @@ class LoadBalancer { # Unset excessively lagged servers $lags = $this->getLagTimes( $wiki ); foreach ( $lags as $i => $lag ) { - if ( $i != 0 && isset( $this->mServers[$i]['max lag'] ) ) { + if ( $i != 0 ) { if ( $lag === false ) { wfDebug( "Server #$i is not replicating\n" ); unset( $loads[$i] ); - } elseif ( $lag > $this->mServers[$i]['max lag'] ) { + } elseif ( isset( $this->mServers[$i]['max lag'] ) && $lag > $this->mServers[$i]['max lag'] ) { wfDebug( "Server #$i is excessively lagged ($lag seconds)\n" ); unset( $loads[$i] ); }