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
09153b91
Commit
09153b91
authored
May 05, 2016
by
Salvatore Sanfilippo
Browse files
Merge pull request #3152 from be-hase/fix/check_open_slots
Fix redis-trib.rb
parents
b76d27ca
cad9ea5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/redis-trib.rb
View file @
09153b91
...
@@ -407,7 +407,8 @@ class RedisTrib
...
@@ -407,7 +407,8 @@ class RedisTrib
cluster_error
\
cluster_error
\
"[WARNING] Node
#{
n
}
has slots in migrating state (
#{
n
.
info
[
:migrating
].
keys
.
join
(
","
)
}
)."
"[WARNING] Node
#{
n
}
has slots in migrating state (
#{
n
.
info
[
:migrating
].
keys
.
join
(
","
)
}
)."
open_slots
+=
n
.
info
[
:migrating
].
keys
open_slots
+=
n
.
info
[
:migrating
].
keys
elsif
n
.
info
[
:importing
].
size
>
0
end
if
n
.
info
[
:importing
].
size
>
0
cluster_error
\
cluster_error
\
"[WARNING] Node
#{
n
}
has slots in importing state (
#{
n
.
info
[
:importing
].
keys
.
join
(
","
)
}
)."
"[WARNING] Node
#{
n
}
has slots in importing state (
#{
n
.
info
[
:importing
].
keys
.
join
(
","
)
}
)."
open_slots
+=
n
.
info
[
:importing
].
keys
open_slots
+=
n
.
info
[
:importing
].
keys
...
@@ -567,17 +568,17 @@ class RedisTrib
...
@@ -567,17 +568,17 @@ class RedisTrib
# Use ADDSLOTS to assign the slot.
# Use ADDSLOTS to assign the slot.
puts
"*** Configuring
#{
owner
}
as the slot owner"
puts
"*** Configuring
#{
owner
}
as the slot owner"
n
.
r
.
cluster
(
"setslot"
,
slot
,
"stable"
)
owner
.
r
.
cluster
(
"setslot"
,
slot
,
"stable"
)
n
.
r
.
cluster
(
"addslot"
,
slot
)
owner
.
r
.
cluster
(
"addslot
s
"
,
slot
)
# Make sure this information will propagate. Not strictly needed
# Make sure this information will propagate. Not strictly needed
# since there is no past owner, so all the other nodes will accept
# since there is no past owner, so all the other nodes will accept
# whatever epoch this node will claim the slot with.
# whatever epoch this node will claim the slot with.
n
.
r
.
cluster
(
"bumpepoch"
)
owner
.
r
.
cluster
(
"bumpepoch"
)
# Remove the owner from the list of migrating/importing
# Remove the owner from the list of migrating/importing
# nodes.
# nodes.
migrating
.
delete
(
n
)
migrating
.
delete
(
owner
)
importing
.
delete
(
n
)
importing
.
delete
(
owner
)
end
end
# If there are multiple owners of the slot, we need to fix it
# If there are multiple owners of the slot, we need to fix it
...
...
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