Fixed bug in BloomCacheRedis::getConnection
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 24 Sep 2014 00:26:00 +0000 (17:26 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 24 Sep 2014 00:26:00 +0000 (17:26 -0700)
* The array keys need to be re-indexed to avoid picking a deleted one

Change-Id: I3c22674a0194597598d66179bb5e3625da1dd38c

includes/cache/bloom/BloomCacheRedis.php

index 212e5e8..583556f 100644 (file)
@@ -328,7 +328,7 @@ LUA;
        }
 
        /**
-        * $param string $to (master/slave)
+        * @param string $to (master/slave)
         * @return RedisConnRef|bool Returns false on failure
         */
        protected function getConnection( $to ) {
@@ -354,6 +354,7 @@ LUA;
                                        return $conn;
                                }
                                unset( $servers[$index] ); // skip next time
+                               $servers = array_values( $servers ); // reindex
                        }
                }