Skip to content

Zstd Compression Levels Can't Be Changed Across Different badger.Open() Calls #2178

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

Open
jody-frankowski opened this issue Mar 3, 2025 · 1 comment

Comments

@jody-frankowski
Copy link

Because the Zstd encoder is initialized only once for the whole program different compression level options (e.g. 1 or 19) aren't respected across different badger instances.

To Reproduce

badgerOptions := badger.DefaultOptions(db1)
badgerOptions = badgerOptions.WithCompression(options.ZSTD)
badgerOptions = badgerOptions.WithZSTDCompressionLevel(1)
db, _ := badger.Open(badgerOptions)

[...]

badgerOptions = badger.DefaultOptions(db2)
badgerOptions = badgerOptions.WithCompression(options.ZSTD)
badgerOptions = badgerOptions.WithZSTDCompressionLevel(19)
db, _ = badger.Open(badgerOptions) // This db instance will also have compression level 1
Copy link

linear bot commented Mar 3, 2025

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

No branches or pull requests

1 participant