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

rocksdb::CompactRangeOptions.change_level is not compatible with level_compaction_dynamic_level_bytes #2601

Open
2 tasks done
hotpxl opened this issue Oct 15, 2024 · 0 comments
Labels
bug type bug

Comments

@hotpxl
Copy link

hotpxl commented Oct 15, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

6b23c5a

Minimal reproduce step

Default configuration but with stats_dump_period_sec set (so you can see compaction stats) , redis-cli set a b, redis-cli compact.

What did you expect to see?

Because of how level_compaction_dynamic_level_bytes works, there should be only 1 compaction to L6 (the default bottom-most layer)

What did you see instead?

1 compaction on each layer and 2 compactions to L6

Anything Else?

I instrumented rocksdb code and this is because rocksdb::CompactRangeOptions.change_level is not compatible with level_compaction_dynamic_level_bytes.

When level_compaction_dynamic_level_bytes is set, set a b and compact will not compact to L1, it'll jump directly to the last layer (L6). And when change_level is set, it then moves this SST file from L6 back to L1.

Now when another periodic compaction comes along, it tries to move this file from L1->L2, L2->L3, ... This is why every layer has 1 compaction and the last layer has 2 compactions.

If you run a manual compaction at this time, since change_level is set, it'll move the SST file to L1 again, resulting in the same churn happening.

Obviously this is quite efficiently since these 2 options are trying to undo each other's work..

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@hotpxl hotpxl added the bug type bug label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug type bug
Projects
None yet
Development

No branches or pull requests

1 participant