* If DB_SLAVE was used but a master was picked due to having
non-zero load, that should not issue a warning.
Change-Id: I79f3c477b4160b15ffb7f7679d7e15cabc236b82
? array( false ) // check one "group": the generic pool
: (array)$groups;
? array( false ) // check one "group": the generic pool
: (array)$groups;
+ $masterOnly = ( $i == DB_MASTER || $i == $this->getWriterIndex() );
+ $oldConnsOpened = $this->connsOpened; // connections open now
+
if ( $i == DB_MASTER ) {
$i = $this->getWriterIndex();
} else {
if ( $i == DB_MASTER ) {
$i = $this->getWriterIndex();
} else {
return $this->reportConnectionError();
}
return $this->reportConnectionError();
}
+ # Profile any new connections that happen
+ if ( $this->connsOpened > $oldConnsOpened ) {
+ $host = $conn->getServer();
+ $dbname = $conn->getDBname();
+ $trxProf = Profiler::instance()->getTransactionProfiler();
+ $trxProf->recordConnection( $host, $dbname, $masterOnly );
+ }
+
- $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'] );
$db->setLBInfo( $server );
if ( isset( $server['fakeSlaveLag'] ) ) {
$db->setFakeSlaveLag( $server['fakeSlaveLag'] );