}
public function destroy() {
- $this->shutdown( self::SHUTDOWN_NO_CHRONPROT );
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->forEachLBCallMethod( 'disable' );
}
&$cpIndex = null,
&$cpClientId = null
) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$chronProt = $this->getChronologyProtector();
if ( $mode === self::SHUTDOWN_CHRONPROT_SYNC ) {
$this->shutdownChronologyProtector( $chronProt, $workCallback, 'sync', $cpIndex );
final public function beginMasterChanges( $fname = __METHOD__ ) {
$this->assertTransactionRoundStage( self::ROUND_CURSORY );
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->trxRoundStage = self::ROUND_BEGINNING;
if ( $this->trxRoundId !== false ) {
throw new DBTransactionError(
final public function commitMasterChanges( $fname = __METHOD__, array $options = [] ) {
$this->assertTransactionRoundStage( self::ROUND_CURSORY );
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->trxRoundStage = self::ROUND_COMMITTING;
if ( $this->trxRoundId !== false && $this->trxRoundId !== $fname ) {
throw new DBTransactionError(
"$fname: transaction round '{$this->trxRoundId}' still running"
);
}
- /** @noinspection PhpUnusedLocalVariableInspection */
- $scope = ScopedCallback::newScopedIgnoreUserAbort(); // try to ignore client aborts
// Run pre-commit callbacks and suppress post-commit callbacks, aborting on failure
do {
$count = 0; // number of callbacks executed this iteration
}
final public function rollbackMasterChanges( $fname = __METHOD__ ) {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->trxRoundStage = self::ROUND_ROLLING_BACK;
$this->trxRoundId = false;
// Actually perform the rollback on all master DB connections and revert DBO_TRX
// time needed to wait on the next clusters.
$masterPositions = array_fill( 0, count( $lbs ), false );
foreach ( $lbs as $i => $lb ) {
- if ( !$lb->hasStreamingReplicaServers() ) {
- continue; // T29975: no replication; avoid getMasterPos() permissions errors
- } elseif (
- $opts['ifWritesSince'] &&
- $lb->lastMasterChangeTimestamp() < $opts['ifWritesSince']
+ if (
+ // No writes to wait on getting replicated
+ !$lb->hasMasterConnection() ||
+ // No replication; avoid getMasterPos() permissions errors (T29975)
+ !$lb->hasStreamingReplicaServers() ||
+ // No writes since the last replication wait
+ (
+ $opts['ifWritesSince'] &&
+ $lb->lastMasterChangeTimestamp() < $opts['ifWritesSince']
+ )
) {
- continue; // no writes since the last wait
+ continue; // no need to wait
}
+
$masterPositions[$i] = $lb->getMasterPos();
}
$this->indexAliases = $aliases;
}
- /**
- * @param string $prefix
- * @deprecated Since 1.33
- */
- public function setDomainPrefix( $prefix ) {
- $this->setLocalDomainPrefix( $prefix );
- }
-
public function setLocalDomainPrefix( $prefix ) {
$this->localDomain = new DatabaseDomain(
$this->localDomain->getDatabase(),
}
public function closeAll() {
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $scope = ScopedCallback::newScopedIgnoreUserAbort();
+
$this->forEachLBCallMethod( 'closeAll' );
}