From 4af72d326e583a2ba13e90d1dd89c6f6e23925b3 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 2e5c394 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 4efe11cb..85139ebb 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -586,6 +586,7 @@ class RedisTrib nodes_count -= 1 assigned_replicas += 1 puts "Adding replica #{slave} to #{m}" + break } end } -- GitLab