Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
51b5058d
Commit
51b5058d
authored
Feb 22, 2013
by
antirez
Browse files
redis-trib: skeleton of coverage fix for "keys in multiple nodes" case.
parent
a81c598f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
51b5058d
...
@@ -309,6 +309,23 @@ class RedisTrib
...
@@ -309,6 +309,23 @@ class RedisTrib
nodes
[
0
].
r
.
cluster
(
"addslots"
,
slot
)
nodes
[
0
].
r
.
cluster
(
"addslots"
,
slot
)
}
}
end
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
end
def
alloc_slots
def
alloc_slots
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment