MediaWiki  master
ILoadBalancerForOwner.php
Go to the documentation of this file.
1 <?php
2 
25 namespace Wikimedia\Rdbms;
26 
27 use Exception;
28 use InvalidArgumentException;
29 
40  public const STAGE_POSTCOMMIT_CALLBACKS = 'stage-postcommit-callbacks';
42  public const STAGE_POSTROLLBACK_CALLBACKS = 'stage-postrollback-callbacks';
43 
74  public function __construct( array $params );
75 
83  public function disable( $fname = __METHOD__ );
84 
91  public function closeAll( $fname = __METHOD__ );
92 
99  public function commitAll( $fname = __METHOD__ );
100 
110  public function finalizePrimaryChanges( $fname = __METHOD__ );
111 
123  public function approvePrimaryChanges( array $options, $fname = __METHOD__ );
124 
138  public function beginPrimaryChanges( $fname = __METHOD__ );
139 
146  public function commitPrimaryChanges( $fname = __METHOD__ );
147 
155  public function runPrimaryTransactionIdleCallbacks( $fname = __METHOD__ );
156 
164  public function runPrimaryTransactionListenerCallbacks( $fname = __METHOD__ );
165 
173  public function rollbackPrimaryChanges( $fname = __METHOD__ );
174 
184  public function flushPrimarySessions( $fname = __METHOD__ );
185 
191  public function flushReplicaSnapshots( $fname = __METHOD__ );
192 
201  public function flushPrimarySnapshots( $fname = __METHOD__ );
202 
209  public function pendingPrimaryChangeCallers();
210 
217  public function forEachOpenConnection( $callback, array $params = [] );
218 
226  public function forEachOpenPrimaryConnection( $callback, array $params = [] );
227 
234  public function setLocalDomainPrefix( $prefix );
235 }
Interface for internal LoadBalancer methods, suitable for use on untracked objects returned by newMai...
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)
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.
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.
const STAGE_POSTROLLBACK_CALLBACKS
Manager of ILoadBalancer instances is running post-rollback callbacks.
runPrimaryTransactionListenerCallbacks( $fname=__METHOD__)
Run all recurring post-COMMIT/ROLLBACK listener callbacks.
closeAll( $fname=__METHOD__)
Close all open connections.
__construct(array $params)
Construct a manager of IDatabase connection objects.
rollbackPrimaryChanges( $fname=__METHOD__)
Issue ROLLBACK only on primary, only if queries were done on connection.
forEachOpenPrimaryConnection( $callback, array $params=[])
Call a function with each open connection object to a primary.
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.
commitAll( $fname=__METHOD__)
Commit transactions on all open connections.
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.
approvePrimaryChanges(array $options, $fname=__METHOD__)
Perform all pre-commit checks for things like replication safety.
forEachOpenConnection( $callback, array $params=[])
Call a function with each open connection object.
Database cluster connection, tracking, load balancing, and transaction manager interface.