Commit d1b607aa authored by Matt Stancliff's avatar Matt Stancliff Committed by antirez
Browse files

Fix redis-trib cluster create

Under certain conditions the node list wasn't being fully populated
and 'create' would fail trying to call methods on nil objects.
parent 6742dab4
......@@ -563,8 +563,17 @@ class RedisTrib
# Take one node from each IP until we run out of nodes
# across every IP.
ips.each do |ip,nodes|
stop = nodes.empty? and next
interleaved.push nodes.shift
if nodes.empty?
# if this IP has no remaining nodes, check for termination
if interleaved.length == nodes_count
# stop when 'interleaved' has accumulated all nodes
stop = true
next
end
else
# else, move one node from this IP to 'interleaved'
interleaved.push nodes.shift
end
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment