Make LoadMonitor use $serverIndexes in the cache key
[lhc/web/wiklou.git] / includes / libs / rdbms / loadbalancer / ILoadBalancer.php
index 3b2479f..e5ed2f1 100644 (file)
@@ -60,9 +60,9 @@
  *   - Read-only archive clones: set 'is static' in the server configuration maps. This will
  *      treat all such DBs as having 0 lag.
  *   - SQL load balancing proxy: any proxy should handle lag checks on its own, so the 'max lag'
- *     parameter should probably be set to INF in the server configuration maps. This will make
- *     the load balancer ignore whatever it detects as the lag of the logical replica is (which
- *     would probably just randomly bounce around).
+ *      parameter should probably be set to INF in the server configuration maps. This will make
+ *      the load balancer ignore whatever it detects as the lag of the logical replica is (which
+ *      would probably just randomly bounce around).
  *
  * If using a SQL proxy service, it would probably be best to have two proxy hosts for the
  * load balancer to talk to. One would be the 'host' of the master server entry and another for
  * @ingroup Database
  */
 interface ILoadBalancer {
+       /** @var integer Request a replica DB connection */
+       const DB_REPLICA = -1;
+       /** @var integer Request a master DB connection */
+       const DB_MASTER = -2;
+
        /**
         * Construct a manager of IDatabase connection objects
         *
@@ -211,6 +216,7 @@ interface ILoadBalancer {
         * @param int $i Server index
         * @param string|bool $domain Domain ID, or false for the current domain
         * @return IDatabase|bool Returns false on errors
+        * @throws DBAccessError
         */
        public function openConnection( $i, $domain = false );
 
@@ -511,13 +517,6 @@ interface ILoadBalancer {
         */
        public function safeWaitForMasterPos( IDatabase $conn, $pos = false, $timeout = null );
 
-       /**
-        * Clear the cache for slag lag delay times
-        *
-        * This is only used for testing
-        */
-       public function clearLagTimeCache();
-
        /**
         * Set a callback via IDatabase::setTransactionListener() on
         * all current and future master connections of this load balancer