Add missing array_keys() call to scaleLoads()
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 4 Oct 2016 11:16:21 +0000 (04:16 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 4 Oct 2016 11:16:21 +0000 (04:16 -0700)
Bug: T147240
Change-Id: I110f43b5990fe42b2d7f1ec960a55a1ae4aa4253

includes/libs/rdbms/loadmonitor/LoadMonitor.php

index dddc7b0..59075e4 100644 (file)
@@ -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];