MediaWiki master
ILoadBalancerForOwner.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use Exception;
23
36 public const STAGE_POSTCOMMIT_CALLBACKS = 'stage-postcommit-callbacks';
38 public const STAGE_POSTROLLBACK_CALLBACKS = 'stage-postrollback-callbacks';
39
72 public function __construct( array $params );
73
81 public function disable( $fname = __METHOD__ );
82
89 public function closeAll( $fname = __METHOD__ );
90
100 public function finalizePrimaryChanges( $fname = __METHOD__ );
101
112 public function approvePrimaryChanges( int $maxWriteDuration, $fname = __METHOD__ );
113
126 public function beginPrimaryChanges( $fname = __METHOD__ );
127
134 public function commitPrimaryChanges( $fname = __METHOD__ );
135
143 public function runPrimaryTransactionIdleCallbacks( $fname = __METHOD__ );
144
152 public function runPrimaryTransactionListenerCallbacks( $fname = __METHOD__ );
153
161 public function rollbackPrimaryChanges( $fname = __METHOD__ );
162
172 public function flushPrimarySessions( $fname = __METHOD__ );
173
179 public function flushReplicaSnapshots( $fname = __METHOD__ );
180
189 public function flushPrimarySnapshots( $fname = __METHOD__ );
190
198
205 public function setLocalDomainPrefix( $prefix );
206
219 public function reconfigure( array $params );
220
227 public function redefineLocalDomain( $domain );
228
233 public function hasPrimaryConnection();
234
247 public function setIndexAliases( array $aliases );
248
257 public function lastPrimaryChangeTimestamp();
258
269 public function waitForAll( DBPrimaryPos $pos, $timeout = null );
270
277 public function laggedReplicaUsed();
278}
array $params
The job parameters.
An object representing a primary or replica DB position in a replicated setup.
Internal interface for load balancer instances exposed to their owner.
flushPrimarySnapshots( $fname=__METHOD__)
Commit all primary DB transactions so as to flush any REPEATABLE-READ or SSI snapshots.
beginPrimaryChanges( $fname=__METHOD__)
Flush any primary transaction snapshots and set DBO_TRX (if DBO_DEFAULT is set)
setIndexAliases(array $aliases)
Convert certain index names to alternative names before querying the DB.
pendingPrimaryChangeCallers()
Get the list of callers that have pending primary changes.
setLocalDomainPrefix( $prefix)
Set a new table prefix for the existing local domain ID for testing.
flushPrimarySessions( $fname=__METHOD__)
Release/destroy session-level named locks, table locks, and temp tables.
laggedReplicaUsed()
Whether a highly "lagged" replica database connection was queried.
commitPrimaryChanges( $fname=__METHOD__)
Issue COMMIT on all open primary connections to flush changes and view snapshots.
finalizePrimaryChanges( $fname=__METHOD__)
Run pre-commit callbacks and defer execution of post-commit callbacks.
waitForAll(DBPrimaryPos $pos, $timeout=null)
Set the primary wait position and wait for ALL replica DBs to catch up to it.
lastPrimaryChangeTimestamp()
Get the last time that a tracked connection was used to commit a write.
const STAGE_POSTROLLBACK_CALLBACKS
Manager of ILoadBalancer instances is running post-rollback callbacks.
reconfigure(array $params)
Reconfigure using the given config array.
runPrimaryTransactionListenerCallbacks( $fname=__METHOD__)
Run all recurring post-COMMIT/ROLLBACK listener callbacks.
redefineLocalDomain( $domain)
Close all connection and redefine the local domain for testing or schema creation.
closeAll( $fname=__METHOD__)
Close all open connections.
approvePrimaryChanges(int $maxWriteDuration, $fname=__METHOD__)
Perform all pre-commit checks for things like replication safety.
rollbackPrimaryChanges( $fname=__METHOD__)
Issue ROLLBACK only on primary, only if queries were done on connection.
disable( $fname=__METHOD__)
Close all connections and disable this load balancer.
flushReplicaSnapshots( $fname=__METHOD__)
Commit all replica DB transactions so as to flush any REPEATABLE-READ or SSI snapshots.
const STAGE_POSTCOMMIT_CALLBACKS
Manager of ILoadBalancer instances is running post-commit callbacks.
runPrimaryTransactionIdleCallbacks( $fname=__METHOD__)
Consume and run all pending post-COMMIT/ROLLBACK callbacks and commit dangling transactions.
This class is a delegate to ILBFactory for a given database cluster.