Skip to content

Commit

Permalink
Fixing issue redis#4592 by loading node info before running move_slot…
Browse files Browse the repository at this point in the history
…, which will crash if the node in question has become a slave
  • Loading branch information
tsein-bc committed Oct 9, 2018
1 parent c7613cf commit 78e1cb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/redis-trib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,8 @@ def move_slot(source,target,slot,o={})
# Set the new node as the owner of the slot in all the known nodes.
if !o[:cold]
@nodes.each{|n|
# Load node info in case this node became a slave before the slot could be moved.
n.load_info
next if n.has_flag?("slave")
n.r.cluster("setslot",slot,"node",target.info[:name])
}
Expand Down

0 comments on commit 78e1cb4

Please sign in to comment.