aboutsummaryrefslogtreecommitdiffstats
path: root/research/experiments/013-parallel-syncs/variants.py
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-27 14:46:31 +0100
committereunhhu <[email protected]>2026-09-27 14:46:31 +0100
commitaea3f640ea59d91f7ca9b193acfcc3e26740318b (patch)
tree5329bdb7ea61881c4f73d5f646e2ff1511d95a40 /research/experiments/013-parallel-syncs/variants.py
parent87480ce170895f841c40930ce24a7a026646ae14 (diff)
downloadpure-aea3f640ea59d91f7ca9b193acfcc3e26740318b.tar.gz
pure-aea3f640ea59d91f7ca9b193acfcc3e26740318b.zip
Give a compacted file the zeros of its whole cycle (085)
Commits grew the tree store's tail 256 KiB at a time, each growth a sync that also committed the ext4 journal for the new size and blocks. A file installed by compaction now carries written zeros up to where the next compaction will come (4 x live + slack, plus a commit's margin), capped at the size of the file it replaces, so a store never takes more space than before and shrinks when its live data does. The cycle's commits then only overwrite blocks the file has. Store commits: 317.5 -> 385.5 a second, ext4 journal commits 109 -> 45 for 4,000 commits; durable app posts +5.3%, their p99 the same within this SD card's noise. The new cycles test keeps sizes still between compactions once the live data is whole, and shows the file shrinking with it.
Diffstat (limited to 'research/experiments/013-parallel-syncs/variants.py')
-rw-r--r--research/experiments/013-parallel-syncs/variants.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/research/experiments/013-parallel-syncs/variants.py b/research/experiments/013-parallel-syncs/variants.py
index 2c48ab6..ee49d2a 100644
--- a/research/experiments/013-parallel-syncs/variants.py
+++ b/research/experiments/013-parallel-syncs/variants.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python3
"""Where the tree store's extra sync work goes (docs/research/084-parallel-syncs.md).
-Builds pure-serve with three stores from store/store-tree.c: as it is; with no
-compaction; and with no compaction and a 64 MiB tail written at creation (no
-tail growth during a run). Then durable score posts (64 connections), the
+Builds pure-serve with stores from store/store-tree.c: as it is; with no
+compaction; with no compaction and a 64 MiB tail written at creation (no tail
+growth during a run); and as before 085, compacted files getting only 256 KiB
+of zeros and commits growing the tail as they need it. Then durable score posts (64 connections), the
builds in rotated order per round, each on a fresh store after 64 warm-up
posts. Prints one JSON line per run and a summary.
"""
@@ -25,6 +26,9 @@ PATCHES = {
'no compaction': [('enum { COMPACT_SLACK = 1048576 };', 'enum { COMPACT_SLACK = 1 << 30 };')],
'no compaction, no growth': [('enum { COMPACT_SLACK = 1048576 };', 'enum { COMPACT_SLACK = 1 << 30 };'),
('TAIL_STEP = 262144', 'TAIL_STEP = 67108864')],
+ # Before 085: a compacted file got 256 KiB of zeros, and commits grew the tail as they needed it.
+ 'tail grown as commits need it': [('zero_fill(fd, head->end, cycle_end(head, replaced));',
+ 'zero_fill(fd, head->end, tail_end(head->end));')],
}