Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1019c729
Commit
1019c729
authored
Jan 08, 2015
by
Salvatore Sanfilippo
Browse files
Merge pull request #2265 from mattsta/fix/trib/create
Fix redis-trib creation failure
parents
622c69e9
bf58f8b5
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
1019c729
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment