From 3fa55237b6e471e6008d415c270242f766774f27 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 4 Oct 2016 14:04:20 -0700 Subject: [PATCH] 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 --- includes/libs/rdbms/loadmonitor/LoadMonitor.php | 3 +++ 1 file changed, 3 insertions(+) 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() ) ); } -- 2.20.1