diff --git a/pkg/election/leadership.go b/pkg/election/leadership.go index e9abe177ad89..dccd0a7c5231 100644 --- a/pkg/election/leadership.go +++ b/pkg/election/leadership.go @@ -245,9 +245,11 @@ func (ls *Leadership) Watch(serverCtx context.Context, revision int64) { zap.String("purpose", ls.purpose)) return case <-ticker.C: + log.Info("run ticker in watch loop") if !etcdutil.IsHealthy(serverCtx, ls.client) { // When etcd is not available, the watcher.RequestProgress will block, // so we check the etcd availability first. + log.Warn("unhealthy in watch loop") continue } log.Info("request progress in watch loop") @@ -257,6 +259,7 @@ func (ls *Leadership) Watch(serverCtx context.Context, revision int64) { } cancel() if time.Since(lastReceivedResponseTime) >= etcdutil.WatchChTimeoutDuration { + log.Info("update watchChan in watch loop") // If no msg comes from an etcd watchChan for WatchChTimeoutDuration long, // we should cancel the watchChan and request a new watchChan from watcher. continue