From ada627005aa89d57dbaaece4d76ff78612dd7b1c Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 19 Feb 2015 21:24:26 +0000 Subject: [PATCH] database: Move LoadBalancer::getConnection debugmsg to getReaderIndex Most of the time the early $this->mReadIndex inside getReaderIndex() should be a hit, in which case this message isn't very useful. This one message was filling up over 60% of the build logs (496/720 lines). > LoadBalancer::getConnection: using server for group '' Move it to further down in getReaderIndex() where it actually tries and finds one. Change-Id: Id572f2bb3a905e095fcc929a9e2c17f40f7b1b6e --- includes/db/LoadBalancer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index f357880471..917d703304 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -331,6 +331,8 @@ class LoadBalancer { if ( $this->mReadIndex <= 0 && $this->mLoads[$i] > 0 && $group === false ) { $this->mReadIndex = $i; } + $serverName = $this->getServerName( $i ); + wfDebug( __METHOD__ . ": using server $serverName for group '$group'\n" ); } return $i; @@ -476,8 +478,6 @@ class LoadBalancer { foreach ( $groups as $group ) { $groupIndex = $this->getReaderIndex( $group, $wiki ); if ( $groupIndex !== false ) { - $serverName = $this->getServerName( $groupIndex ); - wfDebug( __METHOD__ . ": using server $serverName for group '$group'\n" ); $i = $groupIndex; break; } -- 2.20.1