summaryrefslogtreecommitdiff
path: root/src/redis-trib.rb
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-02-22 11:33:10 +0100
committerantirez <antirez@gmail.com>2013-02-22 11:33:10 +0100
commit51b5058d04233bce24927ac233d68cfdfda2cfb9 (patch)
tree10ebd9c38a60fa99565573807f7866839b925931 /src/redis-trib.rb
parenta81c598f9550a83f32981cdf1026b0bd2c8d19e6 (diff)
downloadredis-51b5058d04233bce24927ac233d68cfdfda2cfb9.tar.gz
redis-trib: skeleton of coverage fix for "keys in multiple nodes" case.
Diffstat (limited to 'src/redis-trib.rb')
-rwxr-xr-xsrc/redis-trib.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/redis-trib.rb b/src/redis-trib.rb
index 8daeaa8fd..fd4d29063 100755
--- a/src/redis-trib.rb
+++ b/src/redis-trib.rb
@@ -309,6 +309,23 @@ class RedisTrib
nodes[0].r.cluster("addslots",slot)
}
end
+
+ # Handle case "3": keys in multiple nodes.
+ if multi.length > 0
+ puts "The folowing uncovered slots have keys in multiple nodes:"
+ puts multi.keys.join(",")
+ yes_or_die "Fix these slots by moving keys into a single node?"
+ multi.each{|slot,nodes|
+ puts "Covering slot #{slot} moving keys to #{nodes[0]}"
+ # TODO
+ # 1) Set all nodes as "MIGRATING" for this slot, so that we
+ # can access keys in the hash slot using ASKING.
+ # 2) Move everything to node[0]
+ # 3) Clear MIGRATING from nodes, and ADDSLOTS the slot to
+ # node[0].
+ raise "TODO: Work in progress"
+ }
+ end
end
def alloc_slots