mirror of
https://github.com/valkey-io/valkey.git
synced 2026-05-06 13:36:47 -04:00
Update cluster config file when NOFAILOVER changes (#3280)
Currently after changing cluster-replica-no-failover, we will call clusterUpdateMyselfFlags to trigger CLUSTER_TODO_SAVE_CONFIG. But in gossip when the sender's NOFAILOVER changes, we won't trigger the save, this cause nodes.conf to not save the latest nofailover flag. Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
@@ -4055,6 +4055,9 @@ int clusterProcessPacket(clusterLink *link) {
|
||||
* what are the instances really competing. */
|
||||
if (sender) {
|
||||
int nofailover = flags & CLUSTER_NODE_NOFAILOVER;
|
||||
if (nofailover != clusterNodeIsNoFailover(sender)) {
|
||||
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
||||
}
|
||||
sender->flags &= ~CLUSTER_NODE_NOFAILOVER;
|
||||
sender->flags |= nofailover;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user