Handle ResourceAlreadyExistsException in FlowFrameworkIndicesHandler#1378
Merged
dbwiddis merged 1 commit intoMay 6, 2026
Conversation
When multiple nodes attempt to create a system index simultaneously, the second request receives a ResourceAlreadyExistsException. This is not a true failure since the index exists, which is the desired state. Treat ResourceAlreadyExistsException (and its OpenSearchWrapperException variant) as a success condition in initFlowFrameworkIndexIfAbsent(), matching the pattern used by ML Commons' MLIndicesHandler. Resolves opensearch-project#1377 Signed-off-by: Daniel Widdis <widdis@gmail.com> Signed-off-by: Dan Widdis <widdisd@amazon.com>
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (25.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1378 +/- ##
============================================
- Coverage 78.38% 78.38% -0.01%
- Complexity 1306 1308 +2
============================================
Files 106 106
Lines 6015 6019 +4
Branches 640 641 +1
============================================
+ Hits 4715 4718 +3
+ Misses 1013 1012 -1
- Partials 287 289 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
owaiskazi19
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes a race condition in
FlowFrameworkIndicesHandler.initFlowFrameworkIndexIfAbsent()where concurrent index creation requests on a multi-node cluster can fail with a 400 BAD_REQUEST error.When two nodes simultaneously check
doesIndexExistMultitenant()and both getfalse, the secondCreateIndexRequestthrowsResourceAlreadyExistsException. Previously this was treated as a failure. Now it is treated as success, since the index exists (which is the desired state).This matches the pattern used by ML Commons'
MLIndicesHandler.Resolves #1377
Issues Resolved
Check List
--signoff