The write-ahead rule states that
Athe data page must be written to disk before the log record
Bthe log record can be written any time relative to the data page
Cevery transaction must write to the log before reading anything
Dlog record must be on disk before the data page
Answer & Solution
Correct answer: D. log record must be on disk before the data page
WAL = the log entry hits disk first, then the data page. This ordering ensures that on crash, the log always knows about any data page change that made it to disk, so undo/redo can work. Reversing the order would let a data change exist on disk with no log record explaining how to undo it.
Related questions
The main reasons production DBMSs avoid shadow paging in favour of WAL are that shadow pagWhat is the purpose of a Compensation Log Record (CLR) in ARIES?ARIES recovery is structured as exactlyFuzzy checkpoints differ from naive checkpoints byIn standard log-based recovery, the order of operations isAfter a crash, with checkpointing, the recovery system scans the logA complete log record for a write operation includesPer WAL semantics, a transaction is officially committed at the moment