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