Reduce log level for optimistic lease update fallback

The "Failed to update lease optimistically, falling back to slow path"
message was logged at Error level, but this is expected behavior during
normal leader election when the optimistic update encounters a conflict.
The system gracefully falls back to the slow path (Get + Update), so
this is not a real error. Downgrade to V(2) Info to reduce log noise.

Kubernetes-commit: 04977a0ea4592bfaa70d5095a4cfe99dd4b847e1
This commit is contained in:
Adam Kasztenny
2026-03-14 16:51:49 -04:00
committed by Kubernetes Publisher
parent 9b29e67df1
commit ea7a7e7cf9

View File

@@ -451,7 +451,7 @@ func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool {
le.setObservedRecord(&leaderElectionRecord)
return true
}
logger.Error(err, "Failed to update lease optimistically, falling back to slow path", "lock", le.config.Lock.Describe())
logger.V(2).Info("Failed to update lease optimistically, falling back to slow path", "lock", le.config.Lock.Describe(), "err", err)
}
// 2. obtain or create the ElectionRecord