multi: add leader check to the healthcheck monitor

This commit extends our healtcheck with an optional leader check. This
is to ensure that given network partition or other cluster wide failure
we act as soon as possible to avoid a split-brain situation where a new
leader is elected but we still hold onto our etcd client.
This commit is contained in:
Andras Banki-Horvath
2024-07-25 18:21:47 +02:00
parent 7784d6abf6
commit 8e0534f756
8 changed files with 121 additions and 12 deletions

View File

@@ -315,6 +315,9 @@ func ExtraArgsEtcd(etcdCfg *etcd.Config, name string, cluster bool,
leaderSessionTTL),
}
extraArgs = append(extraArgs, clusterArgs...)
extraArgs = append(
extraArgs, "--healthcheck.leader.interval=10s",
)
}
return extraArgs