90 likes | 218 Views
This document explores the critical concepts of database recovery, focusing on "Write-Ahead Logging" (WAL) and its implications for data integrity during transactions. It delves into the processes following commit and abort actions in transaction management, detailing how recovery from logs ensures consistency in both committed and uncommitted transactions. By examining the mechanisms for writing logs, auditing recovery strategies, and understanding outcomes, this guide provides a roadmap for handling failures and maintaining data stability within larger systems.
E N D
Recoverability Recoverable sector D0 D1 chooser Larger actions? Commit point
id begin_ra() ABORT() COMMIT() end_ra()
Version histories Cell storage Install Journal storage x WriteJournal (item x, v, id)
ReadJournal (item x, v, id) Commit record table Bootstrap Slow
Logging: Cell st.: read/write Log: non-volatile+sequential
Plan: 1) Fail Recover from log • uncommitted back out (undo) • committed install (rddo) 2) ABORT () undo cur. action (redo)
Append-only: type: UPDATE id: 172 undo: x old redo: x new type: OUTCOME id: 174 status: COMMITTED 1) When to write log? 2) How to recover?
Disk-bound DB: write x • WAL protocol • Write ahead logging • Log COMMIT record • before returning from • commit() log update record
Recovery: • Scan log backwards • Winners: COMMITTED or ABORTED • Losers: Everything else • Redo COMM. Winners • Undo Losers