Once changes are copied safe to remove log redo

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 Blocks Copy on Write/Write Anywhere Root Inode Slots Inode File’s Indirect Blocks Inode Array (in Inode File) Indirect Blocks Data Blocks Update Last Block of File Copy on Write Batch Update Root Inode New Root Inode Root Inode’s Indirect Blocks Inode File File’s Indirect Blocks File’s Data Blocks New Indirect Nodes New Indirect Nodes of Inode File New Data Block of Inode File New Data Blocks Copy on Write Garbage Collec'on •  For write efficiency, want con'guous sequences of free blocks –  Spread across all block groups –  Updates leave dead blocks scaYered •  For read efficiency, want data read together to be in the same block group –  Write anywhere leaves related data scaYered => Background coalescing of live/dead blocks Copy On Write •  Pros –  Correct behavior regardless of failures –  Fast recovery (root block array) –  High throughput (best if updates are batched) •  Cons –  Poten'al for high latency –  Small changes require many writes –  Garbage collec'on essen'al for performance Logging File Systems •  Instead of modifying data structures on disk directly, write changes to a journal/log –  Inten'on list: set of changes we intend to make –  Log/Journal is append- only •  Once changes are on log, safe to apply changes to data structures on disk –  Recovery can read log to see what changes were intended •  Once changes are copied, safe to remove log Redo Logging •  Prepare –  Write all changes (in transac'on) to log •  Commit –  Single disk write to make transac'on durable •  Redo –  Copy changes to disk •  Garbage collec'on –  Reclaim space in log •  Recovery –  Read log –  Redo any oper...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online