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

Wait after create index complete #949

Merged

Conversation

seankao-az
Copy link
Collaborator

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

Description

Add a new spark config spark.datasource.flint.request.completionDelayMillis to set a wait time after OpenSearch index creation is complete.
It's set to 2000 if using aoss service by default, otherwise it's 0.

Related Issues

Testing

Create index with default config

24/11/26 23:49:04 INFO FlintOpenSearchClient: Creating Flint index flint_myglue_test_default_no_wait_time with metadata FlintMetadata(...)
24/11/26 23:49:04 INFO FlintOpenSearchClient: Creating Flint index flint_myglue_test_default_no_wait_time
24/11/26 23:49:04 INFO RetryableHttpAsyncClient: Building retryable http async client with options: FlintRetryOptions{maxRetries=3, retryableStatusCodes=429,502, retryableExceptionClassNames=Optional.empty}
24/11/26 23:49:04 INFO HttpStatusCodeResultPredicate: Checking if status code is retryable: 200
24/11/26 23:49:04 INFO HttpStatusCodeResultPredicate: Status code 200 check result: false
24/11/26 23:49:04 INFO FlintOpenSearchIndexMetadataService: Updating Flint index flint_myglue_test_default_no_wait_time with metadata FlintMetadata(...)
24/11/26 23:49:04 INFO RetryableHttpAsyncClient: Building retryable http async client with options: FlintRetryOptions{maxRetries=3, retryableStatusCodes=429,502, retryableExceptionClassNames=Optional.empty}
24/11/26 23:49:04 INFO HttpStatusCodeResultPredicate: Checking if status code is retryable: 200
24/11/26 23:49:04 INFO HttpStatusCodeResultPredicate: Status code 200 check result: false

Create index with config --conf spark.datasource.flint.request.completionDelayMillis=2000

24/11/26 23:50:20 INFO FlintOpenSearchClient: Creating Flint index flint_myglue_test_default_with_wait_time with metadata FlintMetadata(...)
24/11/26 23:50:20 INFO FlintOpenSearchClient: Creating Flint index flint_myglue_test_default_with_wait_time
24/11/26 23:50:20 INFO RetryableHttpAsyncClient: Building retryable http async client with options: FlintRetryOptions{maxRetries=3, retryableStatusCodes=429,502, retryableExceptionClassNames=Optional.empty}
24/11/26 23:50:20 INFO HttpStatusCodeResultPredicate: Checking if status code is retryable: 200
24/11/26 23:50:20 INFO HttpStatusCodeResultPredicate: Status code 200 check result: false
24/11/26 23:50:22 INFO FlintOpenSearchIndexMetadataService: Updating Flint index flint_myglue_test_default_with_wait_time with metadata FlintMetadata(...)
24/11/26 23:50:22 INFO RetryableHttpAsyncClient: Building retryable http async client with options: FlintRetryOptions{maxRetries=3, retryableStatusCodes=429,502, retryableExceptionClassNames=Optional.empty}
24/11/26 23:50:22 INFO HttpStatusCodeResultPredicate: Checking if status code is retryable: 200
24/11/26 23:50:22 INFO HttpStatusCodeResultPredicate: Status code 200 check result: false

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 26, 2024
@seankao-az seankao-az added 0.7 enhancement New feature or request labels Nov 26, 2024
@seankao-az seankao-az marked this pull request as ready for review November 27, 2024 00:25
Copy link
Collaborator

@noCharger noCharger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the consideration of constant wait_after VS retry?

@seankao-az
Copy link
Collaborator Author

seankao-az commented Dec 4, 2024

what's the consideration of constant wait_after VS retry?

Actually we need both. AOSS internal workflow will also conflict with our update mapping call, and in that case our mapping call will just fail. We can use backoff retry as main method to avoid conflict, and wait_after as a configurable adjustment in production if we consistently see conflict happening within x seconds of index creation.

@seankao-az
Copy link
Collaborator Author

confirmed working in gamma

@seankao-az seankao-az merged commit 62b6c5f into opensearch-project:main Dec 6, 2024
5 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 6, 2024
* wait after create index complete

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

* add default wait time for aoss

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

---------

Signed-off-by: Sean Kao <[email protected]>
(cherry picked from commit 62b6c5f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
seankao-az pushed a commit that referenced this pull request Dec 6, 2024
* wait after create index complete



* add default wait time for aoss



---------


(cherry picked from commit 62b6c5f)

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
* wait after create index complete

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

* add default wait time for aoss

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.

3 participants