From 1a6df1049d4b212908f8873424ad6fdfedb71d1a Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 21 Mar 2013 16:31:53 +0100 Subject: [PATCH] redis-trib: load info about importing/migrating slots from node. --- src/redis-trib.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/redis-trib.rb b/src/redis-trib.rb index 67b9a303b..edf5648c1 100755 --- a/src/redis-trib.rb +++ b/src/redis-trib.rb @@ -43,6 +43,8 @@ class ClusterNode @info[:host] = s[0] @info[:port] = s[1] @info[:slots] = {} + @info[:migrating] = {} + @info[:importing] = {} @dirty = false # True if we need to flush slots info into node. @friends = [] end @@ -112,7 +114,13 @@ class ClusterNode @info[:slots] = {} slots.each{|s| if s[0..0] == '[' - # Fixme: for now skipping migration entries + if s[2..4] == "->-" # Migrating + slot,dst = s[1..-1].split("->-") + @info[:migrating][slot] = dst + elsif s[2..4] == "-<-" # Importing + slot,src = s[1..-1].split("-<-") + @info[:importing][slot] = src + end elsif s.index("-") start,stop = s.split("-") self.add_slots((start.to_i)..(stop.to_i))