From d5aa7e2abe0d832fcad348caff99d006f2ab7740 Mon Sep 17 00:00:00 2001 From: Ryosuke Hasebe Date: Wed, 30 Mar 2016 21:56:22 +0900 Subject: [PATCH 1/2] fix check_open_slots --- src/redis-trib.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redis-trib.rb b/src/redis-trib.rb index a38a01ea..8fccb959 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 From cad9ea5c68fa0b36c1620aa35fe5a946c0a84ced Mon Sep 17 00:00:00 2001 From: Ryosuke Hasebe Date: Wed, 30 Mar 2016 23:09:36 +0900 Subject: [PATCH 2/2] fix variable --- src/redis-trib.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/redis-trib.rb b/src/redis-trib.rb index 8fccb959..b550d1b2 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -568,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