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
8287945f
Commit
8287945f
authored
Mar 11, 2014
by
antirez
Browse files
Cluster: flush importing/migrating state when master is turned into slave.
parent
2e8e0ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
8287945f
...
...
@@ -2897,8 +2897,8 @@ int verifyClusterConfigWithData(void) {
* SLAVE nodes handling
* -------------------------------------------------------------------------- */
/* Set the specified node 'n' as master
. Setup
th
e
node
as a slave if
*
needed
. */
/* Set the specified node 'n' as master
for
th
is
node
.
*
If this node is currently a master, it is turned into a slave
. */
void
clusterSetMaster
(
clusterNode
*
n
)
{
redisAssert
(
n
!=
myself
);
redisAssert
(
myself
->
numslots
==
0
);
...
...
@@ -2906,6 +2906,7 @@ void clusterSetMaster(clusterNode *n) {
if
(
nodeIsMaster
(
myself
))
{
myself
->
flags
&=
~
REDIS_NODE_MASTER
;
myself
->
flags
|=
REDIS_NODE_SLAVE
;
clusterCloseAllSlots
();
}
else
{
if
(
myself
->
slaveof
)
clusterNodeRemoveSlave
(
myself
->
slaveof
,
myself
);
...
...
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