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
4dded0c1
Commit
4dded0c1
authored
Mar 21, 2013
by
antirez
Browse files
redis-trib: ignore slaves when resharding.
parent
47da7657
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
4dded0c1
...
...
@@ -576,8 +576,9 @@ class RedisTrib
while
not
target
print
"What is the receiving node ID? "
target
=
get_node_by_name
(
STDIN
.
gets
.
chop
)
if
not
target
puts
"The specified node is not known, please retry."
if
!
target
||
target
.
has_flag?
(
"slave"
)
puts
"The specified node is not known or not a master, please retry."
target
=
nil
end
end
sources
=
[]
...
...
@@ -598,11 +599,12 @@ class RedisTrib
elsif
line
==
"all"
@nodes
.
each
{
|
n
|
next
if
n
.
info
[
:name
]
==
target
.
info
[
:name
]
next
if
n
.
has_flag?
(
"slave"
)
sources
<<
n
}
break
elsif
not
src
puts
"The specified node is not known, please retry."
elsif
!
src
||
src
.
has_flags?
(
"slave"
)
puts
"The specified node is not known
or is not a master
, please retry."
elsif
src
.
info
[
:name
]
==
target
.
info
[
:name
]
puts
"It is not possible to use the target node as source node."
else
...
...
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