X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Flibs%2Frdbms%2Floadbalancer%2FILoadBalancer.php;h=088c3f2c67ff3b68a5d28e1ab516c74ef53d2d7a;hb=cb8d821fbe695804c197b8aacd57532b49d8c73d;hp=22a58055d7f46131edd7602578c24efb497120c3;hpb=5256bb8ce2da1390f84ef535d990129eebd74fd2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php index 22a58055d7..088c3f2c67 100644 --- a/includes/libs/rdbms/loadbalancer/ILoadBalancer.php +++ b/includes/libs/rdbms/loadbalancer/ILoadBalancer.php @@ -96,6 +96,7 @@ interface ILoadBalancer { * - loadMonitor : Name of a class used to fetch server lag and load. * - readOnlyReason : Reason the master DB is read-only if so [optional] * - waitTimeout : Maximum time to wait for replicas for consistency [optional] + * - 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] @@ -169,15 +170,21 @@ interface ILoadBalancer { public function getAnyOpenConnection( $i ); /** - * Get a connection by index + * Get a connection handle by server index * * Avoid using CONN_TRX_AUTO with sqlite (e.g. check getServerType() first) * + * If the caller uses $domain or sets CONN_TRX_AUTO in $flags, then it must also + * 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 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 * + * @note This method throws DBAccessError if ILoadBalancer::disable() was called + * * @throws DBError * @return Database */ @@ -253,7 +260,11 @@ interface ILoadBalancer { * * Avoid using CONN_TRX_AUTO with sqlite (e.g. check getServerType() first) * - * @note If disable() was called on this LoadBalancer, this method will throw a DBAccessError. + * If the caller uses $domain or sets CONN_TRX_AUTO in $flags, then it must also + * call ILoadBalancer::reuseConnection() on the handle when finished using it. + * In all other cases, this is not necessary, though not harmful either. + * + * @note This method throws DBAccessError if ILoadBalancer::disable() was called * * @param int $i Server index (does not support DB_MASTER/DB_REPLICA) * @param string|bool $domain Domain ID, or false for the current domain @@ -308,25 +319,6 @@ interface ILoadBalancer { */ public function getServerType( $i ); - /** - * Return the server info structure for a given index, or false if the index is invalid. - * @param int $i - * @return array|bool - * - * @deprecated Since 1.30, no alternative - */ - public function getServerInfo( $i ); - - /** - * Sets the server info structure for the given index. Entry at index $i - * is created if it doesn't exist - * @param int $i - * @param array $serverInfo - * - * @deprecated Since 1.30, construct new object - */ - public function setServerInfo( $i, array $serverInfo ); - /** * Get the current master position for chronology control purposes * @return DBMasterPos|bool Returns false if not applicable