From: Tim Starling Date: Tue, 8 Apr 2008 11:54:34 +0000 (+0000) Subject: Don't use query groups for master connections X-Git-Tag: 1.31.0-rc.0~48537 X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=commitdiff_plain;h=cca70eebf368c954a3de98d06d7bd707bbb3452c;p=lhc%2Fweb%2Fwiklou.git Don't use query groups for master connections --- diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index 891f301e69..52fe9c1fea 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -364,7 +364,9 @@ class LoadBalancer { } # Query groups - if ( !is_array( $groups ) ) { + if ( $i == DB_MASTER ) { + $i = $this->getWriterIndex(); + } elseif ( !is_array( $groups ) ) { $groupIndex = $this->getReaderIndex( $groups, $wiki ); if ( $groupIndex !== false ) { $serverName = $this->getServerName( $groupIndex ); @@ -386,8 +388,6 @@ class LoadBalancer { # Operation-based index if ( $i == DB_SLAVE ) { $i = $this->getReaderIndex( false, $wiki ); - } elseif ( $i == DB_MASTER ) { - $i = $this->getWriterIndex(); } elseif ( $i == DB_LAST ) { # Just use $this->mLastIndex, which should already be set $i = $this->mLastIndex;