mirror of
https://github.com/fluencelabs/redis
synced 2025-03-21 01:50:50 +00:00
Merge pull request #2265 from mattsta/fix/trib/create
Fix redis-trib creation failure
This commit is contained in:
commit
1019c72930
@ -563,10 +563,19 @@ 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
|
||||
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
|
||||
|
||||
masters = interleaved.slice!(0, masters_count)
|
||||
nodes_count -= masters.length
|
||||
|
Loading…
x
Reference in New Issue
Block a user