Fix some LoadBalancer::waitFor*() inconsistencies
[lhc/web/wiklou.git] / includes / libs / rdbms / loadbalancer / ILoadBalancer.php
index 4e6f6b0..cbd0ff3 100644 (file)
  */
 namespace Wikimedia\Rdbms;
 
-use IDatabase;
-use Database;
-use DBConnRef;
-use MaintainableDBConnRef;
 use DBError;
 use DBAccessError;
 use DBTransactionError;
@@ -105,6 +101,7 @@ interface ILoadBalancer {
         *  - srvCache : BagOStuff object for server cache [optional]
         *  - memCache : BagOStuff object for cluster memory cache [optional]
         *  - wanCache : WANObjectCache object [optional]
+        *  - chronologyProtector: ChronologyProtector object [optional]
         *  - hostname : The name of the current server [optional]
         *  - cliMode: Whether the execution context is a CLI script. [optional]
         *  - profiler : Class name or instance with profileIn()/profileOut() methods. [optional]
@@ -138,7 +135,11 @@ interface ILoadBalancer {
         * If a DB_REPLICA connection has been opened already, then wait immediately.
         * Otherwise sets a variable telling it to wait if such a connection is opened.
         *
-        * @param DBMasterPos $pos
+        * This only applies to connections to the generic replica DB for this request.
+        * If a timeout happens when waiting, then getLaggedReplicaMode()/laggedReplicaUsed()
+        * will return true.
+        *
+        * @param DBMasterPos|bool $pos Master position or false
         */
        public function waitFor( $pos );
 
@@ -147,7 +148,7 @@ interface ILoadBalancer {
         *
         * This can be used a faster proxy for waitForAll()
         *
-        * @param DBMasterPos $pos
+        * @param DBMasterPos|bool $pos Master position or false
         * @param int $timeout Max seconds to wait; default is mWaitTimeout
         * @return bool Success (able to connect and no timeouts reached)
         */
@@ -156,7 +157,7 @@ interface ILoadBalancer {
        /**
         * Set the master wait position and wait for ALL replica DBs to catch up to it
         *
-        * @param DBMasterPos $pos
+        * @param DBMasterPos|bool $pos Master position or false
         * @param int $timeout Max seconds to wait; default is mWaitTimeout
         * @return bool Success (able to connect and no timeouts reached)
         */
@@ -240,9 +241,6 @@ interface ILoadBalancer {
         * Index must be an actual index into the array.
         * If the server is already open, returns it.
         *
-        * On error, returns false, and the connection which caused the
-        * error will be available via $this->mErrorConnection.
-        *
         * @note If disable() was called on this LoadBalancer, this method will throw a DBAccessError.
         *
         * @param int $i Server index or DB_MASTER/DB_REPLICA