-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add validation for the search backpressure cancellation settings #15501
Conversation
Signed-off-by: Gao Binlong <[email protected]>
Signed-off-by: Gao Binlong <[email protected]>
❌ Gradle check result for adcf328: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
...er/src/main/java/org/opensearch/search/backpressure/settings/SearchBackpressureSettings.java
Show resolved
Hide resolved
❌ Gradle check result for f518b2e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Gao Binlong <[email protected]>
rest-api-spec/src/main/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml
Show resolved
Hide resolved
Sorry @gaobinlong , completely forgot about this change |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-15501-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8347d0ec22aa865dea3bc4b2027fb7bdf486fab2
# Push it to GitHub
git push --set-upstream origin backport/backport-15501-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x Then, create a pull request where the |
@gaobinlong could you please backport to |
…nsearch-project#15501) * Fix updating search backpressure settings crashing the cluster Signed-off-by: Gao Binlong <[email protected]> * Modify change log Signed-off-by: Gao Binlong <[email protected]> * Fix version check Signed-off-by: Gao Binlong <[email protected]> * Increase test coverage Signed-off-by: Gao Binlong <[email protected]> * Format the code Signed-off-by: Gao Binlong <[email protected]> * Optimize some code Signed-off-by: Gao Binlong <[email protected]> * Fix typo Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 8347d0e)
…nsearch-project#15501) * Fix updating search backpressure settings crashing the cluster Signed-off-by: Gao Binlong <[email protected]> * Modify change log Signed-off-by: Gao Binlong <[email protected]> * Fix version check Signed-off-by: Gao Binlong <[email protected]> * Increase test coverage Signed-off-by: Gao Binlong <[email protected]> * Format the code Signed-off-by: Gao Binlong <[email protected]> * Optimize some code Signed-off-by: Gao Binlong <[email protected]> * Fix typo Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…n settings (#15969) * Add validation for the search backpressure cancellation settings (#15501) * Fix updating search backpressure settings crashing the cluster Signed-off-by: Gao Binlong <[email protected]> * Modify change log Signed-off-by: Gao Binlong <[email protected]> * Fix version check Signed-off-by: Gao Binlong <[email protected]> * Increase test coverage Signed-off-by: Gao Binlong <[email protected]> * Format the code Signed-off-by: Gao Binlong <[email protected]> * Optimize some code Signed-off-by: Gao Binlong <[email protected]> * Fix typo Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> (cherry picked from commit 8347d0e) * Update version check in yml test file Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…nsearch-project#15501) * Fix updating search backpressure settings crashing the cluster Signed-off-by: Gao Binlong <[email protected]> * Modify change log Signed-off-by: Gao Binlong <[email protected]> * Fix version check Signed-off-by: Gao Binlong <[email protected]> * Increase test coverage Signed-off-by: Gao Binlong <[email protected]> * Format the code Signed-off-by: Gao Binlong <[email protected]> * Optimize some code Signed-off-by: Gao Binlong <[email protected]> * Fix typo Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…nsearch-project#15501) * Fix updating search backpressure settings crashing the cluster Signed-off-by: Gao Binlong <[email protected]> * Modify change log Signed-off-by: Gao Binlong <[email protected]> * Fix version check Signed-off-by: Gao Binlong <[email protected]> * Increase test coverage Signed-off-by: Gao Binlong <[email protected]> * Format the code Signed-off-by: Gao Binlong <[email protected]> * Optimize some code Signed-off-by: Gao Binlong <[email protected]> * Fix typo Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
…nsearch-project#15501) * Fix updating search backpressure settings crashing the cluster Signed-off-by: Gao Binlong <[email protected]> * Modify change log Signed-off-by: Gao Binlong <[email protected]> * Fix version check Signed-off-by: Gao Binlong <[email protected]> * Increase test coverage Signed-off-by: Gao Binlong <[email protected]> * Format the code Signed-off-by: Gao Binlong <[email protected]> * Optimize some code Signed-off-by: Gao Binlong <[email protected]> * Fix typo Signed-off-by: Gao Binlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]>
Description
Updating the cluster level setting
search_backpressure.cancellation_burst
(deprecated),search_backpressure.search_task.cancellation_burst
orsearch_backpressure.search_shard_task.cancellation_burst
to an non-default value cause the cluster crash, the reason is that the value ofcancellationRate
is always 0 here:OpenSearch/server/src/main/java/org/opensearch/search/backpressure/SearchBackpressureState.java
Line 101 in 2b84305
, so an exception is thrown here:
OpenSearch/server/src/main/java/org/opensearch/common/util/TokenBucket.java
Line 51 in 2b84305
Just like
cancellationRatio
, we also need to get the value ofcancellationRate
from the cluster settings and pass it to the constructor method ofSearchBackpressureState
.Another issue is that we don't have some validations for the setting
cancellationRate
andcancellationRatio
, so when updating these two settings to 0, the same exception "rate must be greater than zero" is also thrown and then crash the cluster.Related Issues
#15495
Check List
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.