": server {host} is not replicating?", [ 'host' => $host ] );
unset( $loads[$i] );
} elseif ( $lag > $maxServerLag ) {
- $this->replLogger->info(
+ $this->replLogger->debug(
__METHOD__ .
": server {host} has {lag} seconds of lag (>= {maxlag})",
[ 'host' => $host, 'lag' => $lag, 'maxlag' => $maxServerLag ]
}
public function closeConnection( IDatabase $conn ) {
+ if ( $conn instanceof DBConnRef ) {
+ // Avoid calling close() but still leaving the handle in the pool
+ throw new RuntimeException( __METHOD__ . ': got DBConnRef instance.' );
+ }
+
$serverIndex = $conn->getLBInfo( 'serverIndex' );
foreach ( $this->conns as $type => $connsByServer ) {
if ( !isset( $connsByServer[$serverIndex] ) ) {
$this->indexAliases = $aliases;
}
+ /**
+ * @param string $prefix
+ * @deprecated Since 1.33
+ */
public function setDomainPrefix( $prefix ) {
+ $this->setLocalDomainPrefix( $prefix );
+ }
+
+ public function setLocalDomainPrefix( $prefix ) {
// Find connections to explicit foreign domains still marked as in-use...
$domainsInUse = [];
$this->forEachOpenConnection( function ( IDatabase $conn ) use ( &$domainsInUse ) {
} );
}
+ public function redefineLocalDomain( $domain ) {
+ $this->closeAll();
+
+ $this->setLocalDomain( DatabaseDomain::newFromId( $domain ) );
+ }
+
/**
* @param DatabaseDomain $domain
*/