mirror of
http://github.com/valkey-io/valkey
synced 2024-11-23 03:33:28 +00:00
Set replicas' configEpoch to 0 when loaded from cluster configuration file (#10798)
* Changed clusterLoadConfig to set the config epoch of replica nodes to 0 when loaded.
This commit is contained in:
parent
ff6419658b
commit
091701f363
@ -308,8 +308,10 @@ int clusterLoadConfig(char *filename) {
|
||||
if (atoi(argv[4])) n->ping_sent = mstime();
|
||||
if (atoi(argv[5])) n->pong_received = mstime();
|
||||
|
||||
/* Set configEpoch for this node. */
|
||||
n->configEpoch = strtoull(argv[6],NULL,10);
|
||||
/* Set configEpoch for this node.
|
||||
* If the node is a replica, set its config epoch to 0.
|
||||
* If it's a primary, load the config epoch from the configuration file. */
|
||||
n->configEpoch = (nodeIsSlave(n) && n->slaveof) ? 0 : strtoull(argv[6],NULL,10);
|
||||
|
||||
/* Populate hash slots served by this instance. */
|
||||
for (j = 8; j < argc; j++) {
|
||||
|
Loading…
Reference in New Issue
Block a user