-
Notifications
You must be signed in to change notification settings - Fork 439
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: universal compaction condition #97
Conversation
Signed-off-by: Alex Chi <[email protected]>
I have another question. In Reduce Sorted Runs parts, RocksDB will compact at most
this PR
Full Output: pr.txt my impl similar to RocksDB:
Full Output: self.txt |
The reason I didn't merge this patch is that I don't fully understand why RocksDB produces that sequence -- I think we got the first few lines correct, but looking at the example, https://github.com/facebook/rocksdb/wiki/Universal-Style-Compaction-Example it allows > 8 tiers
before doing the compaction, which gives 29; while in my implementation, it gives 28 Looking at https://github.com/facebook/rocksdb/wiki/universal-compaction,
it also indicates the same -- even if it triggers at tier == 5, the number of tiers can stay at 5 in some conditions. so I'd like to reproduce their algorithm and check if it reduces write amplification (my intuition is yes b/c they do fewer compactions). |
after looking at it for a while, I assume it's a typo, though I suppose their example should be generated with some tools, but I couldn't figure out a reasonable logic for that 🤪 |
Signed-off-by: Alex Chi <[email protected]>
I've updated my implementation to take max_merge_with for reducing sorted runs and I'll merge the patch; meanwhile, I'll update the docs in another patch. Thanks for the suggestion anyways :) |
Signed-off-by: Alex Chi <[email protected]>
I also guess it's a typo. I asked it at mail channel, but no response. |
close #96
the original condition was not very correct and would produce larger write amplification, so we make it exactly the same as RocksDB in this PR. TODO: fix doc and tests.