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
0caa7507
Commit
0caa7507
authored
May 06, 2011
by
antirez
Browse files
clear importing/exporing state when appropriate on SETSLOT or ADDSLOTS cluster commands
parent
f9cbdcb1
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
0caa7507
...
...
@@ -1222,9 +1222,15 @@ void clusterCommand(redisClient *c) {
}
for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) {
if (slots[j]) {
int retval = del ? clusterDelSlot(j) :
clusterAddSlot(server.cluster.myself,j);
int retval;
/* If this slot was set as importing we can clear this
* state as now we are the real owner of the slot. */
if (server.cluster.importing_slots_from[j])
server.cluster.importing_slots_from[j] = NULL;
retval = del ? clusterDelSlot(j) :
clusterAddSlot(server.cluster.myself,j);
redisAssert(retval == REDIS_OK);
}
}
...
...
@@ -1290,6 +1296,13 @@ void clusterCommand(redisClient *c) {
return;
}
}
/* If this node was the slot owner and the slot was marked as
* migrating, assigning the slot to another node will clear
* the migratig status. */
if (server.cluster.slots[slot] == server.cluster.myself &&
server.cluster.migrating_slots_to[slot])
server.cluster.migrating_slots_to[slot] = NULL;
clusterDelSlot(slot);
clusterAddSlot(n,slot);
} 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