Skip to content

resize FSST compressor buffer to be large enough for largest string#6676

Merged
a10y merged 1 commit intodevelopfrom
fsst-compressor-nopanic
Feb 25, 2026
Merged

resize FSST compressor buffer to be large enough for largest string#6676
a10y merged 1 commit intodevelopfrom
fsst-compressor-nopanic

Conversation

@a10y
Copy link
Contributor

@a10y a10y commented Feb 25, 2026

Summary

Closes: #6517

In the past, we've used a pre-allocated 16MB buffer for compressing FSST strings, assuming that the largest compressed string will always be able to fit inside of this limit.

However, in practice sometimes that is not the case, such as in the linked issue.

To avoid panics, we will resize the compressed buffer if we encounter a string that may end up exceeding it. Since we are adaptive now and most strings are small, we shrink the default buffer size from 16MB -> 1MB.

Testing

I add a unit test to demonstrate FSST compressing a string that requires resizing the buffer.

Signed-off-by: Andrew Duffy <andrew@a10y.dev>
@a10y a10y force-pushed the fsst-compressor-nopanic branch from e03bc2e to 8304ea8 Compare February 25, 2026 16:50
@a10y a10y requested review from danking and robert3005 February 25, 2026 16:51
@a10y a10y added the changelog/fix A bug fix label Feb 25, 2026
@lwwmanning lwwmanning changed the title resive FSST compressor buffer to be large enough for largest string resize FSST compressor buffer to be large enough for largest string Feb 25, 2026
@a10y a10y merged commit 8a9185a into develop Feb 25, 2026
57 of 58 checks passed
@a10y a10y deleted the fsst-compressor-nopanic branch February 25, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compressor panics with: output buffer sized too small

2 participants