mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Cluster: actually setup replication in CLUSTER REPLICATE.
This commit is contained in:
parent
7bead003e2
commit
b8a28bf442
@ -1513,7 +1513,7 @@ void clusterSetMaster(clusterNode *n) {
|
|||||||
myself->flags |= REDIS_NODE_SLAVE;
|
myself->flags |= REDIS_NODE_SLAVE;
|
||||||
}
|
}
|
||||||
myself->slaveof = n;
|
myself->slaveof = n;
|
||||||
/* TODO: actually handle replication to point to the new slave. */
|
replicationSetMaster(n->ip, n->port);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
@ -1900,6 +1900,8 @@ void clusterCommand(redisClient *c) {
|
|||||||
|
|
||||||
/* Set the master. */
|
/* Set the master. */
|
||||||
clusterSetMaster(n);
|
clusterSetMaster(n);
|
||||||
|
clusterUpdateState();
|
||||||
|
clusterSaveConfigOrDie();
|
||||||
addReply(c,shared.ok);
|
addReply(c,shared.ok);
|
||||||
} else {
|
} else {
|
||||||
addReplyError(c,"Wrong CLUSTER subcommand or number of arguments");
|
addReplyError(c,"Wrong CLUSTER subcommand or number of arguments");
|
||||||
|
Loading…
Reference in New Issue
Block a user