-
Notifications
You must be signed in to change notification settings - Fork 283
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
Fix NPE getting metaFields from mapperService on a close index request #4497
Fix NPE getting metaFields from mapperService on a close index request #4497
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4497 +/- ##
==========================================
- Coverage 65.21% 65.21% -0.01%
==========================================
Files 313 313
Lines 22047 22053 +6
Branches 3559 3561 +2
==========================================
+ Hits 14378 14381 +3
- Misses 5895 5897 +2
- Partials 1774 1775 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, thank you fixing this!
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4497-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 34da6e86fbcdaf2b87a3dadf33e1c53e425b280e
# Push it to GitHub
git push --set-upstream origin backport/backport-4497-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x Then, create a pull request where the |
Creating a manual backport |
opensearch-project#4497) Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit 34da6e8)
Description
Fixes a NullPointerException that occurs on a Closed index request. This fixes an issue seen after the merge of #4370 which made a change to get the list of metaFields from the mapperService in core. On close index requests,
indexService.mapperService()
can return null so the call toindexService.mapperService().getMetadataFields()
throws an NPE.mapperService
would benull
because needsMapperService would return false on closed index.This fix checks for Close index requests and handles the scenario accordingly. Closed indices are not searchable so there's no need to have a list of metaFields for a closed index.
Ref: https://opensearch.org/docs/latest/api-reference/index-apis/close-index/
Bug fix
Issues Resolved
Check List
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.