-
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 changes to block calls in cat shards, indices and segments based on dynamic limit settings #15986
Add changes to block calls in cat shards, indices and segments based on dynamic limit settings #15986
Conversation
❌ Gradle check result for 8796ab6: 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? |
59b896a
to
ec96cdd
Compare
❌ Gradle check result for 59b896a: 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? |
❌ Gradle check result for ec96cdd: 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? |
1944512
to
515a699
Compare
…on dynamic limit settings Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
515a699
to
454e2dd
Compare
❌ Gradle check result for 973f3be: 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? |
❌ Gradle check result for 1944512: 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? |
❌ Gradle check result for 515a699: 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? |
❌ Gradle check result for 27440d2: 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? |
27440d2
to
8a2140f
Compare
Reason - failed for task ':server:spotlessJavaCheck'. Pushed fix post running ./gradlew :server:spotlessApply |
❌ Gradle check result for 454e2dd: 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: Sumit Bansal <sumitsb@amazon.com>
❌ Gradle check result for 8a2140f: 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? |
8a2140f
to
399fb59
Compare
❌ Gradle check result for 399fb59: 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? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15986 +/- ##
============================================
+ Coverage 71.91% 71.95% +0.04%
- Complexity 64491 64561 +70
============================================
Files 5289 5291 +2
Lines 301509 301620 +111
Branches 43557 43571 +14
============================================
+ Hits 216818 217040 +222
+ Misses 66892 66820 -72
+ Partials 17799 17760 -39 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
❌ Gradle check result for 4e732b1: 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: Sumit Bansal <sumitsb@amazon.com>
❌ Gradle check result for 09492e1: 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? |
Existing flaky tests are failing. |
Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
server/src/test/java/org/opensearch/common/breaker/ResponseLimitSettingsTests.java
Show resolved
Hide resolved
@sumitasr we will need documentation PR for new settings |
Helping with merge as it is already approved by @backslasht & @rajiv-kv |
Tracking documentation updates here opensearch-project/documentation-website#8460 |
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-15986-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 bf6566e76c46bd7dc5d838503b8c43ff8cb09757
# Push it to GitHub
git push --set-upstream origin backport/backport-15986-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 |
…on dynamic limit settings (opensearch-project#15986) * Add changes to block calls in cat shards, indices and segments based on dynamic limit settings Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
…on dynamic limit settings (opensearch-project#15986) * Add changes to block calls in cat shards, indices and segments based on dynamic limit settings Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
…on dynamic limit settings (opensearch-project#15986) * Add changes to block calls in cat shards, indices and segments based on dynamic limit settings Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
…on dynamic limit settings (opensearch-project#15986) * Add changes to block calls in cat shards, indices and segments based on dynamic limit settings Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
Add changes to block calls in cat shards, indices and segments based on dynamic limit settings
Description
Introduced a new class RequestLimitSettings to maintain dynamic settings for 3 actions - cat indices, shards and segments and method to evaluate if circuitLimitBreached for an action.
Introduced isRequestLimitCheckSupported method defaulting to false in AbstractCatAction so that we can override this if an action extending AbstractCatAction can define if it supports limit or circuit breaker checks introduced in RequestLimitSettings class. This value can be passed to respected transport action as param e.g. TransportCatShardsAction
If circuit limit breached, CircuitBreakingException will be raised which is mapped to 429 error code.
Related Issues
Resolves #15954
Functional Testing
(Outdated - Exception scenario response format has been modified)
Action 1 : /_cat/shards/
Step 1 - Run OS cluster locally
Step 2 - PUT 3 index
Step 3 - Perform /_cat/shards/
curl -XGET "http://localhost:9200/_cat/shards/"
1index 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
1index 0 r UNASSIGNED
2index 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
2index 0 r UNASSIGNED
3index 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
3index 0 r UNASSIGNED
Step 4 - Update setting cat.shards.limit to 2
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.shards.response.limit.number_of_shards" : 2
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"shards":{"response":{"limit":{"number_of_shards":"2"}}}}}}%
Step 5 - Perform /_cat/shards/
curl -XGET "http://localhost:9200/_cat/shards/"
curl -XGET "http://localhost:9200/_cat/shards/"
{"error":{"root_cause":[{"type":"response_limit_breached_exception","reason":"Too many shards requested. Can not request shards beyond {2}"}],"type":"response_limit_breached_exception","reason":"Too many shards requested. Can not request shards beyond {2}"},"status":429}%
Step 6 - Update setting cat.shards.limit to 6
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.shards.response.limit.number_of_shards" : 6
}
}'
Step 7 - Perform /_cat/shards/
curl -XGET "http://localhost:9200/_cat/shards/"
1index 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
1index 0 r UNASSIGNED
2index 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
2index 0 r UNASSIGNED
3index 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
3index 0 r UNASSIGNED
Action 2 : /_cat/indices/
Step 1 - Using cluster started in previous section
Step 2 - Perform /_cat/indices/
curl -XGET "http://localhost:9200/_cat/indices/"
yellow open 1index RdrZ-a-hQ86Dk9BkSKMceQ 1 1 1 0 4.7kb 4.7kb
yellow open 2index hb2ANDTMT7OQfMGa8dKzGA 1 1 1 0 4.7kb 4.7kb
yellow open 3index SmI1dxl2SECswo67Y37TKg 1 1 1 0 4.7kb 4.7kb
Step 3 - Update settings
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.indices.response.limit.number_of_indices" : 1
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"indices":{"response":{"limit":{"number_of_indices":"1"}}}}}}%
Step 4 - Perform /_cat/indices/
curl -XGET "http://localhost:9200/_cat/indices/"
{"error":{"root_cause":[{"type":"response_limit_breached_exception","reason":"Too many indices requested. Can not request indices beyond {1}"}],"type":"response_limit_breached_exception","reason":"Too many indices requested. Can not request indices beyond {1}"},"status":429}%
Step 5 - Update settings
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.indices.response.limit.number_of_indices" : -1
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"indices":{"response":{"limit":{"number_of_indices":"-1"}}}}}}%
Step 6 - Perform /_cat/indices/
curl -XGET "http://localhost:9200/_cat/indices/"
yellow open 1index RdrZ-a-hQ86Dk9BkSKMceQ 1 1 1 0 4.7kb 4.7kb
yellow open 2index hb2ANDTMT7OQfMGa8dKzGA 1 1 1 0 4.7kb 4.7kb
yellow open 3index SmI1dxl2SECswo67Y37TKg 1 1 1 0 4.7kb 4.7kb
Action 3 : /_cat/segments/
Step 1 - Using cluster started in previous section
Step 2 - Perform /_cat/segments/
curl -XGET "http://localhost:9200/_cat/segments/"
1index 0 p 127.0.0.1 _0 0 1 0 4.5kb 0 false true 9.12.0 true
2index 0 p 127.0.0.1 _0 0 1 0 4.5kb 0 false true 9.12.0 true
3index 0 p 127.0.0.1 _0 0 1 0 4.5kb 0 false true 9.12.0 true
Step3 - Update settings
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.segments.response.limit.number_of_indices" : 1
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"segments":{"response":{"limit":{"number_of_indices":"1"}}}}}}%
Step 4 - Perform /_cat/segments/
curl -XGET "http://localhost:9200/_cat/segments/"
{"error":{"root_cause":[{"type":"response_limit_breached_exception","reason":"Segments from too many indices requested. Can not request indices beyond {1}"}],"type":"response_limit_breached_exception","reason":"Segments from too many indices requested. Can not request indices beyond {1}"},"status":429}%
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.