Files
Chenyi Wang 1539834997 podcertcontroller: do not rate-limit PCRs assigned to other replicas (#2353)
### Summary

Every replica receives every PodCertificateRequest, but only the replica
chosen by rendezvous hashing should sign it. The others return
`ErrNotAssigned` and were requeued with `AddRateLimited`, which treats a
normal condition as a failure:

- consumes the shared failure rate limiter (10 QPS bucket), and
- grows the per-item exponential backoff (up to 1000s).

This slows retries of genuinely assigned PCRs and delays takeover when a
replica dies (the PCRs it owned may already be deep in backoff on the
surviving replicas).

Unassigned PCRs are now requeued with
`AddAfter(rendezvous.LeaseDuration)`. Assignments only change when a
replica joins or its lease expires, so re-checking more often gains
nothing. `LeaseDuration` is exported from `rendezvous` for this purpose;
its value is unchanged.

A follow-up could make this event-driven (re-enqueue pending PCRs when
the active replica set changes) instead of polling.

### Testing

`go test ./cmd/podcertcontroller/...`

- [x] Tests pass
- [ ] Documentation updated (n/a)
2026-10-09 22:44:02 +00:00
..