Commit 58db40c
committed
raftengine: document header-error-before-CRC ordering in applyHeaderStateOnSkip (claude #934 R1-F1)
R1-F1 was the only open finding across 8 review rounds, marked doc-
only with no safety impact. Add a comment in applyHeaderStateOnSkip
spelling out why header parse runs before the body-CRC compare:
- Both header-parse errors and CRC errors are equally fatal for the
skip path (snapshot file corruption) and both must propagate
without ever calling ApplySnapshotHeader.
- CRC compare stays AFTER the header parse so the TeeReader has
actually been drained when h.Sum32() is read; inverting the order
would let a CRC mismatch surface on a truncated body even when
the header was valid, muddying the operator-facing diagnostic.
- Matches the same ordering openAndRestoreFSMSnapshot uses, so
fallback paths see consistent error chains regardless of which
routine ran.
No code change; this is the only safe artifact of an audit comment.
Tests pass; lint clean.1 parent fc55c7b commit 58db40c
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
538 | 552 | | |
539 | 553 | | |
540 | 554 | | |
| |||
0 commit comments