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:
8 files changed
+121
-12
No files matched your search
@@ -19,8 +19,11 @@ type LeaderElector interface {
|
||||
|
||||
// Resign resigns from the leader role, allowing other election members
|
||||
// to take on leadership.
|
||||
Resign() error
|
||||
Resign(ctx context.Context) error
|
||||
|
||||
// Leader returns the leader value for the current election.
|
||||
Leader(ctx context.Context) (string, error)
|
||||
|
||||
// IsLeader returns true if the caller is the leader.
|
||||
IsLeader(ctx context.Context) (bool, error)
|
||||
}
|
||||
Reference in new issue
Block a user