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
fdb57233
Commit
fdb57233
authored
Feb 21, 2013
by
antirez
Browse files
Cluster: always use cluster(Add|Del)Slot to modify the cluster slots table.
parent
786b8d6c
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
fdb57233
...
@@ -46,6 +46,7 @@ sds clusterGenNodesDescription(void);
...
@@ -46,6 +46,7 @@ sds clusterGenNodesDescription(void);
clusterNode *clusterLookupNode(char *name);
clusterNode *clusterLookupNode(char *name);
int clusterNodeAddSlave(clusterNode *master, clusterNode *slave);
int clusterNodeAddSlave(clusterNode *master, clusterNode *slave);
int clusterAddSlot(clusterNode *n, int slot);
int clusterAddSlot(clusterNode *n, int slot);
int clusterDelSlot(int slot);
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
* Initialization
* Initialization
...
@@ -669,7 +670,8 @@ int clusterProcessPacket(clusterLink *link) {
...
@@ -669,7 +670,8 @@ int clusterProcessPacket(clusterLink *link) {
if (server.cluster->slots[j] == NULL ||
if (server.cluster->slots[j] == NULL ||
server.cluster->slots[j]->flags & REDIS_NODE_FAIL)
server.cluster->slots[j]->flags & REDIS_NODE_FAIL)
{
{
server
.
cluster
->
slots
[
j
]
=
sender
;
clusterDelSlot(j);
clusterAddSlot(sender,j);
update_state = update_config = 1;
update_state = update_config = 1;
}
}
}
}
...
...
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