-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 2.x] Bug/sbp cancellation (#14502)
* Bug/sbp cancellation (#13474) * change cancellation logic to fix disparity bw trackers and resource duress Signed-off-by: Kaushal Kumar <[email protected]> * add additional tests for searchBackpressureService and refactor code Signed-off-by: Kaushal Kumar <[email protected]> * add enumMap instead of list for tracking taskResourceUsageTrackets Signed-off-by: Kaushal Kumar <[email protected]> * add nodeNotInDuress test for nodeDuressTrackers class Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * add entry in CHANGELOG Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * remove wildcard import Signed-off-by: Kaushal Kumar <[email protected]> * streamline imports Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * add additional test case to test the circuit breaker for SBP logic Signed-off-by: Kaushal Kumar <[email protected]> * add missing javadoc to resourece type enum Signed-off-by: Kaushal Kumar <[email protected]> * add javadoc to a method Signed-off-by: Kaushal Kumar <[email protected]> * fix javadoc warnings Signed-off-by: Kaushal Kumar <[email protected]> * fix javadoc warnings Signed-off-by: Kaushal Kumar <[email protected]> --------- Signed-off-by: Kaushal Kumar <[email protected]> (cherry picked from commit bcccedb) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Bug/sbp cancellation (#13474) * change cancellation logic to fix disparity bw trackers and resource duress Signed-off-by: Kaushal Kumar <[email protected]> * add additional tests for searchBackpressureService and refactor code Signed-off-by: Kaushal Kumar <[email protected]> * add enumMap instead of list for tracking taskResourceUsageTrackets Signed-off-by: Kaushal Kumar <[email protected]> * add nodeNotInDuress test for nodeDuressTrackers class Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * add entry in CHANGELOG Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * remove wildcard import Signed-off-by: Kaushal Kumar <[email protected]> * streamline imports Signed-off-by: Kaushal Kumar <[email protected]> * address comments Signed-off-by: Kaushal Kumar <[email protected]> * add additional test case to test the circuit breaker for SBP logic Signed-off-by: Kaushal Kumar <[email protected]> * add missing javadoc to resourece type enum Signed-off-by: Kaushal Kumar <[email protected]> * add javadoc to a method Signed-off-by: Kaushal Kumar <[email protected]> * fix javadoc warnings Signed-off-by: Kaushal Kumar <[email protected]> * fix javadoc warnings Signed-off-by: Kaushal Kumar <[email protected]> --------- Signed-off-by: Kaushal Kumar <[email protected]> * fix compilation error Signed-off-by: Kaushal Kumar <[email protected]> --------- Signed-off-by: Kaushal Kumar <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
1bb42ec
commit 708c371
Showing
23 changed files
with
914 additions
and
335 deletions.
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
41 changes: 41 additions & 0 deletions
41
server/src/main/java/org/opensearch/search/ResourceType.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,41 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.search; | ||
|
||
/** | ||
* Enum to hold the resource type | ||
*/ | ||
public enum ResourceType { | ||
CPU("cpu"), | ||
JVM("jvm"); | ||
|
||
private final String name; | ||
|
||
ResourceType(String name) { | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* The string match here is case-sensitive | ||
* @param s name matching the resource type name | ||
* @return a {@link ResourceType} | ||
*/ | ||
public static ResourceType fromName(String s) { | ||
for (ResourceType resourceType : values()) { | ||
if (resourceType.getName().equals(s)) { | ||
return resourceType; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unknown resource type: [" + s + "]"); | ||
} | ||
|
||
private String getName() { | ||
return name; | ||
} | ||
} |
241 changes: 146 additions & 95 deletions
241
server/src/main/java/org/opensearch/search/backpressure/SearchBackpressureService.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
41 changes: 0 additions & 41 deletions
41
server/src/main/java/org/opensearch/search/backpressure/trackers/NodeDuressTracker.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.