rdbms: make sure cpPosIndex cookie is applied to LBFactory in time
[lhc/web/wiklou.git] / includes / libs / rdbms / loadbalancer / ILoadBalancer.php
index ae4362d..fec496e 100644 (file)
@@ -101,7 +101,7 @@ interface ILoadBalancer {
         *  - maxLag: Avoid replica DB servers with more lag than this [optional]
         *  - srvCache : BagOStuff object for server cache [optional]
         *  - wanCache : WANObjectCache object [optional]
-        *  - chronologyProtector: ChronologyProtector object [optional]
+        *  - chronologyCallback: Callback to run before the first connection attempt [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]
@@ -167,10 +167,13 @@ interface ILoadBalancer {
        /**
         * Get any open connection to a given server index, local or foreign
         *
+        * Use CONN_TRX_AUTOCOMMIT to only look for connections opened with that flag
+        *
         * @param int $i Server index or DB_MASTER/DB_REPLICA
+        * @param int $flags Bitfield of CONN_* class constants
         * @return Database|bool False if no such connection is open
         */
-       public function getAnyOpenConnection( $i );
+       public function getAnyOpenConnection( $i, $flags = 0 );
 
        /**
         * Get a connection handle by server index
@@ -183,7 +186,7 @@ interface ILoadBalancer {
         * call ILoadBalancer::reuseConnection() on the handle when finished using it.
         * In all other cases, this is not necessary, though not harmful either.
         *
-        * @param int $i Server index or DB_MASTER/DB_REPLICA
+        * @param int $i Server index (overrides $groups) or DB_MASTER/DB_REPLICA
         * @param array|string|bool $groups Query group(s), or false for the generic reader
         * @param string|bool $domain Domain ID, or false for the current domain
         * @param int $flags Bitfield of CONN_* class constants