mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-24 00:53:01 +00:00
3f812fa9a70fc1b8baa8d7fa2bd8d3128976ebb5
The first pass at compaction just kicked a thread any time we added a segment that brought its level's count over the limit. Tasks could create dirty items and write level0 segments regardless of the progress of compaction. This ties the writing rate to compaction. Writers have to wait to hold a transaction until the dirty item count is under a segment and there's no level0 segments. Usualy more level0 segments are allowed but we're aggressively pushing compaction, we'll relax this later. This also more forcefully ensures that compaction makes forward progress. We kick the compaction thread if we exceed the level count, wait for level0 to drain, or successfully complete a compaction. We tweak scoutfs_manifest_next_compact() to return 0 if there's no compaction work to do so the the compaction thread can exit without triggering another. For clarity we also kick off a sync after compaction so that we don't sit around with a dirty manifest until the next sync. This may not be wise. Signed-off-by: Zach Brown <zab@versity.com>
Description
No description provided
6.8 MiB
Languages
C
86.3%
Shell
10%
Roff
2.5%
TeX
0.8%
Makefile
0.4%