After a crash, committed work is replayed and uncommitted partial work is removed.
Circle one: True False
What is written first when a transaction changes data?
- The change to the data page
- The intention in the log
- The commit record
When is the commit record written?
- Once all its changes are safe in the log
- As soon as the first change reaches a data page
- Only during a checkpoint
Why must the log live on safe storage ahead of the pages?
- Log records are smaller, so writing them first saves space
- Pages cannot be written at all
- Pages can be lost in a crash while the log survives
The log ends mid-transaction with no commit record. What happens to its partial changes?
- They are replayed as if committed
- They are rolled back and removed
- They are left half written forever
What does a checkpoint do?
- Writes pending changes to pages and marks the log
- Deletes the entire log
- Commits every open transaction so none need undo
A friend writes data pages first and the log afterwards. What breaks?
- Nothing, the order makes no difference
- Only speed changes, since pages and log hold the same data
- A crash between them leaves a page change no log can undo
A log holds T1 with a commit record and T2 without one. What does recovery do?
- Redoes T1 step by step and undoes the partial T2
- Undoes both transactions fully
- Redoes both transactions fully