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 Buffer pool Database undo redo 1. Log analysis LOG 2. REDO scan 3. UNDO scan system mostly unavailable during three phases
ARIES restart Recovery info B A B A Transactions Pages requiring requiring Buffer pool Database undo redo 1. Log analysis LOG 2. REDO scan 3. UNDO scan system mostly unavailable during three phases 6
Instant recovery (post-failure) lock(f) Recovery info Running txn. fix(B) Transactions Pages B requiring requiring lock undo redo conflict! + locks Buffer pool Aborting txn. LOG ... (pre-failure) per-page log chains redo and undo on demand, without waiting for log scans same recovery actions, different schedule
Failure classes 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
Make the log great again
Throw away the database! Main memory Main memory write- read- optimized optimized Log DB ? Dual storage Single storage “... a DBMS is really two DBMSs, one managing the database as we know it and a second one managing the log.” Michael Stonebraker
The log as a partitioned B-tree A B A B A B P0 P1 P2 LSN domain x y z w like an LSM, but with page identifiers and their log records
The log as a partitioned B-tree (implementation) Partitioned log index sorted unsorted partitions partition A B A B A B page → LSN mapping log appends A B (txn. commit) P0 P1 P2 LSN domain x y z u w (sort low-water mark)
Merging Before: A B A B A B � x, y � � y, z � � z, w � merge After: A B A B � x, z � � z, w �
FineLine Write-ahead logging: FineLine: fetch Data Data structure structure read reorg. Log Database write index append WAL append Log records Log records volatile persistent volatile persistent
FineLine recovery Data structure Indexed log Log records volatile persistent
FineLine recovery fetch Indexed log volatile persistent
FineLine recovery fetch Indexed log volatile persistent
FineLine recovery fetch Indexed log volatile persistent
In-memory FineLine database fetch Indexed log append volatile persistent ➢ nodes recovered automatically during fetch ➢ volatile structures = in-memory database ➢ no undo, no dirty pages, no checkpoints, no offline log scans
In-memory DBMS databases Buffer mgmt. Log-structured Physiological storage logging
My pleas 1.Demand on-demand recovery 2.Make the log great again
Standing on the shoulders of Giants
Thank you! csauer@tableau.com
Recommend
More recommend