Skip to content

flush: bound unflushed data age to 30 s - #131

Merged
jaredLunde merged 1 commit into
mainfrom
jared/dirty-age-flush
Nov 7, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
jared/dirty-age-flush

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

Bounds how long written data can stay out of S3. Before: only the 1024-block threshold (or sleep/detach) uploaded a running export, and the 5 s timer was never armed by writes. A hard node death lost every write since the last upload.

Now: the write path signals the scheduler on each clean-to-dirty edge (once per edge), the scheduler arms a one-shot 30 s timer, and on fire with dirty blocks it takes the existing flush branch (same atomic cut, flush lock, semaphore, backoff, compaction). Clean, deleted (shutdown or purge abort) and manual-mode exports upload nothing.

Tests (fail without the change): sub-threshold write uploads within the bound; export deleted before the bound uploads nothing; manual mode no timer; S3 failure at the bound goes through backoff.

Measured against MinIO, 4 KiB random writes, n=225 and 1674 writes overlapping flushes: write p50 29 us -> 219 us, p95 88 us -> 3 ms during a flush on the 32-block hot set; max pause about 10 ms (rotation cut). 2 PUTs per flush without compaction.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WpMBiw38GkJFe49jfZowsH

… dirty

Below the 1024-block threshold nothing uploaded a running export, so a hard
node death lost every write since the last threshold flush, with no time
bound. The write path now signals the scheduler on each clean-to-dirty edge;
the scheduler arms a one-shot 30 s timer and, when it fires with dirty blocks,
runs the ordinary flush branch (same atomic cut, backoff, semaphore).
Clean, deleted and manual-mode exports upload nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpMBiw38GkJFe49jfZowsH
@jaredLunde
jaredLunde merged commit 2d92ea6 into main Nov 7, 2026
25 checks passed
@jaredLunde
jaredLunde deleted the jared/dirty-age-flush branch November 7, 2026 08:59
@jaredLunde

Copy link
Copy Markdown
Contributor Author

Added up to 5 s of early-only jitter to the dirty-age deadline (25-30 s). Cut lock hold, 64 exports: simultaneous p50 2.4-4.0 ms / p95 16-20 ms / max 43-73 ms; spread p50 0.38 ms / p95 2.8-4.4 ms. One export alone: p50 0.3-0.46 ms, max 1.0 ms. The earlier 3-10 ms write latency during a flush is promote-copy and CPU contention, not the lock.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WpMBiw38GkJFe49jfZowsH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant