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

feat(spanner): enable client to server compression #7899

Merged
merged 3 commits into from May 19, 2023

Conversation

rahul2393
Copy link
Contributor

Enable compression of network traffic from client to server.

@rahul2393 rahul2393 requested review from a team as code owners May 9, 2023 06:37
@product-auto-label product-auto-label bot added the size: s Pull request size is small. label May 9, 2023
@rahul2393 rahul2393 requested a review from olavloite May 9, 2023 06:37
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label May 9, 2023
@rahul2393 rahul2393 added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed api: spanner Issues related to the Spanner API. labels May 9, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 9, 2023
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label May 9, 2023
Copy link
Contributor

@olavloite olavloite left a comment

Choose a reason for hiding this comment

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

LGTM (with a potential request for a test), assuming that it has been verified that the setting actually has an effect (e.g. by looking at the actual number of bytes sent/received)

generatedDefaultOpts := vkit.DefaultClientOptions()
clientDefaultOpts := []option.ClientOption{
option.WithGRPCConnectionPool(numChannels),
option.WithUserAgent(fmt.Sprintf("spanner-go/v%s", internal.Version)),
internaloption.EnableDirectPath(true),
}
if compression == "gzip" {
clientDefaultOpts = append(clientDefaultOpts, option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to add a test with the mock Spanner server that verifies that we actually receive this header?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the unit test for checking the request headers, also adding screenshot to verify all the grpc requests will have the call option for setting compression
Screenshot 2023-05-19 at 11 55 13 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the extra info and adding the test. LGTM!

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels May 19, 2023
@rahul2393 rahul2393 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 19, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 19, 2023
@rahul2393 rahul2393 merged commit 3a047d2 into main May 19, 2023
9 checks passed
@rahul2393 rahul2393 deleted the client-to-server-compression branch May 19, 2023 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants