summaryrefslogtreecommitdiff
path: root/src/redis-trib.rb
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2016-05-05 08:56:28 +0200
committerSalvatore Sanfilippo <antirez@gmail.com>2016-05-05 08:56:28 +0200
commit09153b912792e0890594532e380fe807f9aaec5b (patch)
tree8aff2e375eafc6007326a76e2cb81ca8fe44181c /src/redis-trib.rb
parentb76d27ca74b7e2baadbd3d171969a44eeaeb9d1d (diff)
parentcad9ea5c68fa0b36c1620aa35fe5a946c0a84ced (diff)
downloadredis-09153b912792e0890594532e380fe807f9aaec5b.tar.gz
Merge pull request #3152 from be-hase/fix/check_open_slots
Fix redis-trib.rb
Diffstat (limited to 'src/redis-trib.rb')
-rwxr-xr-xsrc/redis-trib.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/redis-trib.rb b/src/redis-trib.rb
index 8bb4abd53..68d46bdf8 100755
--- a/src/redis-trib.rb
+++ b/src/redis-trib.rb
@@ -407,7 +407,8 @@ class RedisTrib
cluster_error \
"[WARNING] Node #{n} has slots in migrating state (#{n.info[:migrating].keys.join(",")})."
open_slots += n.info[:migrating].keys
- elsif n.info[:importing].size > 0
+ end
+ if n.info[:importing].size > 0
cluster_error \
"[WARNING] Node #{n} has slots in importing state (#{n.info[:importing].keys.join(",")})."
open_slots += n.info[:importing].keys
@@ -567,17 +568,17 @@ class RedisTrib
# Use ADDSLOTS to assign the slot.
puts "*** Configuring #{owner} as the slot owner"
- n.r.cluster("setslot",slot,"stable")
- n.r.cluster("addslot",slot)
+ owner.r.cluster("setslot",slot,"stable")
+ owner.r.cluster("addslots",slot)
# Make sure this information will propagate. Not strictly needed
# since there is no past owner, so all the other nodes will accept
# whatever epoch this node will claim the slot with.
- n.r.cluster("bumpepoch")
+ owner.r.cluster("bumpepoch")
# Remove the owner from the list of migrating/importing
# nodes.
- migrating.delete(n)
- importing.delete(n)
+ migrating.delete(owner)
+ importing.delete(owner)
end
# If there are multiple owners of the slot, we need to fix it