Log Sequence Numbers and Idempotent Redo
Track the latest applicable log record on a page and use ordered positions to skip changes already reflected in durable data.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A log position orders recovery records
A log sequence number names a record in the ordered recovery log. A page can store an indicator of the latest applied update. Before writing the page, a write-ahead logger ensures the necessary record positions are durable. If page state includes update \(120\), flushing only through \(110\) would violate the intended dependency.
Recover according to each page’s recorded progress
In an ARIES-style redo step, an update can be skipped when the page already reflects that position or a later one under the recovery contract. Otherwise apply the record and advance the page marker. This makes replay restartable without repeating each logical effect. The log and page layouts must handle torn writes or corrupted state according to their model. Write-ahead logging defines the flush order. Database checkpoints limit where recovery starts looking.[1]