Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

chore: add a random channel hint with single use transactions while u…#3065

Merged
gcf-merge-on-green[bot] merged 3 commits intogoogleapis:mainfrom
arpan14:mux-pr-random-hint
Apr 30, 2024
Merged

chore: add a random channel hint with single use transactions while u…#3065
gcf-merge-on-green[bot] merged 3 commits intogoogleapis:mainfrom
arpan14:mux-pr-random-hint

Conversation

@arpan14
Copy link
Copy Markdown
Contributor

@arpan14 arpan14 commented Apr 26, 2024

Without the hint, GAX would do a round-robin on channels. In theory, a random hint would give a better performance than round robin at a high QPS workload. Also YCSB benchmarks suggest having the hint is better for higher QPS.

@arpan14 arpan14 requested a review from a team April 26, 2024 19:49
@product-auto-label product-auto-label Bot added size: xs Pull request size is extra small. api: spanner Issues related to the googleapis/java-spanner API. labels Apr 26, 2024
@arpan14 arpan14 force-pushed the mux-pr-random-hint branch from 2058dc3 to 5ce399a Compare April 26, 2024 19:50
@arpan14 arpan14 requested a review from olavloite April 26, 2024 19:51
@arpan14 arpan14 added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 29, 2024
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 29, 2024
Comment on lines +193 to +195
// with a multiplexed session. But GAX currently uses an AtomicLong to perform round-robin
// channel selection and that will cause contention issues at high-concurrency. So we are
// passing a random hint instead of doing GAX round-robin.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please remove this/replace this comment. Gax uses an AtomicInteger to implement round-robin, and that does not introduce any contention.

@arpan14 arpan14 added the automerge Merge the pull request once unit tests and other checks pass. label Apr 30, 2024
@harshachinta harshachinta added the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 30, 2024
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Apr 30, 2024
@gcf-merge-on-green gcf-merge-on-green Bot merged commit 42650fa into googleapis:main Apr 30, 2024
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: xs Pull request size is extra small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants