A record is evidence, not durability

  • Encode the page change before reasoning about recovery.
  • Separate cached pages, buffered WAL, durable WAL and durable pages.
  • LSN orders history; PrevLSN follows one transaction.
1 / 5

Derive the byte budget

Fixed header = 34 bytes; CRC = 4 bytes.

Before=ABC (3), After=xy (2): total = 43.

Payloads: [34,37), [37,39); CRC: [39,43).

2 / 5

Decode one complete record

Bounds → magic/type/reserved → exact length → non-update fields → CRC → copy.

A matching CRC does not establish valid semantics or a durable commit.

3 / 5

Crash trace

Durable WAL=8; pageLSN=8. Update 10 and commit 11 are appended.

  • Before WAL flush: both can disappear.
  • Flush through 10: updated page may be written.
  • Flush through 11: durable commit may be acknowledged.
  • Crash before page write: recovery must redo committed history.
4 / 5

Your turn

Before length 2; After length 4. Derive ranges and total size.

Durable WAL=25; pageLSN=27; buffered commit=28. Which flush permits the page write? Which permits acknowledgment?

Check the lesson reveals, then implement WAL Record Encoding.

5 / 5
←/→ or click edges to navigate · ? help · N notes · F fullscreen