mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-10-21 06:40:12 +08:00
### 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)