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

Handling empty flow unit during Cache/Queue RCA execution #34

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

khushbr
Copy link
Collaborator

@khushbr khushbr commented Jul 27, 2021

**Is your feature request related to a problem? Please provide an existing Issue #33

[RCA] Handle Empty FU within Cache and Queue RCAs

In this case, PA was unable to persist value for 64 metric for the one hour window and thus, RCA was running into Cache_Request_Hit metric table does not exist. Returning null for the metric/dimension and QueryMetric was returning empty Flow units to ShardRequestCacheRCA. The ShardRequestCacheRCA on finding an empty FU, ignores it. This was done to accommodate any delays in metric persistence from PA.

Before this event, the ShardReqestCacheRCA had hasMetric set to true and this variable was not reset during the 1 hour (RCA was ignoring the empty flow units). Thus, the RCA was in Unhealthy state and CacheDecider was repeatedly suggesting ‘ModifyCacheMaxSize’.

This same code is shared across Queue RCA and [FieldDataCacheRca](https://github.com/opensearch-project/performance-analyzer-rca/blob/main/src/main/java/org/opensearch/performanceanalyzer/rca/store/rca/cache/FieldDataCacheRca.java, so we will need to fix this there as well

Describe the solution you are proposing
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@khushbr khushbr requested review from sruti1312 and rguo-aws July 27, 2021 01:49
// If the RCA receives 3 empty flow units, re-set the 'hasMetric' value
hasEvictions = false;
clearCounter = 0;
LOG.error(
Copy link
Contributor

Choose a reason for hiding this comment

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

For some reason if there are only empty flowunits, this might flood the logs. As we are emitting a metric, can we modify the log level to debug?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, let me change the log level to debug.

@@ -217,17 +218,21 @@ public void generateFlowUnitListFromWire(FlowUnitOperationArgWrapper args) {
private static class CacheCollector {
private final Resource cache;
private final Metric cacheMetrics;
private boolean hasMetric;
private boolean hasCacheMetric;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we name this variable with the metric name that it denotes? Like the previous one, hasEvictions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the metric type for ShardRequestCache can be evictions and hit both. So, kept it generic.

// If the RCA receives 3 empty flow units, re-set the 'hasCacheMetric' value
hasCacheMetric = false;
clearCounter = 0;
LOG.error(
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above, can we make it to debug?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Moving it to debug.

@khushbr khushbr merged commit 80d39f1 into opensearch-project:main Jul 30, 2021
@khushbr khushbr deleted the feature/empty-fu-rca branch July 30, 2021 17:45
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.

2 participants