redis-trib: fixed slot allocation when --replicas is used.

This commit is contained in:
antirez 2013-11-07 16:12:06 +01:00
parent e1a1d904de
commit d75ab87226

View File

@ -517,10 +517,10 @@ class RedisTrib
# Alloc slots on masters
i = 0
masters.each{|n|
masters.each_with_index{|n,masternum|
first = i*slots_per_node
last = first+slots_per_node-1
last = ClusterHashSlots-1 if i == @nodes.length-1
last = ClusterHashSlots-1 if masternum == masters.length-1
n.add_slots first..last
i += 1
}