Skip to content

Conversation

@nibix
Copy link
Contributor

@nibix nibix commented Oct 28, 2025

Description

This is a minor fix in the "explicit index resolution API" feature recently introduced in #18523. Tests in the security plugin showed that actions extending TransportSingleShardAction could throw exceptions when the resolveIndices() method was called.

Originally, the resolveIndices() method of TransportSingleShardAction was implemented with concreteSingleIndex(), which however can throw exceptions for validation issues.

As throwing exceptions is not suitable for the intended meta-data use, this was moved to concreteResolvedIndices(). This MIGHT return a super-set of the indices of concreteSingleIndex() when the latter would throw an exception. This is for the intended purposes of resolveIndices() however acceptable.

Check List

  • Functionality includes testing. (via security plugin)

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.

Originally, the resolveIndices() method of TransportSingleShardAction was implemented with concreteSingleIndex(), which however can throw exceptions for validation issues.

As throwing exceptions is not suitable for the intended meta-data use, this was moved to concreteResolvedIndices(). This MIGHT return a super-set of the indices of concreteSingleIndex() when the latter would throw an exception. This is for the intended purposes of resolveIndices() however acceptable.

Signed-off-by: Nils Bandener <nils.bandener@eliatra.com>
@nibix nibix requested a review from a team as a code owner October 28, 2025 20:57
@github-actions
Copy link
Contributor

✅ Gradle check result for acfe562: SUCCESS

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.20%. Comparing base (8dd1286) to head (acfe562).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...pport/single/shard/TransportSingleShardAction.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19804      +/-   ##
============================================
+ Coverage     73.12%   73.20%   +0.07%     
- Complexity    71099    71147      +48     
============================================
  Files          5754     5754              
  Lines        325296   325298       +2     
  Branches      47052    47052              
============================================
+ Hits         237868   238120     +252     
+ Misses        68282    68044     -238     
+ Partials      19146    19134      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cwperks
Copy link
Member

cwperks commented Oct 29, 2025

We do not use resolveToConcreteSingleIndex() here because it might throw exceptions for validation errors.

What are these validation errors?

Is it the one from here? In what test instances is that hit?

@nibix
Copy link
Contributor Author

nibix commented Oct 29, 2025

Is it the one from here? In what test instances is that hit?

Yes, it is. It actually makes multi tenancy tests in the security plugin fail, as the special handling for MT sometimes makes requests refer to "virtual", non-existant indices or aliases.

@cwperks cwperks merged commit a036313 into opensearch-project:main Oct 29, 2025
36 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants