Add startup WAL truncation and optional checkpoint gaps #122
No reviewers
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp!122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/svd-dev-imap-mailmind-mcp-118-cap-the-wal-file-beside-li-408d2345"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Attempt a writer-only startup checkpoint with a two-second timeout, preserve checkpoint counts in JSON logs, and continue when busy. Add validated, disabled-by-default quiet gaps shared across accounts, backfill batches, message embedding, and attachment embedding.
Report WAL bytes in mail_status, print checkpoint settings in mailmind check, and document Litestream limitations in deployment comments and example configuration.
Validation: make check passed with 794 tests passed and 8 skipped, including lint, typing, and audit. Source distribution and wheel builds passed.
Closes #118
Co-Authored-By: gpt-6.1-sol noreply@openai.com
Litestream reproduction (spec verification step)
Run on the operator's host on 2026-11-02 in the
0.8.1image with Litestream 0.3.13 (file replica, debug logging), the #91 writer at 100-row commits for 90 s, 30,000-row base, WAL truncated to 0 before each phase. The gap is the mechanismStore.quietapplies: after every 20 commits the writer holds no transaction and issues no write for 2 s. The writer is the only writer in the container, so this is the same condition the lock gives the sync process.Gap high-water is 0.05 times the no-gap high-water. The acceptance bound is 0.2. Pass.
WAL size every 10 s, MB. No gap: 0, 89, 178, 269, 360, 451, 536, 624, 713, 797. Gap: 0, 27, 27, 37, 37, 37, 37, 40, 40, 40.
Cost of the gap at these settings: 36 s of 90 s with no writes, so throughput fell to 360 commits from 573. Writer latency was unchanged (p50 133 ms against 125 ms, max 1.0 s against 3.0 s).
Not covered here: the startup truncate on the live pod. Check the sync container's
startup checkpointlog line showsbusy: falseafter the next rollout.