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

Fixed the bug in CacheConfigMetricsCollector #657

Merged

Conversation

atharvasharma61
Copy link
Contributor

@atharvasharma61 atharvasharma61 commented May 31, 2024

Is your feature request related to a problem? Please provide an existing Issue # , or describe.
Resolves #644

Metrics are being emitted as expected:

^cache_config
{"current_time":1717142304989}
{"CacheType":"field_data_cache","Cache_MaxSize":-1}
{"CacheType":"shard_request_cache","Cache_MaxSize":10737418}$

Describe the solution you are proposing
Tiered Caching has introduced a new ICache interface which has an OnHeap implementation which actually stores the Cache field now. We had to update the logic to how to get the cache field. Relevant PR: opensearch-project/OpenSearch#10753

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

  • Backport Labels added.
  • 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.

Signed-off-by: Atharva Sharma <atharvasharma61@gmail.com>
@atharvasharma61
Copy link
Contributor Author

Test failures will be addressed in the following PR: #651

@@ -118,10 +122,15 @@ public void collectMetrics(long startTime) {
SHARD_REQUEST_CACHE.toString(),
requestCacheMaxSize);
} catch (Exception e) {
return new CacheMaxSizeStatus(
Copy link
Member

Choose a reason for hiding this comment

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

Can you provide more insight as to why do we need to modify this?

Copy link
Contributor Author

@atharvasharma61 atharvasharma61 Jun 4, 2024

Choose a reason for hiding this comment

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

The current logic returns a CacheMaxSizeStatus with null cacheMaxSize if exception is raised, while we require it to be non-null.

@Gaganjuneja
Copy link
Collaborator

Gaganjuneja commented Jun 4, 2024

@atharvasharma61 thanks for raising this. Could you please add the following details here?

  1. The changes in the core has introduced this issue. As far as I understood there is a level of nesting being introduced with tiered cache. Please provide the changes for reference.
  2. Please add the test case to capture such issues in the build iteslf.

@atharvasharma61
Copy link
Contributor Author

@atharvasharma61 thanks for raising this. Could you please add the following details here?

1. The changes in the core has introduced this issue. As far as I understood there is a level of nesting being introduced with tiered cache. Please provide the changes for reference.

2. Please add the test case to capture such issues in the build iteslf.

Hi Gagan. Thanks for responding.

  1. I have added the relevant PR in the description.
  2. This issue already got caught in failed UTs for the corresponding collector. So this case is also covered.

@Gaganjuneja
Copy link
Collaborator

@atharvasharma61 thanks for raising this. Could you please add the following details here?

1. The changes in the core has introduced this issue. As far as I understood there is a level of nesting being introduced with tiered cache. Please provide the changes for reference.

2. Please add the test case to capture such issues in the build iteslf.

Hi Gagan. Thanks for responding.

  1. I have added the relevant PR in the description.
  2. This issue already got caught in failed UTs for the corresponding collector. So this case is also covered.

How come it got released then?

@atharvasharma61
Copy link
Contributor Author

atharvasharma61 commented Jun 5, 2024

@atharvasharma61 thanks for raising this. Could you please add the following details here?

1. The changes in the core has introduced this issue. As far as I understood there is a level of nesting being introduced with tiered cache. Please provide the changes for reference.

2. Please add the test case to capture such issues in the build iteslf.

Hi Gagan. Thanks for responding.

  1. I have added the relevant PR in the description.
  2. This issue already got caught in failed UTs for the corresponding collector. So this case is also covered.

How come it got released then?

Looks like it is a miss. UT has been failing for quite some time. PR from 3 months ago: https://github.com/opensearch-project/performance-analyzer/actions/runs/8379459182/job/22946424856

@atharvasharma61 atharvasharma61 mentioned this pull request Jun 6, 2024
6 tasks
Signed-off-by: Gagan Juneja <gjjuneja@amazon.com>
@Gaganjuneja Gaganjuneja merged commit 489f318 into opensearch-project:main Jun 11, 2024
5 of 7 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 11, 2024
* Fixed the bug in CacheConfigMetricsCollector

Signed-off-by: Atharva Sharma <atharvasharma61@gmail.com>

* Fixes error logging

Signed-off-by: Gagan Juneja <gjjuneja@amazon.com>

---------

Signed-off-by: Atharva Sharma <atharvasharma61@gmail.com>
Signed-off-by: Gagan Juneja <gjjuneja@amazon.com>
Co-authored-by: Gagan Juneja <gjjuneja@amazon.com>
(cherry picked from commit 489f318)
Gaganjuneja pushed a commit that referenced this pull request Jun 11, 2024
* Fixed the bug in CacheConfigMetricsCollector

Signed-off-by: Atharva Sharma <atharvasharma61@gmail.com>

* Fixes error logging

Signed-off-by: Gagan Juneja <gjjuneja@amazon.com>

---------

Signed-off-by: Atharva Sharma <atharvasharma61@gmail.com>
Signed-off-by: Gagan Juneja <gjjuneja@amazon.com>
Co-authored-by: Gagan Juneja <gjjuneja@amazon.com>
(cherry picked from commit 489f318)

Co-authored-by: Atharva Sharma <60044988+atharvasharma61@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]org.opensearch.performanceanalyzer.collectors.CacheConfigMetricsCollector$CacheMaxSizeStatus
4 participants