use WANObjectCache;
use Exception;
use RuntimeException;
-use IDatabase;
-use DBTransactionError;
-use DBReplicationWaitError;
/**
* An interface for generating database load balancers
/** @var BagOStuff */
protected $srvCache;
/** @var BagOStuff */
- protected $memCache;
+ protected $memStash;
/** @var WANObjectCache */
protected $wanCache;
}
$this->srvCache = isset( $conf['srvCache'] ) ? $conf['srvCache'] : new EmptyBagOStuff();
- $this->memCache = isset( $conf['memCache'] ) ? $conf['memCache'] : new EmptyBagOStuff();
+ $this->memStash = isset( $conf['memStash'] ) ? $conf['memStash'] : new EmptyBagOStuff();
$this->wanCache = isset( $conf['wanCache'] )
? $conf['wanCache']
: WANObjectCache::newEmpty();
} );
}
+ public function hasTransactionRound() {
+ return ( $this->trxRoundId !== false );
+ }
+
/**
* Log query info if multi DB transactions are going to be committed now
*/
$masterPositions = array_fill( 0, count( $lbs ), false );
foreach ( $lbs as $i => $lb ) {
if ( $lb->getServerCount() <= 1 ) {
- // Bug 27975 - Don't try to wait for replica DBs if there are none
+ // T29975 - Don't try to wait for replica DBs if there are none
// Prevents permission error when getting master position
continue;
} elseif ( $opts['ifWritesSince']
}
$this->chronProt = new ChronologyProtector(
- $this->memCache,
+ $this->memStash,
[
'ip' => $this->requestInfo['IPAddress'],
'agent' => $this->requestInfo['UserAgent'],
'errorLogger' => $this->errorLogger,
'hostname' => $this->hostname,
'cliMode' => $this->cliMode,
- 'agent' => $this->agent
+ 'agent' => $this->agent,
+ 'chronologyProtector' => $this->getChronologyProtector()
];
}
$prefix
);
- $this->forEachLB( function( ILoadBalancer $lb ) use ( $prefix ) {
+ $this->forEachLB( function ( ILoadBalancer $lb ) use ( $prefix ) {
$lb->setDomainPrefix( $prefix );
} );
}
$this->destroy();
}
}
+
+class_alias( LBFactory::class, 'LBFactory' );