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

AdmissionControl Split RCA #69

Conversation

mitalawachat
Copy link
Contributor

@mitalawachat mitalawachat commented Sep 14, 2021

Signed-off-by: Mital Awachat [email protected]

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

  • Split admission control rca into SmallHeap / MediumHeap / LargeHeap rca.
  • Reduce number of buckets for default configuration request-size controller heap-range to reduce too many auto-tunes for small percentage of heap variation.

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.

@codecov-commenter
Copy link

codecov-commenter commented Sep 14, 2021

Codecov Report

Merging #69 (38971d5) into main (cdcae41) will decrease coverage by 0.03%.
The diff coverage is 77.27%.

❗ Current head 38971d5 differs from pull request most recent head cacbf30. Consider uploading reports for the commit cacbf30 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##               main      #69      +/-   ##
============================================
- Coverage     72.15%   72.11%   -0.04%     
- Complexity     2928     2942      +14     
============================================
  Files           371      376       +5     
  Lines         18627    18680      +53     
  Branches       1415     1429      +14     
============================================
+ Hits          13440    13472      +32     
- Misses         4612     4624      +12     
- Partials        575      584       +9     
Impacted Files Coverage Δ
.../decisionmaker/actions/AdmissionControlAction.java 80.35% <0.00%> (-1.47%) ⬇️
...ceanalyzer/metrics/PerformanceAnalyzerMetrics.java 37.97% <0.00%> (ø)
...nalyzer/rca/configs/AdmissionControlRcaConfig.java 0.00% <ø> (ø)
...ensearch/performanceanalyzer/util/range/Range.java 55.55% <ø> (ø)
.../util/range/RequestSizeHeapRangeConfiguration.java 94.11% <ø> (ø)
...a/store/rca/admissioncontrol/model/HeapMetric.java 63.63% <63.63%> (ø)
...ecisionmaker/deciders/AdmissionControlDecider.java 79.06% <69.23%> (-8.11%) ⬇️
...ioncontrol/heap/AdmissionControlByHeapFactory.java 76.92% <76.92%> (ø)
...sioncontrol/heap/AdmissionControlByMediumHeap.java 80.64% <80.64%> (ø)
...tore/rca/admissioncontrol/AdmissionControlRca.java 63.79% <82.60%> (-2.07%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cdcae41...cacbf30. Read the comment docs.

@mitalawachat mitalawachat force-pushed the feature/admission-control/split-rca branch 4 times, most recently from 7921123 to ef38fe2 Compare September 16, 2021 06:03
"upper-bound": 80,
"threshold": 12.5
"threshold": 15.0
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 have some comments or more information in the PR's description on how these values are arrived at or more appropriate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated description, and also added in code comments.

return metricValue.get();
private <M extends Metric> double getMetric(M metric, Field<String> field, String fieldName) {
double response = 0;
for (MetricFlowUnit flowUnit : metric.getFlowUnits()) {
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 run as ./gradlew build as it will fix spotless bugs if any.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 41 to 43
private static final String small = "small";
private static final String medium = "medium";
private static final String large = "large";
Copy link
Contributor

Choose a reason for hiding this comment

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

static final variables names usually follow upper cases. Also can we be more descriptive with the variable name? SMALL_HEAP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@sruti1312
Copy link
Contributor

In order to avoid issues like rca flowunits not reaching the deciders that we encountered recently, can we add gauntlet tests to confirm that end-to-end workflow is working as expected?

Also, please add testing details to the PR.

/ BYTES_TO_MEGABYTES;
return heapMetrics;
private HeapMetric getHeapMetric() {
double usedHeap =
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 variables usedHeapInGb?


private double getThreshold(RangeConfiguration heapRange, double heapPercent) {
Range range = heapRange.getRange(heapPercent);
return Objects.isNull(range) ? 0 : range.getThreshold();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there are more spotless errors, can we fix them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Successfully completes ./gradlew build

@sruti1312
Copy link
Contributor

One major concern I have is LargeHeapRca, MediumHeapRca and SmallHeapRca are inputs to AdmissionControlRca. Currently, we do not have rca's that reference each other directly. We want to have RCAs independent of each other and hook them up if needed using the analysis graph.

I think LargeHeapRca, MediumHeapRca and SmallHeapRca are more of utility classes that AdmissionControlRca uses for emitting its status flowunits. If yes, can we make them as util classes. One another alternative is to keep them as RCA's and remove the admission control rca.

private double getHeapBasedThreshold(double currentHeapPercent) {
Range range = requestSizeHeapRange.getRange(currentHeapPercent);
return Objects.isNull(range) ? 0 : range.getThreshold();
HeapRca heapRca = HeapRcaFactory.getHeapRca(heapMetric.getMaxHeap());
Copy link
Contributor

Choose a reason for hiding this comment

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

The max heap value is going to stay the same, can we make this as a one time call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As PA runs outside of ES JVM, reading max heap here as it might change.

Signed-off-by: Mital Awachat <[email protected]>
@sruti1312 sruti1312 merged commit e4a6261 into opensearch-project:main Sep 24, 2021
sruti1312 added a commit that referenced this pull request Sep 27, 2021
* Remove emitting the entry key with the METRICS_WRITE_ERROR metric (#71)

Signed-off-by: Sruti Parthiban <[email protected]>

* Update commons-io version (#73)

Signed-off-by: Sruti Parthiban <[email protected]>

* AdmissionControl Split RCA (#69)

Signed-off-by: Mital Awachat <[email protected]>

Co-authored-by: Mital Awachat <[email protected]>

Co-authored-by: Sruti Parthiban <[email protected]>
Co-authored-by: Mital Awachat <[email protected]>
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