Logging

Read/append only data structure on stable media
→ Recovery manager appends transaction log records
→ Aborting and failure recovery reads transaction log records

Example

Five transactions: {T0,T1,T2,T3,T4}
Transaction status

Pasted image 20231214095333.png

Write-Ahead Logging

Allowing indices on stable store to be updated prior to a LOG can lead to inconsistency

Undo Rule

Log record for an update is appended to the LOG file before the corresponding data page is written to stable store
→ Guarantees atomicity

Redo Rule

All log records for a transaction are appended to the LOG file before acknowledging a commit
→ Guarantees durability