From 794d3401e911ba6928b8d03662f1f56e7400e825 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Fri, 21 Mar 2014 14:42:38 -0400 Subject: [PATCH] Cluster: Restore proper trib master iteration This got removed in 15ef91e during a new feature addition. The prior commit had "break if masters.length == masters_count" but we are guaranteed to aready have that condition met since otherwise we would haven't gotten this far. Without this break statement, it's possible some masters may be forgotten and have zero replicas while other masters have more than their requested number of replicas. Thanks to carlos for pointing out this regression at: https://groups.google.com/forum/#!topic/redis-db/_WVVqDw5B7c --- src/redis-trib.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/src/redis-trib.rb b/src/redis-trib.rb index cfe04d203..298271050 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -572,6 +572,7 @@ class RedisTrib nodes_count -= 1 i += 1 puts "Adding replica #{slave} to #{m}" + break } end }