-
Notifications
You must be signed in to change notification settings - Fork 141
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 index not found reported as server error bug #1353
Fix index not found reported as server error bug #1353
Conversation
Signed-off-by: Chen Dai <[email protected]>
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.
Maybe add an integration test which proves the fix in the end-to-end flow?
Signed-off-by: Chen Dai <[email protected]>
Yes, just found a place to add it. |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1353 +/- ##
=========================================
Coverage 98.38% 98.38%
Complexity 3693 3693
=========================================
Files 343 343
Lines 9106 9107 +1
Branches 585 585
=========================================
+ Hits 8959 8960 +1
Misses 142 142
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
* Capture IndexNotFoundException and re-throw directly Signed-off-by: Chen Dai <[email protected]> * Add IT Signed-off-by: Chen Dai <[email protected]> --------- Signed-off-by: Chen Dai <[email protected]> (cherry picked from commit 76a8d29)
* Capture IndexNotFoundException and re-throw directly Signed-off-by: Chen Dai <[email protected]> * Add IT Signed-off-by: Chen Dai <[email protected]> --------- Signed-off-by: Chen Dai <[email protected]> (cherry picked from commit 76a8d29)
* Capture IndexNotFoundException and re-throw directly Signed-off-by: Chen Dai <[email protected]> * Add IT Signed-off-by: Chen Dai <[email protected]> --------- Signed-off-by: Chen Dai <[email protected]> (cherry picked from commit 76a8d29) Co-authored-by: Chen Dai <[email protected]>
* Capture IndexNotFoundException and re-throw directly Signed-off-by: Chen Dai <[email protected]> * Add IT Signed-off-by: Chen Dai <[email protected]> --------- Signed-off-by: Chen Dai <[email protected]> (cherry picked from commit 76a8d29) Co-authored-by: Chen Dai <[email protected]>
Description
IndexNotFoundException
thrown from OpenSearch get index mapping API is treated as server error. This caused breaking behavior as reported in issue below. More importantly, this may cause false alarm if monitoring logic on SQL plugin.Root Cause
Due to security concern, we switched from OpenSearch's
ClusterService.getIndexMapping()
to our currentOpenSearchNodeClient.getIndexMapping()
. OpenSearchNodeClient captures every exception thrown from underlying OpenSearch API, includingIndexNotFoundException
, and wrap it byIllegalStateException
. On the high level,isClientError()
determines if this is a client error on IllegalStateException instead of the IndexNotFoundException wrapped inside.Quick Fix
resolver
field andmockNodeClient()
handyIssues Resolved
#851
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.