r77373 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77372‎ | r77373 | r77374 >
Date:22:39, 27 November 2010
Author:catrope
Status:ok
Tags:
Comment:
Fix bug in load balancer: filter out non-replicating slaves (or slaves otherwise not reporting their lag) even if no max lag is specified
Modified paths:
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/LoadBalancer.php
@@ -120,11 +120,11 @@
121121 # Unset excessively lagged servers
122122 $lags = $this->getLagTimes( $wiki );
123123 foreach ( $lags as $i => $lag ) {
124 - if ( $i != 0 && isset( $this->mServers[$i]['max lag'] ) ) {
 124+ if ( $i != 0 ) {
125125 if ( $lag === false ) {
126126 wfDebug( "Server #$i is not replicating\n" );
127127 unset( $loads[$i] );
128 - } elseif ( $lag > $this->mServers[$i]['max lag'] ) {
 128+ } elseif ( isset( $this->mServers[$i]['max lag'] ) && $lag > $this->mServers[$i]['max lag'] ) {
129129 wfDebug( "Server #$i is excessively lagged ($lag seconds)\n" );
130130 unset( $loads[$i] );
131131 }

Status & tagging log