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
d75ab872
Commit
d75ab872
authored
Nov 07, 2013
by
antirez
Browse files
redis-trib: fixed slot allocation when --replicas is used.
parent
e1a1d904
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
d75ab872
...
@@ -517,10 +517,10 @@ class RedisTrib
...
@@ -517,10 +517,10 @@ class RedisTrib
# Alloc slots on masters
# Alloc slots on masters
i = 0
i = 0
masters
.
each
{
|
n
|
masters.each
_with_index{|n,masternum
|
first = i*slots_per_node
first = i*slots_per_node
last = first+slots_per_node-1
last = first+slots_per_node-1
last
=
ClusterHashSlots
-
1
if
i
==
@node
s
.
length
-
1
last = ClusterHashSlots-1 if
masternum == master
s.length-1
n.add_slots first..last
n.add_slots first..last
i += 1
i += 1
}
}
...
...
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