Skip to content
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

xds: fix hash policy header to skip bin headers and use extra metadata #6609

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

dfawley
Copy link
Member

@dfawley dfawley commented Sep 7, 2023

A42 update PR: grpc/proposal#392

Also a minor performance optimization to not read metadata from context more than once if not required, as this operation allocates a map (

out := make(MD, mdSize)
).

RELEASE NOTES:

  • xds: fix hash policy header to skip "-bin" headers and read content-type header as expected

@dfawley dfawley added this to the 1.59 Release milestone Sep 7, 2023
@dfawley dfawley requested a review from zasweq September 7, 2023 17:25
Copy link
Contributor

@zasweq zasweq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

if len(values) == 0 {
continue
// Extra metadata takes precedence over the user's metadata.
values = md.Get(policy.HeaderName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So at this point in the RPC lifecycle, the only overwriting extra metadata is "content-type"? "However, we will support matching against the content-type header; if a gRPC implementation does not add that header until after xDS route selection is done, then xDS route selection will assume a hard-coded value of application/grpc."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the "extra metadata" is "content-type"... I'm not sure I like how this all was done (originally for route matching), but it works at least.

xds/internal/resolver/serviceconfig_test.go Outdated Show resolved Hide resolved
xds/internal/resolver/serviceconfig.go Outdated Show resolved Hide resolved
@zasweq zasweq assigned dfawley and unassigned zasweq Sep 7, 2023
@zasweq
Copy link
Contributor

zasweq commented Sep 7, 2023

Thanks, feel free to merge.

@dfawley dfawley merged commit b0a946c into grpc:master Sep 7, 2023
10 checks passed
@dfawley dfawley deleted the hashheaderbin branch October 9, 2023 22:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants