From: Aaron Schulz Date: Tue, 4 Oct 2016 21:04:20 +0000 (-0700) Subject: Add version to LoadMonitor::getCacheKey() X-Git-Tag: 1.31.0-rc.0~5216 X-Git-Url: http://git.cyclocoop.org/%27-%20%20.%20url_absolue%28find_in_path%28%27spip_style.css%27%29%29%20%20%20.%20url_absolue%28find_in_path%28%27prive/spip_style.css%27%29%29%20.%20%27?a=commitdiff_plain;h=3fa55237b6e471e6008d415c270242f766774f27;p=lhc%2Fweb%2Fwiklou.git Add version to LoadMonitor::getCacheKey() This avoids undefined index and "servers down" errors when using Het Deploy since only the version has the new fields. Bug: T147359 Change-Id: Ic2d0d147df2e1c015ec4a6675294203b2adf5ed9 --- diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php b/includes/libs/rdbms/loadmonitor/LoadMonitor.php index 59075e483e..60400e3de2 100644 --- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php +++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php @@ -40,6 +40,8 @@ class LoadMonitor implements ILoadMonitor { /** @var float Moving average ratio (e.g. 0.1 for 10% weight to new weight) */ private $movingAveRatio; + const VERSION = 1; + public function __construct( ILoadBalancer $lb, BagOStuff $srvCache, BagOStuff $cache, array $options = [] ) { @@ -199,6 +201,7 @@ class LoadMonitor implements ILoadMonitor { // Lag is per-server, not per-DB, so key on the master DB name return $this->srvCache->makeGlobalKey( 'lag-times', + self::VERSION, $this->parent->getServerName( $this->parent->getWriterIndex() ) ); }