-
Notifications
You must be signed in to change notification settings - Fork 132
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
Fixed LeafReaders casting errors to SegmentReaders when segment repli… #1808
Merged
+134
−6
Conversation
This file contains 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
navneet1v
requested review from
heemin32,
VijayanB,
vamshin,
jmazanec15,
naveentatikonda,
junqiu-lei,
martin-gaievski,
ryanbogan and
luyuncheng
as code owners
July 10, 2024 01:02
navneet1v
force-pushed
the
main
branch
2 times, most recently
from
July 10, 2024 01:05
2ed2d65
to
dd98588
Compare
The BWC test will be fixed by this PR: #1811 |
navneet1v
force-pushed
the
main
branch
5 times, most recently
from
July 16, 2024 17:41
a7b424d
to
1886dfa
Compare
…cation is enabled during search Signed-off-by: Navneet Verma <[email protected]>
jmazanec15
approved these changes
Jul 16, 2024
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.
LGTM thanks!
vibrantvarun
approved these changes
Jul 16, 2024
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.
LGTM
navneet1v
added
the
Bug Fixes
Changes to a system or product designed to handle a programming bug/glitch
label
Jul 16, 2024
naveentatikonda
approved these changes
Jul 16, 2024
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Jul 16, 2024
…cation is enabled during search (#1808) Signed-off-by: Navneet Verma <[email protected]> (cherry picked from commit 62cdbb6)
navneet1v
added a commit
that referenced
this pull request
Jul 16, 2024
…cation is enabled during search (#1808) Signed-off-by: Navneet Verma <[email protected]>
ryanbogan
pushed a commit
to ryanbogan/k-NN
that referenced
this pull request
Jul 16, 2024
…cation is enabled during search (opensearch-project#1808) Signed-off-by: Navneet Verma <[email protected]>
navneet1v
added a commit
that referenced
this pull request
Jul 16, 2024
…cation is enabled during search (#1808) (#1836) Signed-off-by: Navneet Verma <[email protected]> Co-authored-by: Navneet Verma <[email protected]>
naveentatikonda
pushed a commit
to naveentatikonda/k-NN
that referenced
this pull request
Jul 20, 2024
…cation is enabled during search (opensearch-project#1808) (opensearch-project#1836) Signed-off-by: Navneet Verma <[email protected]> Co-authored-by: Navneet Verma <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
Fixed LeafReaders casting errors to SegmentReaders when segment replication is enabled during search
Root Cause
When Segment replication is enabled, then for replicas IndexReaders are opened via passing directory path, rather than using IndexWriters to Open the IndexReaders. This happens because replicas don't take write for Segment Replication. To ensure that soft deletes are applied on replicas too, seg-rep engine uses SoftDeletesDirectoryReaderWrapper(which extends the FilterDirectoryReader) to open the directory with soft deletes field. During search when the LeafReader for this directory is provided the SegmentReader gets wrapped into different readers like SoftDeletesFilterCodecReader or SoftDeletesFilterLeafReader. So in order to get SegmentReader we need unwrap the reader properly. Here, the idea is first we unwrap the Reader via FilterLeafReader and if the instance is of FilterCodecReader(base class for SoftDeletesFilterCodecReader), we need another round of unwrapping via FilterCodecReader to get SegmentReader. If we don't do this kind of unwrapping then during query we get cast exceptions on query on replicas with deletes in segment replication cases. We are using a helper function from OpenSearch Core to do the same.
Future Improvement:
Issues Resolved
#1807
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.