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:
Binbin
2026-03-08 00:01:55 +08:00
committed by GitHub
parent 8c397ea167
commit fc217fca2d
+3
View File
@@ -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;
}