Skip to content
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 retryable AOSS HTTP response #951

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

seankao-az
Copy link
Collaborator

@seankao-az seankao-az commented Nov 27, 2024

Description

Add retryable AOSS http response.
Please check the linked issue.
For AOSS, retry if status code is 400 and error message contains "resource_already_exists_exception"

Related Issues

Tests

24/12/08 13:50:00.835 INFO {QID=****} (main) RetryableHttpAsyncClient: Building retryable http async client with options: FlintRetryOptions{maxRetries=3, retryableStatusCodes=429,502, retryableExceptionClassNames=Optional.empty}

...

24/12/08 13:50:01.047 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Checking if status code is retryable: 400
24/12/08 13:50:01.047 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Status code 400 check result: false
24/12/08 13:50:01.047 INFO {QID=****} (main) HttpAOSSResultPredicate: Checking if response is retryable
24/12/08 13:50:01.049 INFO {QID=****} (main) HttpAOSSResultPredicate: Check retryable response result: true
24/12/08 13:50:01.049 ERROR {QID=****} (main) FlintRetryOptions: Attempt to execute request failed: ExecutionAttemptedEvent[result=HTTP/1.1 400 Bad Request [content-type: application/json; charset=UTF-8, content-length: 423, x-envoy-upstream-service-time: 134, date: Sun, 08 Dec 2024 13:50:00 GMT, server: aoss-amazon-m, x-request-id: ****] shaded.flint.org.apache.http.entity.BufferedHttpEntity@4d2acd3c, exception=null]
24/12/08 13:50:01.994 WARN {QID=****} (main) FlintRetryOptions: Retrying failed request at #1

...

24/12/08 13:50:02.118 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Checking if status code is retryable: 400
24/12/08 13:50:02.118 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Status code 400 check result: false
24/12/08 13:50:02.118 INFO {QID=****} (main) HttpAOSSResultPredicate: Checking if response is retryable
24/12/08 13:50:02.118 INFO {QID=****} (main) HttpAOSSResultPredicate: Check retryable response result: true
24/12/08 13:50:02.118 ERROR {QID=****} (main) FlintRetryOptions: Attempt to execute request failed: ExecutionAttemptedEvent[result=HTTP/1.1 400 Bad Request [content-type: application/json; charset=UTF-8, content-length: 423, x-envoy-upstream-service-time: 134, date: Sun, 08 Dec 2024 13:50:00 GMT, server: aoss-amazon-m, x-request-id: f249d2d6-e137-949e-acb6-97291707981b] shaded.flint.org.apache.http.entity.BufferedHttpEntity@5f3e07b5, exception=null]
24/12/08 13:50:04.125 WARN {QID=****} (main) FlintRetryOptions: Retrying failed request at #2

...

24/12/08 13:50:04.270 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Checking if status code is retryable: 400
24/12/08 13:50:04.271 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Status code 400 check result: false
24/12/08 13:50:04.271 INFO {QID=****} (main) HttpAOSSResultPredicate: Checking if response is retryable
24/12/08 13:50:04.271 INFO {QID=****} (main) HttpAOSSResultPredicate: Check retryable response result: true
24/12/08 13:50:04.271 ERROR {QID=****} (main) FlintRetryOptions: Attempt to execute request failed: ExecutionAttemptedEvent[result=HTTP/1.1 400 Bad Request [content-type: application/json; charset=UTF-8, content-length: 423, x-envoy-upstream-service-time: 134, date: Sun, 08 Dec 2024 13:50:00 GMT, server: aoss-amazon-m, x-request-id: f249d2d6-e137-949e-acb6-97291707981b] shaded.flint.org.apache.http.entity.BufferedHttpEntity@1229de5e, exception=null]
24/12/08 13:50:08.258 WARN {QID=****} (main) FlintRetryOptions: Retrying failed request at #3
24/12/08 13:50:08.362 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Checking if status code is retryable: 400
24/12/08 13:50:08.363 INFO {QID=****} (main) HttpStatusCodeResultPredicate: Status code 400 check result: false
24/12/08 13:50:08.363 INFO {QID=****} (main) HttpAOSSResultPredicate: Checking if response is retryable
24/12/08 13:50:08.363 INFO {QID=****} (main) HttpAOSSResultPredicate: Check retryable response result: true
24/12/08 13:50:08.363 ERROR {QID=****} (main) FlintRetryOptions: Attempt to execute request failed: ExecutionAttemptedEvent[result=HTTP/1.1 400 Bad Request [content-type: application/json; charset=UTF-8, content-length: 423, x-envoy-upstream-service-time: 134, date: Sun, 08 Dec 2024 13:50:00 GMT, server: aoss-amazon-m, x-request-id: f249d2d6-e137-949e-acb6-97291707981b] shaded.flint.org.apache.http.entity.BufferedHttpEntity@a56d443, exception=null]
24/12/08 13:50:08.434 ERROR {QID=****} (main) CustomLogging: {"timestamp":1733665808434,"severityText":"ERROR","severityNumber":17,"body":{"message":"OpenSearch Operation failed.","statusCode":400},"attributes":{"domainName":"opensearch","clientId":"UNKNOWN","exception.type":"org.opensearch.OpenSearchStatusException","exception.message":"OpenSearch exception [type=resource_already_exists_exception, reason=Update to the indices [****] failed due to either concurrent update or deletion of the indices]"}}
OpenSearchStatusException[OpenSearch exception [type=resource_already_exists_exception, reason=Update to the indices [****] failed due to either concurrent update or deletion of the indices]]
	at org.opensearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:207)
	at org.opensearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2228)
	at org.opensearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2205)
	at org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1924)

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.

@seankao-az seankao-az self-assigned this Nov 27, 2024
@seankao-az seankao-az changed the title Add retryable response message Add retryable HTTP response messages Nov 27, 2024
@seankao-az seankao-az force-pushed the retry-update-mapping branch 3 times, most recently from 3b6e39b to 54c426f Compare November 27, 2024 03:36
@seankao-az seankao-az changed the title Add retryable HTTP response messages Add retryable AOSS HTTP response Dec 4, 2024
@seankao-az seankao-az force-pushed the retry-update-mapping branch from 309bcd7 to b9e5aad Compare December 4, 2024 23:37
@seankao-az seankao-az marked this pull request as ready for review December 4, 2024 23:37
@seankao-az seankao-az added enhancement New feature or request 0.7 labels Dec 4, 2024
@seankao-az seankao-az force-pushed the retry-update-mapping branch from b9e5aad to bd43c66 Compare December 4, 2024 23:43
@seankao-az seankao-az requested a review from dai-chen December 4, 2024 23:50
@seankao-az seankao-az requested a review from dai-chen December 5, 2024 01:15
@dai-chen
Copy link
Collaborator

dai-chen commented Dec 5, 2024

Shall we backport to 0.6? Is 0.6.1 the next release?

@seankao-az
Copy link
Collaborator Author

yes

@seankao-az seankao-az force-pushed the retry-update-mapping branch from e6b4972 to 1942b80 Compare December 9, 2024 18:05
@seankao-az
Copy link
Collaborator Author

seankao-az commented Dec 9, 2024

rebased for the sbt error in CI
there's one new commit before that: 1942b80
also updated description with test log

@seankao-az seankao-az requested a review from dai-chen December 9, 2024 18:13
@seankao-az seankao-az merged commit 5720e54 into opensearch-project:main Dec 9, 2024
4 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 9, 2024
* add retryable response message

Signed-off-by: Sean Kao <[email protected]>

* check retryable response only if 400

Signed-off-by: Sean Kao <[email protected]>

* add handler for aoss only

Signed-off-by: Sean Kao <[email protected]>

* edit comment

Signed-off-by: Sean Kao <[email protected]>

* bugfix: aoss result predicate not used

Signed-off-by: Sean Kao <[email protected]>

---------

Signed-off-by: Sean Kao <[email protected]>
(cherry picked from commit 5720e54)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 10, 2024
* add retryable response message

Signed-off-by: Sean Kao <[email protected]>

* check retryable response only if 400

Signed-off-by: Sean Kao <[email protected]>

* add handler for aoss only

Signed-off-by: Sean Kao <[email protected]>

* edit comment

Signed-off-by: Sean Kao <[email protected]>

* bugfix: aoss result predicate not used

Signed-off-by: Sean Kao <[email protected]>

---------

Signed-off-by: Sean Kao <[email protected]>
(cherry picked from commit 5720e54)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
seankao-az pushed a commit that referenced this pull request Dec 10, 2024
* add retryable response message



* check retryable response only if 400



* add handler for aoss only



* edit comment



* bugfix: aoss result predicate not used



---------


(cherry picked from commit 5720e54)

Signed-off-by: Sean Kao <[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>
kenrickyap pushed a commit to Bit-Quill/opensearch-spark that referenced this pull request Dec 11, 2024
* add retryable response message

Signed-off-by: Sean Kao <[email protected]>

* check retryable response only if 400

Signed-off-by: Sean Kao <[email protected]>

* add handler for aoss only

Signed-off-by: Sean Kao <[email protected]>

* edit comment

Signed-off-by: Sean Kao <[email protected]>

* bugfix: aoss result predicate not used

Signed-off-by: Sean Kao <[email protected]>

---------

Signed-off-by: Sean Kao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants