-
Notifications
You must be signed in to change notification settings - Fork 264
A117: Ring Hash exit_idle behavior changes #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dfawley
wants to merge
3
commits into
grpc:master
Choose a base branch
from
dfawley:ring_hash_exit_idle
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| A117: Ring Hash Exit Idle Behavior Changes | ||
| ---- | ||
| * Author(s): dfawley@ | ||
| * Approver(s): markdroth@, ejona@ | ||
| * Implemented in: | ||
| * Last updated: 2026-05-15 | ||
| * Discussion at: https://groups.google.com/g/grpc-io/c/ByCPdvi5lrQ | ||
|
|
||
| ## Abstract | ||
|
|
||
| Update the Ring Hash LB policy to create connections when expliictly requested | ||
| by the channel to do so, instead of ignoring the request. | ||
|
|
||
| ## Background | ||
|
|
||
| The Ring Hash LB policy, as defined in [gRFC A42][A42], does not create | ||
| connections upon creation. Even though it is not specified, all implementations | ||
| of gRPC also ignored calls to the "exit idle" / "request connection" method. | ||
|
|
||
| It has been observed that this behavior can cause problems, however. | ||
| Specifically, when using the gRPC [connectivity API][], if an application | ||
| requests a channel using ring-hash to connect, but ring hash ignores the | ||
| incoming request from the channel, the application will never see a change to | ||
| the state of the channel. If the connectivity state is used for something like | ||
| computing the health of a server, that can cause serious problems, as an | ||
| unhealthy server will not receive the traffic it needs to begin connecting. | ||
|
easwars marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Related Proposals: | ||
|
|
||
| * [gRFC A42: xDS Ring Hash LB Policy][A42] | ||
| * [gRFC A76: Improvements to the Ring Hash LB Policy][A76] | ||
| * [gRFC A61: IPv4 and IPv6 Dualstack Backend Support][A61rh] | ||
|
|
||
| ## Proposal | ||
|
|
||
| This proposal makes two behavior changes: | ||
|
|
||
| 1. Ring Hash should enter the CONNECTING state when the channel requests it to | ||
|
ejona86 marked this conversation as resolved.
Outdated
|
||
| exit idle mode, instead of ignoring the request. | ||
|
|
||
| This will cause the eager-connection logic described in [gRFC A61][A61rh] to | ||
| trigger: | ||
|
|
||
| > when the aggregated connectivity state is either TRANSIENT_FAILURE or | ||
| > CONNECTING, the ring_hash policy proactively triggers connection attempts | ||
| > across all of the subchannels, even without seeing any picks. | ||
|
|
||
| 2. New connection attempts not triggered by an RPC should begin from a | ||
| randomized location (behavior change from [gRFC A61][A61rh]'s | ||
| TRANSIENT_FAILURE / CONNECTING behavior), which currently states the choice | ||
| of endpoints is up to the implementation: | ||
|
|
||
| > It does not matter which IDLE endpoint is chosen; that is left up to the | ||
| > implementation to determine. | ||
|
|
||
| Using a randomized endpoint will ensure that load is distributed evenly | ||
|
ejona86 marked this conversation as resolved.
|
||
| across available backends if many individual clients are instructed to | ||
| connect at the same time. | ||
|
|
||
| ### Temporary environment variable protection | ||
|
|
||
| Even though this is a behavior change, as the behavior is triggered by the | ||
| application, this feature does not need to be protected by a standardized | ||
| environment variable. Individual langauge implementations may wish to provide | ||
| their language-specific mechanism to revert the behavior change temporarily in | ||
| the event that issues are encountered by users. | ||
|
|
||
| ## Rationale | ||
|
|
||
| Another option is to change nothing in the Ring Hash policy and require users to | ||
| consider "IDLE" as a "healthy" state in their application. This is still | ||
| surprising / unintuitive behavior, and it would be too hard to communicate this | ||
| to all users. | ||
|
|
||
| ## Implementation | ||
|
|
||
| The implementation should be done in all languages that support Ring Hash. | ||
|
|
||
|
|
||
| [A42]: A42-xds-ring-hash-lb-policy.md | ||
| [A76]: A76-ring-hash-improvements.md | ||
| [A61rh]: A61-IPv4-IPv6-dualstack-backends.md#ring-hash | ||
| [connectivity API]: https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md | ||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.