grpc: Add noncebalancer that tracks non-READY backends#8672
Closed
beautifulentropy wants to merge 1 commit intomainfrom
Closed
grpc: Add noncebalancer that tracks non-READY backends#8672beautifulentropy wants to merge 1 commit intomainfrom
beautifulentropy wants to merge 1 commit intomainfrom
Conversation
2161d41 to
ddd644d
Compare
ddd644d to
aa2b3cd
Compare
Contributor
|
@beautifulentropy, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values. |
This was referenced Mar 13, 2026
Contributor
|
Closing in favor of #8679 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nonce service's maxConnectionAge (30s) periodically sends a GOAWAY to the WFE's gRPC connections, causing affected SubConns to briefly leave READY state while reconnecting. Due to jitter on maxConnectionAge, the getNonceService and redeemNonceService connections to the same backend can GOAWAY at slightly different times, creating a window where the WFE can still issue nonces from a backend it can no longer redeem against.
The original nonce balancer/picker (grpc/noncebalancer) only tracks READY SubConns. So when a backend is reconnecting after a GOAWAY it is indistinguishable from a backend that does not exist; this results in a badNonce error for the subscriber. The v2 balancer fixes this by maintaining two maps: one for READY backends and one for not-READY backends. When a request targets a prefix whose backend exists but isn't READY, the picker returns ErrNoSubConnAvailable, which tells gRPC to queue the RPC and wait for the SubConn to reconnect (see picker_wrapper.go:159). Only genuinely unknown prefixes now produce ErrNoBackendsMatchPrefix.
To simplify comparison during review and testing in staging, the v2 balancer is implemented as a separate package (grpc/noncebalancerv2) alongside the existing grpc/noncebalancer. Either can be configured in the WFE by setting redeemNonceService.srvResolver to "nonce-srv" or "nonce-srv-v2" in the WFE config.
Note: grpc/noncebalancerv2/balancer.go is best compared directly against vendor/google.golang.org/grpc/balancer/base/balancer.go
Fixes #8662