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

[router] remove store level metrics for non-streaming multiget #1306

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xunyin8
Copy link
Contributor

@xunyin8 xunyin8 commented Nov 15, 2024

[router] remove store level metrics for non-streaming multiget

The store level metrics in AggRouterHttpRequestStats are registered lazily. Add a flag in AggRouterHttpRequestStats to disable store level metric emission for non-streaming multiget request type. This is cleaner and the less intrusive than adding checks and handling elsewhere because AggRouterHttpRequestStats and the triggers to corresponding record functions are shared across different request types (SINGLE_GET, MULTI_GET, MULTI_GET_STREAMING, COMPUTE, etc...).

We will keep the total stats for non-streaming multiget to give us visibility in case any legacy clients start to make non-streaming multiget requests.

Fixed a bug where recordNoAvailableReplicaAbortedRetryRequest was calling the wrong method for the store metric recording.

How was this PR tested?

Existing and new tests

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

The store level metrics in AggRouterHttpRequestStats are registered lazily.
Add a flag in AggRouterHttpRequestStats to disable store level metric emission
for non-streaming multiget request type. This is cleaner and the less intrusive
than adding checks and handling elsewhere because AggRouterHttpRequestStats and
the triggers to corresponding record functions are shared across different
request types (SINGLE_GET, MULTI_GET, MULTI_GET_STREAMING, COMPUTE, etc...).

We will keep the total stats for non-streaming multiget to give us visibility
in case any legacy clients start to make non-streaming multiget requests.

Fixed a bug where recordNoAvailableReplicaAbortedRetryRequest was calling the
wrong method for the store metric recording.
Copy link
Contributor

@KaiSernLim KaiSernLim left a comment

Choose a reason for hiding this comment

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

@m-nagarajan FYI: This PR will introduce some merge conflicts for #1303.

@@ -29,14 +32,18 @@ public AggRouterHttpRequestStats(
ReadOnlyStoreRepository metadataRepository,
boolean isUnregisterMetricForDeletedStoreEnabled) {
super(metricsRepository, metadataRepository, isUnregisterMetricForDeletedStoreEnabled);
// Disable store level non-streaming multi get stats reporting because it's no longer used in clients. We still
// report to the total stats for visibility of potential old clients.
isStoreStatsEnabled = !RequestType.MULTI_GET.equals(requestType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just remove MULTI_GET? Do we have any use cases for this?

if (isStoreStatsEnabled) {
return scatterGatherStatsMap.computeIfAbsent(storeName, k -> new ScatterGatherStats());
} else {
return totalScatterGatherStats;
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this result in dual recording of the total stats?
if we are checking isStoreStatsEnabled and not recording the store stats as seen in recordStoreStats(), should we clean this to not return anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants