Modern techniques for transaction-
- riented database recovery
Modern techniques for transaction- oriented database recovery - - PowerPoint PPT Presentation
Modern techniques for transaction- oriented database recovery Caetano Sauer My pleas 1.Demand on-demand recovery 2.Make the log great again Demand on-demand recovery ARIES Recovery info B A B A Transactions Pages requiring requiring
A B A B Buffer pool Database Pages requiring redo Transactions requiring undo
system mostly unavailable during three phases Recovery info LOG
6
Recovery info
A B A B Buffer pool Database
system mostly unavailable during three phases LOG
Pages requiring redo Transactions requiring undo
Recovery info
B Buffer pool fix(B) Aborting txn.
(pre-failure)
Running txn.
(post-failure)
lock(f) lock conflict!
same recovery actions, different schedule redo and undo on demand, without waiting for log scans
Pages requiring redo Transactions requiring undo + locks
...
LOG per-page log chains
Failure class Loss Typical cause Response Transaction Single-transaction progress Deadlock, constraint violation Rollback System Server process (in-memory state) Software fault, power loss Restart Media Persistent database contents Hardware fault Restore Single page Local integrity Partial writes, wear-out Repair
Log DB ?
Dual storage Single storage
Main memory Main memory “... a DBMS is really two DBMSs, one managing the database as we know it and a second one managing the log.”
Michael Stonebraker
write-
read-
P0 P1 P2 LSN domain
y z w
B A B A B A
x like an LSM, but with page identifiers and their log records
P0 P1 P2 unsorted partition sorted partitions B A page → LSN mapping LSN domain
y z w
Partitioned log index log appends (txn. commit)
(sort low-water mark)
B A B A B A
u x
Before:
B A B A B A z, w x, z
After:
B A B A z, w x, y y, z merge
Log records Data structure fetch append Log index reorg. volatile persistent
FineLine:
WAL Log records Database Data structure write read volatile persistent append
Write-ahead logging:
Log records Data structure Indexed log volatile persistent
fetch Indexed log volatile persistent
fetch Indexed log volatile persistent
fetch Indexed log volatile persistent
➢ nodes recovered automatically during fetch ➢ volatile structures = in-memory database ➢ no undo, no dirty pages, no checkpoints, no offline log scans
fetch append Indexed log volatile persistent
In-memory database
In-memory databases Log-structured storage DBMS Buffer mgmt. Physiological logging