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

xds: manage load stats for all clusters in XdsClient (v1.31.x backport) #7314

Conversation

voidzcy
Copy link
Contributor

@voidzcy voidzcy commented Aug 11, 2020

Move the creation of LoadStatsStore (aka, the stats object) into XdsClient. The XdsClient is responsible for managing the lifetime of stats objects. Creations of LoadStatsStores are reference counted so that multiple EDS policies can retrieve the same stats object for load recording. Counters for recording loads per locality also need to be reference counted, as each EDS policy for the same cluster will receive endpoints for the same group of localities, they will use the same load counters for recording each locality's loads.


This is backport of #7299

Including backports of dependent commits:
#7239
#7209
#7255
#7266
#7271
#7257
#7273
#7278

Manual change: there was an syncing issue between #7282 and #7299, in which the former changed verifyZeroInteractions to verifyNoInteractions while the later didn't sync the build and thought it was broken and temporarily changed to verifyNoMoreInteractions with TODO added. Manually resolved this conflict by following the latest commit.

dapengzhang0 and others added 9 commits August 11, 2020 14:39
… interval measurement (grpc#7209)

- Add support for send_all_clusters field in LRS response. When it is set to true, just send load reports for clusters that the client is currently tracking (aka, is sending load to).

- The actual load report interval (in each ClusterStats message, which contains the stats for each cluster:eds_service) should be tracked individually.
In preparation for xds-v3 support.
Duplicated `XdsClientImptTest` for V3. `XdsClientImptTestV2` and all other tests are still using V2. Even for `XdsClientImptTest`, although the protocol is V3, the test xds server still sends V2 resources in its V3 response.
Move the creation of LoadStatsStore (aka, the stats object) into XdsClient. The XdsClient is responsible for managing the lifetime of stats objects. Creations of LoadStatsStores are reference counted so that multiple EDS policies can retrieve the same stats object for load recording. Counters for recording loads per locality also need to be reference counted, as each EDS policy for the same cluster will receive endpoints for the same group of localities, they will use the same load counters for recording each locality's loads.
@@ -0,0 +1,3770 @@
/*
* Copyright 2019 The gRPC Authors
Copy link
Contributor

Choose a reason for hiding this comment

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

should be 2020?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are not gonna change it here, this is cherry-picked for backporting. We could make a change on master.

@voidzcy
Copy link
Contributor Author

voidzcy commented Aug 11, 2020

Not going to merge this PR. Instead, I am going to create a new PR based on v1.31.x having the same change as #7299 for fixing its issue.

Created #7315 backport PR for making the manual backport experience easier.

@voidzcy
Copy link
Contributor Author

voidzcy commented Aug 12, 2020

Closing in favor of #7317

@voidzcy voidzcy closed this Aug 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2021
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.

None yet

3 participants