-
Notifications
You must be signed in to change notification settings - Fork 57
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
SearchBackPressure Service Node/Cluster RCA #437
Merged
ansjcy
merged 40 commits into
opensearch-project:main
from
CoderJeffrey:searchbp_decider_latest
Jul 20, 2023
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
46bd63e
Remove log files and add DCO (Signed-off-by: Jeffrey Liu ujeffliu@ama…
CoderJeffrey 92c3fc8
Remove extra files (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey a47388a
Remove styling difference (Signed-off-by: Jeffrey Liu ujeffliu@amazon…
CoderJeffrey 8b86501
Remove unnecessary file changes (Signed-off-by: Jeffrey Liu ujeffliu@…
CoderJeffrey c6549a9
Add RCA_Decider (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey a296384
Extract Heap Usage from SQlitedb (Signed-off-by: Jeffrey Liu ujeffliu…
CoderJeffrey c44b928
Extract required searchbp metrics for deciders (signed-off-by: Jeffre…
CoderJeffrey c1e957d
Add SearchBackPressureRCA Metric (Signed-off-by: Jeffrey Liu ujeffliu…
CoderJeffrey 55e5cdd
Use SearchBackPressureRCAMetrics to aggregate metrics (signed-off-by:…
CoderJeffrey 2898060
Add the conf file extracted part for SearchBackPressureRcaConfig.java…
CoderJeffrey 48c92fb
Add MinMaxSlidingWindow in OldGenRca (Signed-off-by: Jeffrey Liu ujef…
CoderJeffrey c84cf34
Rename SearchBackPressureClusterRCA and add it to AnalysisGraph (Sign…
CoderJeffrey 08f6927
Add basic UTs for SearchBackPressureRCA cluster/node level (Signed-of…
CoderJeffrey 31e8b49
Add unhealthy/healthy stats UTs for SearchBackPressureRCA cluster/nod…
CoderJeffrey 4bfa1b2
Add healthy resource unit UT (Signed-off-by: Jeffrey Liu ujeffliu@ama…
CoderJeffrey 13e2d48
Add UT s both shard/task level (Signed-off-by: Jeffrey Liu ujeffliu@a…
CoderJeffrey 5e3aed7
Add a new SearchBp Resource Unit (Signed-off-by: Jeffrey Liu ujeffliu…
CoderJeffrey 8d78c3b
Add UTs to test shard/task level resource include-ness (Signed-off-by…
CoderJeffrey 9c5e832
Merge latest code change in main branch with Node/Cluster RCA for Sea…
CoderJeffrey 55b8ec0
Remove styling changes for Version.java (Signed-off-by: Jeffrey Liu u…
CoderJeffrey 12fe8a8
Add metadata to resourceSummary (Signed-off-by: Jeffrey Liu ujeffliu@…
CoderJeffrey 1b7837d
Update to more general framework (Signed-off-by: Jeffrey Liu ujeffliu…
CoderJeffrey 8b059a8
(Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey c49e771
Refactor the MinMaxSlidingWindow and bug fix (Signed-off-by: Jeffrey …
CoderJeffrey 648e94d
Refactor Heap Stats Metrics Getter(Signed-off-by: Jeffrey Liu ujeffli…
CoderJeffrey ca65059
Refactor HeapUsed and HeapMax Getters (Signed-off-by: Jeffrey Liu uje…
CoderJeffrey 4c69fb3
Refactor operate() (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey cf92a61
Refactor operate() and remove dead comments (Signed-off-by: Jeffrey L…
CoderJeffrey 3ac2eec
Merge branch 'main' into searchbp_decider_latest
CoderJeffrey aca9a52
Merged Main (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey 211a47d
Merge branch 'main' into searchbp_decider_latest
CoderJeffrey f4ea13e
Merged Main (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey 6d63620
remove trailing space in build.gradle (Signed-off-by: Jeffrey Liu uje…
CoderJeffrey 86654b6
nit javadoc update (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey fd0ad05
nit javadoc updates (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey 2ef0800
nit javadoc updates (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey 78a3acb
Remove dead comments (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey 7d10b5c
update javadoc (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey d899fb0
LOG Level Change (Signed-off-by: Jeffrey Liu [email protected])
CoderJeffrey 3a1893b
Change from static class to enum (Signed-off-by: Jeffrey Liu ujeffliu…
CoderJeffrey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
...main/java/org/opensearch/performanceanalyzer/rca/configs/SearchBackPressureRcaConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.performanceanalyzer.rca.configs; | ||
|
||
|
||
import org.opensearch.performanceanalyzer.rca.framework.core.RcaConf; | ||
|
||
public class SearchBackPressureRcaConfig { | ||
public static final String CONFIG_NAME = "search-back-pressure-rca-policy"; | ||
|
||
/* Metadata fields for thresholds */ | ||
public static final String INCREASE_THRESHOLD_BY_JVM_STR = "increase_jvm"; | ||
public static final String DECREASE_THRESHOLD_BY_JVM_STR = "decrease_jvm"; | ||
|
||
public static final int SLIDING_WINDOW_SIZE_IN_MINS = 1; | ||
|
||
// Interval period in seconds | ||
public static final long DEFAULT_EVALUATION_INTERVAL_IN_S = 60; | ||
|
||
/* interval period to call operate() */ | ||
public static final long EVAL_INTERVAL_IN_S = 5; | ||
|
||
/* Increase Threshold */ | ||
// node max heap usage in last 60 secs is less than 70% | ||
public static final int DEFAULT_MAX_HEAP_INCREASE_THRESHOLD = 70; | ||
private Integer maxHeapIncreasePercentageThreshold; | ||
|
||
// cancellationCount due to heap is more than 50% of all task cancellations in shard level | ||
public static final int DEFAULT_SHARD_MAX_HEAP_CANCELLATION_THRESHOLD = 50; | ||
private Integer maxShardHeapCancellationPercentageThreshold; | ||
|
||
// cancellationCount due to heap is more than 50% of all task cancellations in task level | ||
public static final int DEFAULT_TASK_MAX_HEAP_CANCELLATION_THRESHOLD = 50; | ||
private Integer maxTaskHeapCancellationPercentageThreshold; | ||
|
||
/* Decrease Threshold */ | ||
// node min heap usage in last 60 secs is more than 80% | ||
public static final int DEFAULT_MIN_HEAP_DECREASE_THRESHOLD = 80; | ||
private Integer minHeapDecreasePercentageThreshold; | ||
|
||
// cancellationCount due to heap is less than 30% of all task cancellations in shard level | ||
public static final int DEFAULT_SHARD_MIN_HEAP_CANCELLATION_THRESHOLD = 30; | ||
private Integer minShardHeapCancellationPercentageThreshold; | ||
|
||
// cancellationCount due to heap is less than 30% of all task cancellations in task level | ||
public static final int DEFAULT_TASK_MIN_HEAP_CANCELLATION_THRESHOLD = 30; | ||
private Integer minTaskHeapCancellationPercentageThreshold; | ||
|
||
public SearchBackPressureRcaConfig(final RcaConf conf) { | ||
// (s) -> s > 0 is the validator, if validated, fields from conf file will be returned, | ||
// else, default value gets returned | ||
maxHeapIncreasePercentageThreshold = | ||
conf.readRcaConfig( | ||
CONFIG_NAME, | ||
SearchBackPressureRcaConfigKeys.MAX_HEAP_USAGE_INCREASE_FIELD.toString(), | ||
DEFAULT_MAX_HEAP_INCREASE_THRESHOLD, | ||
(s) -> s >= 0 && s <= 100, | ||
Integer.class); | ||
maxShardHeapCancellationPercentageThreshold = | ||
conf.readRcaConfig( | ||
CONFIG_NAME, | ||
SearchBackPressureRcaConfigKeys.MAX_SHARD_HEAP_CANCELLATION_PERCENTAGE_FIELD | ||
.toString(), | ||
DEFAULT_SHARD_MAX_HEAP_CANCELLATION_THRESHOLD, | ||
(s) -> s >= 0 && s <= 100, | ||
Integer.class); | ||
maxTaskHeapCancellationPercentageThreshold = | ||
conf.readRcaConfig( | ||
CONFIG_NAME, | ||
SearchBackPressureRcaConfigKeys.MAX_TASK_HEAP_CANCELLATION_PERCENTAGE_FIELD | ||
.toString(), | ||
DEFAULT_TASK_MAX_HEAP_CANCELLATION_THRESHOLD, | ||
(s) -> s >= 0 && s <= 100, | ||
Integer.class); | ||
minHeapDecreasePercentageThreshold = | ||
conf.readRcaConfig( | ||
CONFIG_NAME, | ||
SearchBackPressureRcaConfigKeys.MAX_HEAP_USAGE_DECREASE_FIELD.toString(), | ||
DEFAULT_MIN_HEAP_DECREASE_THRESHOLD, | ||
(s) -> s >= 0 && s <= 100, | ||
Integer.class); | ||
minShardHeapCancellationPercentageThreshold = | ||
conf.readRcaConfig( | ||
CONFIG_NAME, | ||
SearchBackPressureRcaConfigKeys.MIN_SHARD_HEAP_CANCELLATION_PERCENTAGE_FIELD | ||
.toString(), | ||
DEFAULT_SHARD_MIN_HEAP_CANCELLATION_THRESHOLD, | ||
(s) -> s >= 0 && s <= 100, | ||
Integer.class); | ||
minTaskHeapCancellationPercentageThreshold = | ||
conf.readRcaConfig( | ||
CONFIG_NAME, | ||
SearchBackPressureRcaConfigKeys.MIN_TASK_HEAP_CANCELLATION_PERCENTAGE_FIELD | ||
.toString(), | ||
DEFAULT_TASK_MIN_HEAP_CANCELLATION_THRESHOLD, | ||
(s) -> s >= 0 && s <= 100, | ||
Integer.class); | ||
} | ||
|
||
// Getters for private field | ||
public Integer getMaxHeapIncreasePercentageThreshold() { | ||
return maxHeapIncreasePercentageThreshold; | ||
} | ||
|
||
public Integer getMaxShardHeapCancellationPercentageThreshold() { | ||
return maxShardHeapCancellationPercentageThreshold; | ||
} | ||
|
||
public Integer getMaxTaskHeapCancellationPercentageThreshold() { | ||
return maxTaskHeapCancellationPercentageThreshold; | ||
} | ||
|
||
public Integer getMinHeapDecreasePercentageThreshold() { | ||
return minHeapDecreasePercentageThreshold; | ||
} | ||
|
||
public Integer getMinShardHeapCancellationPercentageThreshold() { | ||
return minShardHeapCancellationPercentageThreshold; | ||
} | ||
|
||
public Integer getMinTaskHeapCancellationPercentageThreshold() { | ||
return minTaskHeapCancellationPercentageThreshold; | ||
} | ||
|
||
// name for the configuration field | ||
public enum SearchBackPressureRcaConfigKeys { | ||
MAX_HEAP_USAGE_INCREASE_FIELD("max-heap-usage-increase"), | ||
MAX_SHARD_HEAP_CANCELLATION_PERCENTAGE_FIELD("max-shard-heap-cancellation-percentage"), | ||
MAX_TASK_HEAP_CANCELLATION_PERCENTAGE_FIELD("max-task-heap-cancellation-percentage"), | ||
MAX_HEAP_USAGE_DECREASE_FIELD("max-heap-usage-decrease"), | ||
MIN_SHARD_HEAP_CANCELLATION_PERCENTAGE_FIELD("min-shard-heap-cancellation-percentage"), | ||
MIN_TASK_HEAP_CANCELLATION_PERCENTAGE_FIELD("min-task-heap-cancellation-percentage"); | ||
|
||
private final String value; | ||
|
||
SearchBackPressureRcaConfigKeys(final String value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return this.value; | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...ain/java/org/opensearch/performanceanalyzer/rca/framework/api/metrics/Searchbp_Stats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.performanceanalyzer.rca.framework.api.metrics; | ||
|
||
|
||
import org.opensearch.performanceanalyzer.commons.metrics.AllMetrics; | ||
import org.opensearch.performanceanalyzer.rca.framework.api.Metric; | ||
|
||
public class Searchbp_Stats extends Metric { | ||
public Searchbp_Stats(long evaluationIntervalSeconds) { | ||
super( | ||
AllMetrics.SearchBackPressureStatsValue.SEARCHBP_TABLE_NAME.toString(), | ||
evaluationIntervalSeconds); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ch/performanceanalyzer/rca/store/rca/searchbackpressure/SearchBackPressureClusterRCA.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.performanceanalyzer.rca.store.rca.searchbackpressure; | ||
|
||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.opensearch.performanceanalyzer.rca.framework.api.Rca; | ||
import org.opensearch.performanceanalyzer.rca.framework.api.flow_units.ResourceFlowUnit; | ||
import org.opensearch.performanceanalyzer.rca.framework.api.summaries.HotNodeSummary; | ||
import org.opensearch.performanceanalyzer.rca.store.rca.cluster.BaseClusterRca; | ||
|
||
public class SearchBackPressureClusterRCA extends BaseClusterRca { | ||
|
||
public static final String RCA_TABLE_NAME = SearchBackPressureClusterRCA.class.getSimpleName(); | ||
private static final Logger LOG = LogManager.getLogger(SearchBackPressureClusterRCA.class); | ||
|
||
public <R extends Rca<ResourceFlowUnit<HotNodeSummary>>> SearchBackPressureClusterRCA( | ||
final int rcaPeriod, final R SearchBackPressureRCA) { | ||
super(rcaPeriod, SearchBackPressureRCA); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
will the values of these thresholds be modified during runtime? If not we can make them
final
as well.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.
Yes, these values like minTaskHeapCancellationPercentageThreshold will read values from config file in runtime thus we cannot mark them as final
minHeapDecreasePercentageThreshold = conf.readRcaConfig( CONFIG_NAME, RCA_CONF_KEY_CONSTANTS.MAX_HEAP_USAGE_DECREASE_FIELD, DEFAULT_MIN_HEAP_DECREASE_THRESHOLD, (s) -> s >= 0 && s <= 100, Integer.class);