






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







1
¾ Need to undo the aborted transaction operations ¾ What if the system crashes between the decision to commit, and the writing of last updates? ¾ Need to redo the committed, but unfinished operations
3
¾ Machine crash, transaction abort, media failure
¾ Disk writes are NOT atomic ¾ The Idea: force write the information to disk before making any changes (to support redo)
¾ Programmer may want to abort voluntarily ¾ Use the written information to undo
¾ Lampson and Sturgis (1976, unpublished) ¾ Put all writes on stable storage intentions list ¾ If abort, forget the list ¾ Execute the update operations at commit ¾ If crash, re-execute the whole list ¾ Write operations are idempotent ¾ Re-execution repeats until successful completion ¾ Then erase the intentions list
7
¾ Acquire the log lock, find file page ¾ Fill in log record, update the anchor
¾ Keeps the log file open ¾ Encapsulates the actual I/O operations
¾ Flush requests ¾ Periodic timer interrupts
¾ Write one copy of the log ¾ When complete, write other copy
¾ Write page i, and then page i+ ¾ When page full, switch to new page ¾ Parallel writing of both log files
9
¾ Disk I/O is slow compared to CPU ¾ Sequential logging is faster than random write ¾ Steal and no force (next slide)
¾ Amortize commit log flush ¾ Delay transaction commit until full use of log page ¾ Batch only when there is high traffic
10
¾ Push pages to disk optimistically ¾ If commit, you win ¾ If abort, need to undo the aborted value
¾ Push pages to disk at commit time ¾ No force: leave pages in memory ¾ Push pages only when convenient ¾ If system crashes, must redo the committed value
13
¾ According to the writing method
¾ According to the writing method ¾ Sweep through good pages ¾ Stop when bad pages appear
¾ Reconstruct log anchor ¾ Undo/Redo pending transactions ¾ Restart log daemons ¾ Start TP processing
¾ Need to isolate the restart in a transaction ¾ Start normal transactions at restart lock point (when the restart is guaranteed to succeed)
15
¾ Recovery glue for centralized TP ¾ Coordinator for distributed transaction commit ¾ Coordinates distributed recovery
¾ Begin-T, Commit-T, Abort-T ¾ Savepoint, Rollback ¾ Prepare-T [for 2PC] ¾ Chain-T [for chained] ¾ Leave-T and Resume-T [for nested]
¾ LogMgr, LockMgr, TM, and RMs
¾ REDO committed transactions ¾ Find checkpoint record ¾ Start ResourceMgr restart ¾ Coordinate the end of all involved RMs
19
¾ Each node is primary for something, and backup for some other node. ¾ If good partitioning cannot be found, then symmetric is worse than single
¾ For DBMS to take market share, system administrative utilities must be in place
¾ Do, Redo, Undo ¾ Write-ahead logging ¾ Transaction abort
¾ Restart