G 1mb log new blocks into empty segment garbage

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a'ons for commiYed transac'ons –  Garbage collect log Before Transac'on Start Cache Nonvolatile Storage Tom = $200 Tom = $200 Log: Mike = $100 Mike = $100 ANer Updates Are Logged Cache Nonvolatile Storage Tom = $100 Mike = $200 Tom = $200 Mike = $100 Log: Tom = $100 Mike = $200 ANer Commit Logged Cache Nonvolatile Storage Tom = $100 Mike = $200 Tom = $200 Mike = $100 Log: Tom = $100 Mike = $200 COMMIT ANer Copy Back Cache Nonvolatile Storage Tom = $100 Mike = $200 Tom = $100 Mike = $200 Log: Tom = $100 Mike = $200 COMMIT ANer Garbage Collec'on Cache Nonvolatile Storage Tom = $100 Tom = $100 Log: Mike = $200 Mike = $200 Ques'ons •  What happens if machine crashes? –  Before transac'on start –  ANer transac'on start, before opera'ons are logged –  ANer opera'ons are logged, before commit –  ANer commit, before write back –  ANer write back before garbage collec'on •  What happens if machine crashes during recovery? Performance •  Log wriYen sequen'ally –  ONen kept in flash storage •  Asynchronous write back –  Any order as long as all changes are logged before commit, and all write backs occur aNer commit •  Can process mul'ple transac'ons –  Transac'on ID in each log entry –  Transac'on completed iff its commit record is in log Redo Log Implementa'on Volatile Memory Log−head pointer Pending write−backs Log−tail pointer Persistent Storage Log−head pointer Log: ... older Free Garbage Collected Writeback Complete Eligible for GC Mixed: WB Complete Committed Uncommitte...
View Full Document

Ask a homework question - tutors are online