-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[BUG] LeafReader removes all SubReaderWrappers incase IndexWriter encounters a non aborting Exception #19851
Description
Describe the bug
In OpenSearch, during recovery flow, documents are queried using a DirectoryReader to be replayed as operations during translog replay. Now incase OpenSearch IndexWriter encounters any non aborted exception, underlying segments can contain both hard and soft deleted documents. In this case, OpenSearch unwraps a LeafReader and uses it for querying documents which are replayed as operation for Translog replay.
Since this unwrapping process will remove all wrappers from LeafReader, it becomes an issue for features like DerivedSource where we rely on a DerivedSourceDirectoryReader wrapper over LeafReader to extract source for a document. For Derived Source enabled index, with wrapper removed, a MissingHistoryOperationsException will be thrown during Translog replay as source field will be null for the documents, failing recovery.
Related component
Indexing, Search
Expected behavior
DirectoryReader should not unwrap LeafReader incase IndexWriter encounters a non aborting Exception
Additional Details
Metadata
Metadata
Assignees
Labels
Type
Projects
Status