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: support load reporting all clusters option and fix actual report interval measurement #7209
xds: support load reporting all clusters option and fix actual report interval measurement #7209
Conversation
…nterval measurement for each individual cluster:eds_service.
private LoadStatsEntity(LoadStatsStore loadStatsStore, Stopwatch stopwatch) { | ||
this.loadStatsStore = loadStatsStore; | ||
this.stopwatch = stopwatch; | ||
stopwatch.reset().start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to pass a StopwatchSupplier in constructor, and create a new stopwatch here, so that it's clear that the stopwatch's lifecycle is solely managed by the LoadStatsEntity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to take the stopwatch supplier from the LrsClient directly.
… 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.
… 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.
… interval measurement (v1.31.x backport) (#7209) (#7315) - 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.
… 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.
Two changes for
LoadReportClient
in this PR:Add support for
send_all_clusters
field in LRS response.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) is tracked individually.Example:
Initially, if the client has load stats recorded for
cluster-foo:eds_service-foo
andcluster-bar:eds_service-bar
while the management server is only asking for load stats forcluster-foo:eds_service-foo
to be reported every 10 seconds. The actual LRS requests sent to the management server should contain only oneClusterStats
message (forcluster-foo:eds_service-foo
) with load report interval being 10 seconds. After a while, the management server asks load stats forcluster-bar:eds_service-bar
. Then the first LRS request after that should containClusterStats
forcluster-bar:eds_service-bar
should set its actual load report interval to the whole period from the beginning (Although the definition of "beginning" is unclear here. We use the time when the client starts to know the cluster while Envoy uses epoch. I think it shouldn't matter much for the first report of the cluster:eds_service). The point of this change is the actual load report interval for each cluster should be tracked individually as loads for clusters are not necessarily reported together.For reference, see Enovy's implementation.