fix(ingest): recover WAL segments shipped at shutdown - #1213
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Oct 2, 2026 in 8m 12s
Confidence 4/5 · No issues found
🟢 Confidence 4/5 · likely safe to merge
quality 100/100 · no findings · tests covered · risk high
Adds a retired/ owner marker so shutdown-shipped WAL segments are claimable at any age, makes a sealed segment count as exported when the cursor sits at its end, and keeps an owner claimable while recovery leaves segments behind. The logic reads correctly and is covered by new tests.
retire()writesretired/<owner>before dropping the heartbeat;stale_ownerslists itWalLane::is_behindlets a cursor parked at a sealed segment's end count as exportedrecover_orphanskeeps the owner claimable when segments are left behind
What was checked
is_behindcannot skip unexported data: the parked case requirescursor.offset >= file_lenandseq < active_seq, whichseal()publishes only after the outgoing segment is final (`telemetry.rs:1…- No data loss on recovery: at boot
cursor.seq < active_seqor the appended segment is sealed then shipped, so recovered frames are always in a segmentis_behindreports as owed - Keeping the owner leaves the claim marker, so a second retry waits out
CLAIM_LEASE(30 min) and the lifecycle rule ends the retry loop for permanently unplaceable lanes
ea5f8ef · Updated on every push. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading