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

[BUG] The configuration item rocksdb.compression cannot take effect #384

Closed
caipengbo opened this issue Nov 3, 2021 · 3 comments · Fixed by #395
Closed

[BUG] The configuration item rocksdb.compression cannot take effect #384

caipengbo opened this issue Nov 3, 2021 · 3 comments · Fixed by #395

Comments

@caipengbo
Copy link
Contributor

Kvrocks has a configuration item called rocksdb.compression, which is assigned to rocksdb::Options:
https://github.com/KvrocksLabs/kvrocks/blob/2e43741ddedc06f0376d71dc385e9d53a24b3204/src/storage.cc#L87

But Kvrocks calls rocksdb's built-in optimization function:
https://github.com/KvrocksLabs/kvrocks/blob/2e43741ddedc06f0376d71dc385e9d53a24b3204/src/storage.cc#L80

This function will set compression_per_level. Like the Rocksdb Wiki says, when options.compression_per_level is used, options.compression is ignored.

Rocksdb's built-in optimization function selects the best compression algorithm. So do we need to remove rocksdb.compression configuration item in Kvrocks?

@git-hulk
Copy link
Member

git-hulk commented Nov 3, 2021

Good catch, as OptimizeLevelStyleCompaction would use the lz4 first then the snappy if supported, but they're still some other compressions. So seems that we can NOT enable the OptimizeLevelStyleCompaction when the compression was explicitly specified, HDYT.

@caipengbo
Copy link
Contributor Author

OptimizeLevelStyleCompaction function also optimizes other parameters, such as write_buffer_size , max_bytes_for_level_base , and so on. But we'll overwrite these parameters later.

Maybe can we get rid of OptimizeLevelStyleCompaction, then set compression_per_level in kvrocks?

@git-hulk
Copy link
Member

git-hulk commented Nov 4, 2021

Looks fine for me

@ShooterIT ShooterIT linked a pull request Nov 19, 2021 that will close this issue
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 a pull request may close this issue.

2 participants