-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 basic thorttler/exponential backoff policy for retry/Defination o… #3527
Add basic thorttler/exponential backoff policy for retry/Defination o… #3527
Conversation
…f throttling exception Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
for (T key : semaphores.keySet()) { | ||
semaphores.put(key, new AdjustableSemaphore(semaphores.get(key).getMaxPermits(), true)); | ||
} | ||
} |
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.
I think we should have the constructor intialize the semaphore with the desired permits
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.
Can you please elaborate more on it? We are passing the desired permits in constructor of Semaphore itslef.
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
private ExponentialEqualJitterBackoffIterator(int baseDelay, int maxDelay) { | ||
this.baseDelay = baseDelay; | ||
this.maxDelay = maxDelay; | ||
} |
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.
Should we have max retry in the constructor?
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.
No we dont want max retry for this policy. This policy will eventually perform infinite retries with exponential backoff.
server/src/main/java/org/opensearch/action/bulk/BackoffPolicy.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/cluster/service/ThrottlerTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
0c9bea5
to
049c3de
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/cluster/service/Throttler.java
Outdated
Show resolved
Hide resolved
…' into throttling-pr-1 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
@dblock / @reta My latest build(https://build.ci.opensearch.org/job/gradle-check/372/) was failing due to this bug. (#3838). Since the fix is merged in main branch, I am rebasing my PR against latest main branch. |
Gradle Check (Jenkins) Run Completed with:
|
@dblock / @reta Since build has passed, can you please help rebase the feature branch (https://github.com/opensearch-project/OpenSearch/tree/feature/master-task-throttling) with latest fix (since it is behind couple commit from main), and then merge this PR into feature branch. Thanks in Advance!! |
@dhwanilpatel Sadly I cannot push to |
Did I hit merge on the wrong PR? I was supposed to merge #3843? |
@dhwanilpatel Please reopen a PR onto |
Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… #3527 Changes required in Master node to perform throttling. Master node changes for master task throttling #3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling #4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling #4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling #4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…t#4986) Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… opensearch-project#3527 Changes required in Master node to perform throttling. Master node changes for master task throttling opensearch-project#3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling opensearch-project#4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling opensearch-project#4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling opensearch-project#4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…t#4986) Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… opensearch-project#3527 Changes required in Master node to perform throttling. Master node changes for master task throttling opensearch-project#3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling opensearch-project#4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling opensearch-project#4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling opensearch-project#4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…t#4986) Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… opensearch-project#3527 Changes required in Master node to perform throttling. Master node changes for master task throttling opensearch-project#3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling opensearch-project#4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling opensearch-project#4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling opensearch-project#4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…t#4986) Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… opensearch-project#3527 Changes required in Master node to perform throttling. Master node changes for master task throttling opensearch-project#3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling opensearch-project#4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling opensearch-project#4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling opensearch-project#4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…t#4986) Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… opensearch-project#3527 Changes required in Master node to perform throttling. Master node changes for master task throttling opensearch-project#3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling opensearch-project#4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling opensearch-project#4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling opensearch-project#4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
…t#4986) Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… opensearch-project#3527 Changes required in Master node to perform throttling. Master node changes for master task throttling opensearch-project#3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling opensearch-project#4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling opensearch-project#4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling opensearch-project#4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Basic Throttler Framework / Exponential Basic back off policy. Add basic thorttler/exponential backoff policy for retry/Defination o… #3527 Changes required in Master node to perform throttling. Master node changes for master task throttling #3882 Changes required in Data node to perform retry on throttling. Data node changes for master task throttling #4204 Provide support for all task type in throttling framework. Onboarding of few task types to throttling #4542 Integration Tests (Fix timeout exception and Add Integ test for Master task throttling #4588 Signed-off-by: Dhwanil Patel <dhwanip@amazon.com>
Add basic thorttler/exponential backoff policy for retry/Defination of throttling exception
Signed-off-by: Dhwanil Patel dhwanip@amazon.com
Description
This is one of multiple PR planned for master task throttling. In this PR we are introducing couple of new classes required for upcoming PRs.
New class/Method introduced in this PR:
Throttler : Base class for Throttling logic. It provides throttling functionality over multiple keys.
ExponentialBackOffPolicy : It provides exponential backoff between retries until it reaches maxDelay. It uses equal jitter scheme as it is being used for throttled exceptions. It will make random distribution and also guarantees a minimum delay.
AdjustableSemaphore: AdjustableSemaphore is Extended Semphore where we can change maxPermits.
MasterTaskThrottlingException : new Throttling Exception which will be thrown from master node whenever it throttles any tasks.
Issues Resolved
Relates to : #479
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.