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
638db2fc
Unverified
Commit
638db2fc
authored
Dec 19, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Dec 19, 2018
Browse files
Merge pull request #5713 from artix75/cluster_manager_fix_cmd
Cluster Manager: enable --cluster-replace also for 'fix' command.
parents
f07205e4
503fd229
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
638db2fc
...
...
@@ -3149,17 +3149,19 @@ static int clusterManagerMigrateKeysInSlot(clusterManagerNode *source,
* - In other cases (ie. reshard), proceed only if the user
* launched the command with the --cluster-replace option.*/
if
(
is_busy
)
{
clusterManagerLogWarn
(
"
\n
*** Target key exists, "
"checking values...
\n
"
);
clusterManagerLogWarn
(
"
\n
*** Target key exists
\n
"
);
if
(
!
do_replace
)
{
clusterManagerLogWarn
(
"*** Checking key values on "
"both nodes...
\n
"
);
list
*
diffs
=
listCreate
();
success
=
clusterManagerCompareKeysValues
(
source
,
target
,
reply
,
diffs
);
if
(
!
success
&&
(
do_fix
||
!
do_replace
))
{
listRelease
(
diffs
);
if
(
!
success
)
{
clusterManagerLogErr
(
"*** Value check failed!
\n
"
);
listRelease
(
diffs
);
goto
next
;
}
if
(
listLength
(
diffs
)
>
0
&&
(
do_fix
||
!
do_replace
)
)
{
if
(
listLength
(
diffs
)
>
0
)
{
success
=
0
;
clusterManagerLogErr
(
"*** Found %d key(s) in both source node and "
...
...
@@ -3178,19 +3180,16 @@ static int clusterManagerMigrateKeysInSlot(clusterManagerNode *source,
clusterManagerLogErr
(
" - %s
\n
"
,
k
);
}
clusterManagerLogErr
(
"Please fix the above key(s) "
"manually "
);
if
(
do_fix
)
clusterManagerLogErr
(
"and try again!
\n
"
);
else
{
clusterManagerLogErr
(
"or relaunch the command "
"manually and try again "
"or relaunch the command
\n
"
"with --cluster-replace "
"option to force key "
"overriding.
\n
"
);
}
listRelease
(
diffs
);
goto
next
;
}
listRelease
(
diffs
);
}
clusterManagerLogWarn
(
"*** Replacing target keys...
\n
"
);
}
freeReplyObject
(
migrate_reply
);
...
...
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