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

services, xds, orca: support EPS in client-side WRR #10177

Merged
merged 9 commits into from
May 26, 2023

Conversation

danielzhaotongliu
Copy link
Contributor

@danielzhaotongliu danielzhaotongliu commented May 15, 2023

Design: go/wrr-eps-design-review-slides

Uses: #10160

Tested: updated & ran tests 100 times to ensure they are not flaky

@danielzhaotongliu danielzhaotongliu marked this pull request as ready for review May 15, 2023 22:32
@danielzhaotongliu
Copy link
Contributor Author

danielzhaotongliu commented May 17, 2023

@YifeiZhuang PTAL. Thanks.
Rebased

@YifeiZhuang YifeiZhuang self-requested a review May 17, 2023 18:05
@YifeiZhuang
Copy link
Contributor

@YifeiZhuang PTAL. Thanks. Rebased

Were you able to request a reviewer if you are not a maintainer?
Otherwise I don't get notified.

The PR is mostly fine to me. Only a few comments.

@danielzhaotongliu
Copy link
Contributor Author

Were you able to request a reviewer if you are not a maintainer?
Otherwise I don't get notified.

No. I am not able to request any reviewer in any opened PR (that option is greyed-out for me) since I am not a maintainer

@@ -172,8 +173,8 @@ public Subchannel createSubchannel(CreateSubchannelArgs args) {
@VisibleForTesting
final class WrrSubchannel extends ForwardingSubchannel {
private final Subchannel delegate;
private final OrcaOobReportListener oobListener = this::onLoadReport;
private final OrcaPerRequestReportListener perRpcListener = this::onLoadReport;
private final OrcaOobReportListener oobListener = new OrcaReportListener(
Copy link
Contributor

Choose a reason for hiding this comment

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

Here the oobListener should not be constructed like this - because it won't get the updated config for the whole lifetime of the subchannel. (as we talked before, each address update in the LB with acceptResolvedAddresses, some subchannels can be reused if their address is the same).
For the optimized oobListener (avoid creating frequently), it should use the config object directly in onLoadReport(so that it uses the updated config and it is also thread safe because onLoadReport is called within syncContext), but not constructed with the current config.errorUtilizationPenalty value.

Since the oobListener is set per each address update worse case, not as frequent as pick subchannel, you can just create a new ooblistener each time needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Created a new OOB listener each time needed.

Thanks for the detailed context and explanation, I previously thought the OOB listener is completely separated from the lifecycle of channel & picker.

@@ -251,7 +269,7 @@ public PickResult pickSubchannel(PickSubchannelArgs args) {
if (!enableOobLoadReport) {
return PickResult.withSubchannel(subchannel,
OrcaPerRequestUtil.getInstance().newOrcaClientStreamTracerFactory(
((WrrSubchannel)subchannel).perRpcListener));
((WrrSubchannel)subchannel).new OrcaReportListener(errorUtilizationPenalty)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Here the per-request listener can be created once at picker's construction time and reused.
A followup PR is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
The per-request listener is created once (per channel & tracked with a map) in the picker's constructor.
I added a "fallback" case with getOrDefault for safety.

Copy link
Contributor

@YifeiZhuang YifeiZhuang left a comment

Choose a reason for hiding this comment

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

LGTM.

@YifeiZhuang YifeiZhuang added the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label May 26, 2023
@grpc-kokoro grpc-kokoro removed the kokoro:force-run Add this label to a PR to tell Kokoro to re-run all tests. Not generally necessary label May 26, 2023
@YifeiZhuang YifeiZhuang merged commit 5a27e3e into grpc:master May 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants