From: Aaron Schulz Date: Tue, 3 Mar 2015 21:18:18 +0000 (-0800) Subject: Made master connection expectations actually work X-Git-Tag: 1.31.0-rc.0~12194^2 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=c39a4530b0cc833cb02b545c8806f59ac2900d73;p=lhc%2Fweb%2Fwiklou.git Made master connection expectations actually work Bug: –T86862 Change-Id: If918904c6c02ea83473dfaf34dfc2787ab610c6f --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 1a7a97d3ed..b3c81f9bf6 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -817,10 +817,6 @@ abstract class DatabaseBase implements IDatabase { if ( $user ) { $this->open( $server, $user, $password, $dbName ); } - - $isMaster = !is_null( $this->getLBInfo( 'master' ) ); - $trxProf = $this->getTransactionProfiler(); - $trxProf->recordConnection( $this->mServer, $this->mDBname, $isMaster ); } /** diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 917d703304..dd95844811 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -756,6 +756,10 @@ class LoadBalancer { $db = $e->db; } + $isMaster = !empty( $server['master'] ); + $trxProf = Profiler::instance()->getTransactionProfiler(); + $trxProf->recordConnection( $server['host'], $server['dbname'], $isMaster ); + $db->setLBInfo( $server ); if ( isset( $server['fakeSlaveLag'] ) ) { $db->setFakeSlaveLag( $server['fakeSlaveLag'] );