-
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
base: main
Are you sure you want to change the base?
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.90% 71.90% -0.01%
+ Complexity 64392 64368 -24
============================================
Files 5278 5281 +3
Lines 300877 300947 +70
Branches 43478 43492 +14
============================================
+ Hits 216351 216390 +39
- Misses 66747 66786 +39
+ Partials 17779 17771 -8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
❌ Gradle check result for 66c962b: 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? |
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
Action 1 : /_cat/shards/
Step 1 - Run OS cluster locally
Step 2 - PUT 2 index
Step 3 - Perform /_cat/shards/
curl -XGET "http://localhost:9200/_cat/shards/"
3m3y-index21 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
3m3y-index21 0 r UNASSIGNED
index2 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
index2 0 r UNASSIGNED
Step 4 - Update setting cat.shards.limit to 2
time curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.shards.limit" : 2
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"shards":{"limit":"2"}}}}curl -X PUT "localhost:9200/_cluster/settings" -H 0.00s user 0.01s system 12% cpu 0.100 total
Step 5 - Perform /_cat/shards/
curl -XGET "http://localhost:9200/_cat/shards/"
{"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"Too many shards requested.","bytes_wanted":0,"bytes_limit":0,"durability":"TRANSIENT"}],"type":"circuit_breaking_exception","reason":"Too many shards requested.","bytes_wanted":0,"bytes_limit":0,"durability":"TRANSIENT"},"status":429}%
Step 6 - Update setting cat.shards.limit to 5
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.shards.limit" : 5
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"shards":{"limit":"5"}}}}%
Step 7 - Perform /_cat/shards/
curl -XGET "http://localhost:9200/_cat/shards/"
3m3y-index21 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
3m3y-index21 0 r UNASSIGNED
index2 0 p STARTED 1 4.7kb 127.0.0.1 runTask-0
index2 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 3m3y-index21 5P24Sl2hTee4mhqdgu8cHQ 1 1 1 0 4.8kb 4.8kb
yellow open index2 clEIcfQpQUOLXZdWt_AqgA 1 1 1 0 4.8kb 4.8kb
Step 3 - Update settings
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.indices.limit" : 1
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"indices":{"limit":"1"}}}}%
Step 4 - Perform /_cat/indices/
curl -XGET "http://localhost:9200/_cat/indices/"
{"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"Too many indices requested.","bytes_wanted":0,"bytes_limit":0,"durability":"TRANSIENT"}],"type":"circuit_breaking_exception","reason":"Too many indices requested.","bytes_wanted":0,"bytes_limit":0,"durability":"TRANSIENT"},"status":429}%
Step 5 - Update settings
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.indices.limit" : -1
}
}'
Step 6 - Perform /_cat/indices/
curl -XGET "http://localhost:9200/_cat/indices/"
yellow open 3m3y-index21 5P24Sl2hTee4mhqdgu8cHQ 1 1 1 0 4.8kb 4.8kb
yellow open index2 clEIcfQpQUOLXZdWt_AqgA 1 1 1 0 4.8kb 4.8kb
Action 3 : /_cat/segments/
Step 1 - Using cluster started in previous section
Step 2 - Perform /_cat/segments/
curl -XGET "http://localhost:9200/_cat/segments/"
3m3y-index21 0 p 127.0.0.1 _0 0 1 0 4.5kb 0 true true 9.12.0 true
index2 0 p 127.0.0.1 _0 0 1 0 4.5kb 0 true true 9.12.0 true
Step3 - Update settings
curl -X PUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d'
{
"transient" : {
"cat.segments.limit" : 1
}
}'
{"acknowledged":true,"persistent":{},"transient":{"cat":{"segments":{"limit":"1"}}}}%
Step 4 - Perform /_cat/segments/
curl -XGET "http://localhost:9200/_cat/segments/"
{"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"Segments from too many indices requested.","bytes_wanted":0,"bytes_limit":0,"durability":"TRANSIENT"}],"type":"circuit_breaking_exception","reason":"Segments from too many indices requested.","bytes_wanted":0,"bytes_limit":0,"durability":"TRANSIENT"},"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.