From 4a8ddb9d0f137ac8795117d0fb42f753c7561aa3 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 4 Oct 2016 04:16:21 -0700 Subject: [PATCH] Add missing array_keys() call to scaleLoads() Bug: T147240 Change-Id: I110f43b5990fe42b2d7f1ec960a55a1ae4aa4253 --- includes/libs/rdbms/loadmonitor/LoadMonitor.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/libs/rdbms/loadmonitor/LoadMonitor.php b/includes/libs/rdbms/loadmonitor/LoadMonitor.php index dddc7b063a..59075e483e 100644 --- a/includes/libs/rdbms/loadmonitor/LoadMonitor.php +++ b/includes/libs/rdbms/loadmonitor/LoadMonitor.php @@ -58,7 +58,8 @@ class LoadMonitor implements ILoadMonitor { } public function scaleLoads( array &$weightByServer, $group = false, $domain = false ) { - $states = $this->getServerStates( $weightByServer, $domain ); + $serverIndexes = array_keys( $weightByServer ); + $states = $this->getServerStates( $serverIndexes, $domain ); $coefficientsByServer = $states['weightScales']; foreach ( $weightByServer as $i => $weight ) { $weightByServer[$i] = $weight * $coefficientsByServer[$i]; -- 2.20.1