Closed divijvaidya closed 1 year ago
LGTM
What was the impact to OpenSearch users due to this bug? Would they sometimes hit this exception, under specific circumstances? Always hit it? During indexing (maybe merging, which might decompress stored fields) or searching (when also retrieving stored fields)?
Motivation
The current implementation of ZstdBufferDecompressingStream fails with
com.github.luben.zstd.ZstdIOException: Unknown frame descriptor
when the interface is used with a ByteBuffer which is backed by an array which is shared with other ByteBuffers. This is a bug in the implementation where we assume that the ByteBuffer represents the view of the entire backing array.Change
Change the implementation to specifically use the array represented by the bytebuffer view instead of the entire backing array.
Testing
Added a test case which fails prior to the change and passes after it.