'IPAddress' => $_SERVER[ 'REMOTE_ADDR' ] ?? '',
'UserAgent' => $_SERVER['HTTP_USER_AGENT'] ?? '',
// Headers application can inject via LBFactory::setRequestInfo()
+ 'ChronologyProtection' => null,
'ChronologyClientId' => null, // prior $cpClientId value from LBFactory::shutdown()
'ChronologyPositionIndex' => null // prior $cpIndex value from LBFactory::shutdown()
];
$this->forEachLBCallMethod( 'disable' );
}
+ public function getLocalDomainID() {
+ return $this->localDomain->getId();
+ }
+
+ public function resolveDomainID( $domain ) {
+ return ( $domain !== false ) ? (string)$domain : $this->getLocalDomainID();
+ }
+
public function shutdown(
$mode = self::SHUTDOWN_CHRONPROT_SYNC,
callable $workCallback = null,
$opts += [
'domain' => false,
'cluster' => false,
- 'timeout' => $this->cliMode ? 60 : 10,
+ 'timeout' => $this->cliMode ? 60 : 1,
'ifWritesSince' => null
];
}
}
- if ( $failed ) {
- throw new DBReplicationWaitError(
- null,
- "Could not wait for replica DBs to catch up to " .
- implode( ', ', $failed )
- );
- }
+ return !$failed;
}
public function setWaitForReplicationListener( $name, callable $callback = null ) {
}
$this->commitMasterChanges( $fnameEffective );
- $this->waitForReplication( $opts );
+ $waitSucceeded = $this->waitForReplication( $opts );
// If a nested caller committed on behalf of $fname, start another empty $fname
// transaction, leaving the caller with the same empty transaction state as before.
if ( $fnameEffective !== $fname ) {
$this->beginMasterChanges( $fnameEffective );
}
+ return $waitSucceeded;
}
public function getChronologyProtectorTouched( $dbName ) {