Skip to content

Commit

Permalink
A42 update: io.grpc.channel_id should be initialized with a random nu…
Browse files Browse the repository at this point in the history
…mber (#320)

* A42 update: specify that channel_id should be initialized with a random number
  • Loading branch information
apolcyn committed Sep 15, 2022
1 parent 9e20d08 commit 057bb11
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions A42-xds-ring-hash-lb-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,15 @@ Here is how gRPC will handle each type of hash policy:
the way that Envoy does. However, we will support one special filter state
[`key`](https://github.com/envoyproxy/envoy/blob/2443032526cf6e50d63d35770df9473dd0460fc0/api/envoy/config/route/v3/route_components.proto#L703)
called `io.grpc.channel_id`, which will hash to the same value for all
requests on a given gRPC channel. This can be used in similar situations
to where Envoy uses `connection_properties` to hash on the source IP address.
(Note that we do not recommend that applications create multiple gRPC
channels to the same virtual host, but if you do that, then the
behavior here will not be exactly the same as using `connection_properties`,
because each channel may use a different endpoint.)
requests on a given gRPC channel. In order to facilitate an even selection
of backends across different channels (which may or may not be in the same
process or machine), the value of `io.grpc.channel_id` should be initialized
with a random number from a uniform distribution. This can be used in similar
situations to where Envoy uses `connection_properties` to hash on the source
IP address. (Note that we do not recommend that applications create multiple
gRPC channels to the same virtual host, but if you do that, then the behavior
here will not be exactly the same as using `connection_properties`, because
each channel may use a different endpoint.)

#### XdsClient Changes

Expand Down

0 comments on commit 057bb11

Please sign in to comment.