From d9f35c8240af1a3b88165479f09dde6458e9f174 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 3 Sep 2016 14:58:38 -0700 Subject: [PATCH] Remove unused DB position values in LoadBalancer Also fixed IDEA error about useless $conn declaration. Change-Id: I73572cb201e44db45fbe9bdb8e06bff4b50cecb2 --- includes/db/loadbalancer/LoadBalancer.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/includes/db/loadbalancer/LoadBalancer.php b/includes/db/loadbalancer/LoadBalancer.php index 7ca0b33e8d..d3a2902a00 100644 --- a/includes/db/loadbalancer/LoadBalancer.php +++ b/includes/db/loadbalancer/LoadBalancer.php @@ -284,7 +284,6 @@ class LoadBalancer { # No server found yet $i = false; - $conn = false; # First try quickly looking through the available servers for a server that # meets our criteria $currentLoads = $nonErrorLoads; @@ -353,9 +352,7 @@ class LoadBalancer { # Replica DB connection successful. # Wait for the session master pos for a short time. if ( $this->mWaitForPos && $i > 0 ) { - if ( !$this->doWait( $i ) ) { - $this->mServers[$i]['slave pos'] = $conn->getSlavePos(); - } + $this->doWait( $i ); } if ( $this->mReadIndex <= 0 && $this->mLoads[$i] > 0 && $group === false ) { $this->mReadIndex = $i; @@ -384,7 +381,6 @@ class LoadBalancer { if ( $i > 0 ) { if ( !$this->doWait( $i ) ) { - $this->mServers[$i]['slave pos'] = $this->getAnyOpenConnection( $i )->getSlavePos(); $this->laggedReplicaMode = true; } } -- 2.20.1