Skip to content

Skip refreshIndex in serverless mode to fix 404 on _refresh endpoint - #692

Merged
harshavamsi merged 3 commits into
opensearch-project:mainfrom
lawofcycles:fix/serverless-refresh-index
Feb 20, 2026
Merged

Skip refreshIndex in serverless mode to fix 404 on _refresh endpoint#692
harshavamsi merged 3 commits into
opensearch-project:mainfrom
lawofcycles:fix/serverless-refresh-index

Conversation

@lawofcycles

Copy link
Copy Markdown
Collaborator

Description

RestClient.refreshIndex(String) did not check for serverless mode, causing all Spark writes to OpenSearch Serverless to fail with a 404 error on the _refresh endpoint.

RestClient.refresh(Resource) was correctly updated in #586 to skip the refresh call in serverless mode, but RestClient.refreshIndex(String) is a separate method called from BulkProcessor.close() and was not updated. Since opensearch.batch.write.refresh defaults to true, every bulk write triggered this code path.

This change adds the same serverless mode check to refreshIndex(String).

Issues Resolved

Fixes #690

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.

Signed-off-by: Sotaro Hikita <bering1814@gmail.com>
@lawofcycles

lawofcycles commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator Author

Note: The Gradle Precommit CI job is expected to fail due to a dependency license SHA mismatch, which is unrelated to this PR and will be resolved by #688.

Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
@harshavamsi
harshavamsi merged commit 689ebe1 into opensearch-project:main Feb 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Serverless mode: writes fail with 404 on refresh endpoint

2 participants