[BUGFIX]Catch Merge IOException#3140
Open
luyuncheng wants to merge 7 commits intoopensearch-project:mainfrom
Open
[BUGFIX]Catch Merge IOException#3140luyuncheng wants to merge 7 commits intoopensearch-project:mainfrom
luyuncheng wants to merge 7 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: luyuncheng <luyuncheng@bytedance.com>
Signed-off-by: luyuncheng <luyuncheng@bytedance.com>
Signed-off-by: luyuncheng <luyuncheng@bytedance.com>
Signed-off-by: luyuncheng <luyuncheng@bytedance.com>
Signed-off-by: luyuncheng <luyuncheng@bytedance.com>
shatejas
reviewed
Mar 3, 2026
Comment on lines
133
to
+135
| } catch (Exception ex) { | ||
| log.error("Merge exception happened for field {}", fieldInfo.name, ex); | ||
| throw new IOException("Merge exception happened for field: " + fieldInfo.name, ex); |
Collaborator
There was a problem hiding this comment.
Its not a good idea to catch a generic exception and throw IOException. Can we catch a IOException and rethrow?
Comment on lines
-420
to
-422
| catch (const faiss::FaissException& e) { | ||
| std::cout << "====> query get faiss exception:" << e.what() << "\n"; | ||
| } |
Collaborator
There was a problem hiding this comment.
The change seems right but out out curiosity was the query returning empty response when faiss exception was thrown?
| permission java.lang.RuntimePermission "loadLibrary.opensearchknn_faiss_avx512_spr"; | ||
| permission java.net.SocketPermission "*", "connect,resolve"; | ||
| permission java.lang.RuntimePermission "accessDeclaredMembers"; | ||
| permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; |
Collaborator
There was a problem hiding this comment.
Can you explain how does it affect/what errors are seen if this is not present, was just curious?
Signed-off-by: Navneet Verma <navneev@amazon.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3140 +/- ##
============================================
- Coverage 82.43% 82.41% -0.02%
+ Complexity 3874 3872 -2
============================================
Files 418 418
Lines 14474 14475 +1
Branches 1851 1851
============================================
- Hits 11932 11930 -2
- Misses 1782 1786 +4
+ Partials 760 759 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Tejas Shah <shatejas@amazon.com>
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
#2529 we made faiss engine can abort. so we catch some exceptions.
BUGFIX1: Exception
but when there is some runtime exception in native io, like disk io exception, other runtime exceptions. it should be catch by
Lucene#ConcurrentMergeSchedulerk-NN/src/main/java/org/opensearch/knn/index/codec/nativeindex/NativeIndexWriter.java
Lines 115 to 136 in 7f19fa7
we need made runtime exception throw to lucene level which can be handled by
ConcurrentMergeScheduler#handleMergeExceptionin NativeIndexWriter.java#L134BUGFIX2: permission Access
In MergeAbortChecker we changed MergeThread accessibility in code:
k-NN/src/main/java/org/apache/lucene/index/MergeAbortChecker.java
Lines 33 to 42 in 7f19fa7
so we need add
suppressAccessChecksandaccessDeclaredMemberspermissioninto plugin-security.policyRelated Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff.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.