Skip to content

endpointsharding: shuffle endpoint order before updating children #8438

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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dfawley
Copy link
Member

@dfawley dfawley commented Jul 8, 2025

See b/412468630, and esp. comment 46. Essentially, if the connection order is not randomized then the first address gets hammered with all the client's initial requests when traffic is bursty. If multiple clients are all using the same order and many start up around the same time, then the first address can see that problem magnified even further. Randomizing at least spreads the load between the clients, even if it still results in one address getting hammered at startup.

The diffs are much smaller than it shows. Basically, the existing e.s._test.go was moved to ..._ext_test.go and the only new code is in ..._test.go. _ext_test.go is completely unchanged from the old _test.go. Weightedtarget's tests needed changes because they assumed the order in which subchannels were created matched the order in which endpoints were provided.

RELEASE NOTES:

  • round_robin: randomize the order in which addresses are connected to in order to spread out initial RPC load between clients.

@dfawley dfawley added this to the 1.75 Release milestone Jul 8, 2025
@dfawley dfawley requested a review from eshitachandwani July 8, 2025 21:24
@dfawley dfawley added the Type: Feature New features or improvements in behavior label Jul 8, 2025
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.38%. Comparing base (64a6b62) to head (e05f10c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8438      +/-   ##
==========================================
+ Coverage   82.34%   82.38%   +0.04%     
==========================================
  Files         414      414              
  Lines       40411    40421      +10     
==========================================
+ Hits        33276    33302      +26     
+ Misses       5771     5762       -9     
+ Partials     1364     1357       -7     
Files with missing lines Coverage Δ
balancer/endpointsharding/endpointsharding.go 93.71% <100.00%> (+0.38%) ⬆️

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features or improvements in behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants