Merge "rdbms: Remove obsolete comment in LoadBalancerSingle"
[lhc/web/wiklou.git] / includes / libs / rdbms / loadbalancer / ILoadBalancer.php
index b21da72..4ca4250 100644 (file)
@@ -95,6 +95,8 @@ interface ILoadBalancer {
        const CONN_SILENCE_ERRORS = 2;
        /** @var int Caller is requesting the master DB server for possibly writes */
        const CONN_INTENT_WRITABLE = 4;
+       /** @var int Bypass and update any server-side read-only mode state cache */
+       const CONN_REFRESH_READ_ONLY = 8;
 
        /** @var string Manager of ILoadBalancer instances is running post-commit callbacks */
        const STAGE_POSTCOMMIT_CALLBACKS = 'stage-postcommit-callbacks';
@@ -491,15 +493,22 @@ interface ILoadBalancer {
        public function getReplicaResumePos();
 
        /**
-        * Disable this load balancer. All connections are closed, and any attempt to
-        * open a new connection will result in a DBAccessError.
+        * Close all connections and disable this load balancer
+        *
+        * Any attempt to open a new connection will result in a DBAccessError.
+        *
+        * @param string $fname Caller name
+        * @param int|null $owner ID of the calling instance (e.g. the LBFactory ID)
         */
-       public function disable();
+       public function disable( $fname = __METHOD__, $owner = null );
 
        /**
         * Close all open connections
+        *
+        * @param string $fname Caller name
+        * @param int|null $owner ID of the calling instance (e.g. the LBFactory ID)
         */
-       public function closeAll();
+       public function closeAll( $fname = __METHOD__, $owner = null );
 
        /**
         * Close a connection
@@ -596,8 +605,9 @@ interface ILoadBalancer {
         * Commit all replica DB transactions so as to flush any REPEATABLE-READ or SSI snapshots
         *
         * @param string $fname Caller name
+        * @param int|null $owner ID of the calling instance (e.g. the LBFactory ID)
         */
-       public function flushReplicaSnapshots( $fname = __METHOD__ );
+       public function flushReplicaSnapshots( $fname = __METHOD__, $owner = null );
 
        /**
         * Commit all master DB transactions so as to flush any REPEATABLE-READ or SSI snapshots
@@ -605,8 +615,9 @@ interface ILoadBalancer {
         * An error will be thrown if a connection has pending writes or callbacks
         *
         * @param string $fname Caller name
+        * @param int|null $owner ID of the calling instance (e.g. the LBFactory ID)
         */
-       public function flushMasterSnapshots( $fname = __METHOD__ );
+       public function flushMasterSnapshots( $fname = __METHOD__, $owner = null );
 
        /**
         * @return bool Whether a master connection is already open
@@ -661,10 +672,9 @@ interface ILoadBalancer {
        /**
         * @note This method may trigger a DB connection if not yet done
         * @param string|bool $domain DB domain ID or false for the local domain
-        * @param IDatabase|null $conn DB master connection; used to avoid loops [optional]
         * @return string|bool Reason the master is read-only or false if it is not
         */
-       public function getReadOnlyReason( $domain = false, IDatabase $conn = null );
+       public function getReadOnlyReason( $domain = false );
 
        /**
         * Disables/enables lag checks