Skip to content
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 bug in ZstdBufferDecompressingStream when array backing ByteBuffer is shared #264

Merged
merged 1 commit into from
May 30, 2023

Conversation

divijvaidya
Copy link
Contributor

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.

@luben
Copy link
Owner

luben commented May 30, 2023

LGTM

@mikemccand
Copy link

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants