/** @var string|null */
private $defaultGroup = null;
+ /** @var int|null */
+ protected $maxLag;
+
const ROUND_CURSORY = 'cursory';
const ROUND_BEGINNING = 'within-begin';
const ROUND_COMMITTING = 'within-commit';
? DatabaseDomain::newFromId( $conf['localDomain'] )
: DatabaseDomain::newUnspecified();
+ $this->maxLag = $conf['maxLag'] ?? null;
if ( isset( $conf['readOnlyReason'] ) && is_string( $conf['readOnlyReason'] ) ) {
$this->readOnlyReason = $conf['readOnlyReason'];
}
'hostname' => $this->hostname,
'cliMode' => $this->cliMode,
'agent' => $this->agent,
+ 'maxLag' => $this->maxLag,
'defaultGroup' => $this->defaultGroup,
'chronologyCallback' => function ( ILoadBalancer $lb ) {
// Defer ChronologyProtector construction in case setRequestInfo() ends up
$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(),
null,
);
$this->forEachLB( function ( ILoadBalancer $lb ) use ( $prefix ) {
- $lb->setDomainPrefix( $prefix );
+ $lb->setLocalDomainPrefix( $prefix );
+ } );
+ }
+
+ public function redefineLocalDomain( $domain ) {
+ $this->closeAll();
+
+ $this->localDomain = DatabaseDomain::newFromId( $domain );
+
+ $this->forEachLB( function ( ILoadBalancer $lb ) {
+ $lb->redefineLocalDomain( $this->localDomain );
} );
}