-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Intra-L0 compaction reduces usage of trivial move during loads in key order #10075
Comments
@ajkr has an idea to group L0 files into logical sorted runs and do stalling control, compaction picking, etc, based on that. But I think it is not trivial to implement. I can't think about an easier solution. Not sure whether Andrew has an idea. |
@ajkr I think about it more. If only doing it for L0 stalling, it might not be that hard. We just group L0 files based on smallest keys, largest keys and seqno, and update the stall triggering condition based on number of groups. L0->L0 compaction might be a little bit harder but still the code can be limited to the compaction component. This approach will create impacts not only for fillseq, but also bulkloading files that for some reasons would be placed in L0. Of course, we don't have bandwidth to do it now, but @ajkr would this approach make sense? |
Yes it makes sense. |
Great. I think there is opportunity to do interesting work here on the path towards mullet compaction -- tiered for the smaller levels and leveled for the rest. |
Prior to intra-L0 compaction when db_bench --benchmarks=fillseq is run with leveled compaction there was no compaction, only trivial moves. I can reproduce that using RocksDB versions 4.1 or 5.1.4. But in v6 once there are a few stalls then some intra-L0 compaction occurs and at that point some compaction is used in place of trivial move. This is related to issue 9423 and possibly to issue 10082.
While the analysis above is based on correlation rather than causation. I also ran tests using version 6.28.2 as-is and then hacked where the hack does: disables intra-L0 compaction, disables dynamic resizing of per-level targets. Then I ran fillseq and the as-is binary gets some trivial move and some compaction while the hacked version only has trivial moves.
Other things that I see:
A command line is:
Compaction IO stats from test end for the as-is binary show that some compaction is used:
Compaction IO stats from test end for the hacked binary show that only trivial move is used:
Perf results from test end:
The text was updated successfully, but these errors were encountered: