Skip to content

Sealed log rebuild must not drop the tail on mid-file CRC - #11

Merged
jaredLunde merged 3 commits into
beyondoss:mainfrom
paulocsanz:dst/sealed-crc-failstop
Aug 14, 2026
Merged

Sealed log rebuild must not drop the tail on mid-file CRC#11
jaredLunde merged 3 commits into
beyondoss:mainfrom
paulocsanz:dst/sealed-crc-failstop

Conversation

@paulocsanz

Copy link
Copy Markdown
Contributor

A sealed file with a missing footer is scanned record-by-record. The first CRC miss used to break and return Ok, so every key after a flipped byte vanished from the index. Two commits: tests that fail on main, then the fix.

  • scan_sealed treats a fully-framed mid-file CRC miss as CrcMismatch.
  • rebuild_from_records uses the same fail-stop. Active-file replay still truncates (that is a torn write).

A fully-framed record with a bad CRC in a sealed log is bitrot, not a torn
tail. scan_sealed currently copies rebuild_from_records and returns the
prefix; the test requires CrcMismatch.
rebuild_from_records used to break and return Ok, dropping every key after
the flipped byte. Active-file replay still truncates (that is a torn write).
@jaredLunde
jaredLunde merged commit 48aee9e into beyondoss:main Aug 14, 2026
5 checks passed
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.

2 participants