Skip to content

[ring_hash] delegate to pick_first as per dualstack design#34244

Merged
markdroth merged 5 commits into
grpc:masterfrom
markdroth:dualstack_ring_hash
Sep 7, 2023
Merged

[ring_hash] delegate to pick_first as per dualstack design#34244
markdroth merged 5 commits into
grpc:masterfrom
markdroth:dualstack_ring_hash

Conversation

@markdroth

@markdroth markdroth commented Sep 2, 2023

Copy link
Copy Markdown
Member

Rolls forward the changes from #33093 and some from #33568, which were rolled back in #33718.

@markdroth markdroth marked this pull request as ready for review September 5, 2023 17:22
@markdroth markdroth requested a review from eugeneo September 5, 2023 17:22
@markdroth markdroth merged commit a315171 into grpc:master Sep 7, 2023
@markdroth markdroth deleted the dualstack_ring_hash branch September 7, 2023 16:39
@copybara-service copybara-service Bot added the imported Specifies if the PR has been imported to the internal repository label Sep 7, 2023
markdroth added a commit that referenced this pull request Oct 9, 2023
- Fixes support for the same address being present more than once in the
address list, which was accidentally broken in #34244.
- Change the call attribute to encode the hash as an integer instead of
a string.
copybara-service Bot pushed a commit that referenced this pull request Feb 18, 2025
See grpc/proposal#475 for details.

While I was at it, I greatly simplified the logic, avoiding an unnecessary duplicate loop over all endpoints that we didn't need to be doing.

I removed an unnecessary end2end test that was broken by this change.  That test actually should have broken when I first changed ring_hash to delegate to pick_first back in #34244, and I'm not sure why it didn't.  But it definitely broke here when I changed the logic to not choose endpoints in any specific order when triggering connection attempts, and since the test was really intended to test a behavior that we no longer guarantee, I removed it.

In its place, I added a unit test that shows the new behavior in a much clearer way.  (Originally, we didn't have a good way to write unit tests for LB policies, so all of our tests were written as e2e tests.  Now that we do have a good framework for unit tests, we've been slowly finding e2e tests that really should be unit tests instead, and moving them over when we find them.)

Closes #38741

COPYBARA_INTEGRATE_REVIEW=#38741 from markdroth:ring_hash_tf_and_connecting_fix 6c4c773
PiperOrigin-RevId: 728255272
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Feb 20, 2025
See grpc/proposal#475 for details.

While I was at it, I greatly simplified the logic, avoiding an unnecessary duplicate loop over all endpoints that we didn't need to be doing.

I removed an unnecessary end2end test that was broken by this change.  That test actually should have broken when I first changed ring_hash to delegate to pick_first back in grpc#34244, and I'm not sure why it didn't.  But it definitely broke here when I changed the logic to not choose endpoints in any specific order when triggering connection attempts, and since the test was really intended to test a behavior that we no longer guarantee, I removed it.

In its place, I added a unit test that shows the new behavior in a much clearer way.  (Originally, we didn't have a good way to write unit tests for LB policies, so all of our tests were written as e2e tests.  Now that we do have a good framework for unit tests, we've been slowly finding e2e tests that really should be unit tests instead, and moving them over when we find them.)

Closes grpc#38741

COPYBARA_INTEGRATE_REVIEW=grpc#38741 from markdroth:ring_hash_tf_and_connecting_fix 6c4c773
PiperOrigin-RevId: 728255272
@ti-chi-bot ti-chi-bot Bot mentioned this pull request Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat/improvement imported Specifies if the PR has been imported to the internal repository lang/c++ lang/core per-call-memory/neutral per-channel-memory/neutral release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants