file system reliability main points
play

File System Reliability Main Points Problem posed by - PowerPoint PPT Presentation

File System Reliability Main Points Problem posed by machine/disk failures Transac<on concept Reliability Careful sequencing of file system opera<ons


  1. File ¡System ¡Reliability ¡

  2. Main ¡Points ¡ • Problem ¡posed ¡by ¡machine/disk ¡failures ¡ • Transac<on ¡concept ¡ • Reliability ¡ – Careful ¡sequencing ¡of ¡file ¡system ¡opera<ons ¡ – Copy-­‑on-­‑write ¡(WAFL, ¡ZFS) ¡ – Journalling ¡(NTFS, ¡linux ¡ext4) ¡ – Log ¡structure ¡(flash ¡storage) ¡ • Availability ¡ – RAID ¡

  3. File ¡System ¡Reliability ¡ • What ¡can ¡happen ¡if ¡disk ¡loses ¡power ¡or ¡ machine ¡soRware ¡crashes? ¡ – Some ¡opera<ons ¡in ¡progress ¡may ¡complete ¡ – Some ¡opera<ons ¡in ¡progress ¡may ¡be ¡lost ¡ – Overwrite ¡of ¡a ¡block ¡may ¡only ¡par<ally ¡complete ¡ • File ¡system ¡wants ¡durability ¡(as ¡a ¡minimum!) ¡ – Data ¡previously ¡stored ¡can ¡be ¡retrieved ¡(maybe ¡ aRer ¡some ¡recovery ¡step), ¡regardless ¡of ¡failure ¡

  4. Storage ¡Reliability ¡Problem ¡ • Single ¡logical ¡file ¡opera<on ¡can ¡involve ¡updates ¡to ¡ mul<ple ¡physical ¡disk ¡blocks ¡ – inode, ¡indirect ¡block, ¡data ¡block, ¡bitmap, ¡… ¡ – With ¡remapping, ¡single ¡update ¡to ¡physical ¡disk ¡block ¡ can ¡require ¡mul<ple ¡(even ¡lower ¡level) ¡updates ¡ • At ¡a ¡physical ¡level, ¡opera<ons ¡complete ¡one ¡at ¡a ¡ <me ¡ – Want ¡concurrent ¡opera<ons ¡for ¡performance ¡ • How ¡do ¡we ¡guarantee ¡consistency ¡regardless ¡of ¡ when ¡crash ¡occurs? ¡

  5. Transac<on ¡Concept ¡ • Transac<on ¡is ¡a ¡group ¡of ¡opera<ons ¡ – Atomic: ¡opera<ons ¡appear ¡to ¡happen ¡as ¡a ¡group, ¡ or ¡not ¡at ¡all ¡(at ¡logical ¡level) ¡ • At ¡physical ¡level, ¡only ¡single ¡disk/flash ¡write ¡is ¡atomic ¡ • To ¡empty ¡disk/flash ¡block ¡with ¡consistency ¡check ¡ – Durable: ¡opera<ons ¡that ¡complete ¡stay ¡completed ¡ • Future ¡failures ¡do ¡not ¡corrupt ¡previously ¡stored ¡data ¡ – Isola<on: ¡other ¡transac<ons ¡do ¡not ¡see ¡results ¡of ¡ earlier ¡transac<ons ¡un<l ¡they ¡are ¡commiYed ¡ – Consistency: ¡sequen<al ¡memory ¡model ¡

  6. Reliability ¡Approach ¡#1: ¡ ¡ Careful ¡Ordering ¡ • Sequence ¡opera<ons ¡in ¡a ¡specific ¡order ¡ – Careful ¡design ¡to ¡allow ¡sequence ¡to ¡be ¡interrupted ¡ safely ¡ • Post-­‑crash ¡recovery ¡ – Read ¡data ¡structures ¡to ¡see ¡if ¡there ¡were ¡any ¡ opera<ons ¡in ¡progress ¡ – Clean ¡up/finish ¡as ¡needed ¡ • Approach ¡taken ¡in ¡FAT, ¡FFS ¡(fsck), ¡and ¡many ¡app-­‑ level ¡recovery ¡schemes ¡(e.g., ¡Word) ¡

  7. FAT: ¡Append ¡Data ¡to ¡File ¡ • Allocate ¡data ¡block ¡ MFT Data Blocks 0 1 • Write ¡data ¡ 2 3 fi le 9 block 3 • Write ¡new ¡MFT ¡entry ¡ 4 5 to ¡point ¡to ¡data ¡block ¡ 6 7 8 • Update ¡file ¡tail ¡to ¡ 9 fi le 9 block 0 10 fi le 9 block 1 point ¡to ¡new ¡MFT ¡ 11 fi le 9 block 2 fi le 12 block 0 12 entry ¡ 13 14 • Update ¡access ¡<me ¡ 15 16 fi le 12 block 1 at ¡head ¡of ¡file ¡ 17 18 fi le 9 block 4 19 20

  8. FAT: ¡Append ¡Data ¡to ¡File ¡ Normal ¡opera<on: ¡ Recovery: ¡ • Allocate ¡data ¡block ¡ • Scan ¡MFT ¡ • Write ¡data ¡ • If ¡entry ¡is ¡unlinked, ¡ mark ¡as ¡unused ¡ • Write ¡new ¡MFT ¡entry ¡to ¡ point ¡to ¡data ¡block ¡ • If ¡access ¡<me ¡is ¡ incorrect, ¡update ¡ • Update ¡file ¡tail ¡to ¡point ¡ to ¡new ¡MFT ¡entry ¡ • Update ¡access ¡<me ¡at ¡ head ¡of ¡file ¡

  9. FAT: ¡Create ¡New ¡File ¡ Normal ¡opera<on: ¡ Recovery: ¡ • Allocate ¡data ¡block ¡ • Scan ¡MFT ¡ • Write ¡MFT ¡entry ¡to ¡ • If ¡any ¡unlinked ¡files ¡(not ¡ point ¡to ¡data ¡block ¡ in ¡any ¡directory), ¡delete ¡ • Update ¡directory ¡with ¡ • Scan ¡directories ¡for ¡ file ¡name ¡-­‑> ¡file ¡number ¡ missing ¡update ¡<mes ¡ – What ¡if ¡directory ¡spans ¡ mul<ple ¡disk ¡blocks? ¡ • Update ¡modify ¡<me ¡for ¡ directory ¡

  10. FFS: ¡Create ¡a ¡File ¡ Normal ¡opera<on: ¡ Recovery: ¡ • Allocate ¡data ¡block ¡ • Scan ¡inode ¡table ¡ • Write ¡data ¡block ¡ • If ¡any ¡unlinked ¡files ¡(not ¡ in ¡any ¡directory), ¡delete ¡ • Allocate ¡inode ¡ • Compare ¡free ¡block ¡ • Write ¡inode ¡block ¡ bitmap ¡against ¡inode ¡ • Update ¡bitmap ¡of ¡free ¡ trees ¡ blocks ¡ • Scan ¡directories ¡for ¡ • Update ¡directory ¡with ¡file ¡ missing ¡update/access ¡ name ¡-­‑> ¡file ¡number ¡ <mes ¡ • Update ¡modify ¡<me ¡for ¡ directory ¡ Time ¡propor<onal ¡to ¡size ¡of ¡ disk ¡

  11. FFS: ¡Move ¡a ¡File ¡ Normal ¡opera<on: ¡ Recovery: ¡ • Remove ¡filename ¡from ¡ • Scan ¡all ¡directories ¡to ¡ old ¡directory ¡ determine ¡set ¡of ¡live ¡ files ¡ • Add ¡filename ¡to ¡new ¡ directory ¡ • Consider ¡files ¡with ¡valid ¡ inodes ¡and ¡not ¡in ¡any ¡ directory ¡ – New ¡file ¡being ¡created? ¡ – File ¡move? ¡ – File ¡dele<on? ¡

  12. FFS: ¡Move ¡and ¡Grep ¡ Process ¡A ¡ Process ¡B ¡ move ¡file ¡from ¡x ¡to ¡y ¡ grep ¡across ¡x ¡and ¡y ¡ mv ¡x/file ¡y/ ¡ grep ¡x/* ¡y/* ¡ Will ¡grep ¡always ¡see ¡ contents ¡of ¡file? ¡

  13. Applica<on ¡Save ¡File ¡ Normal ¡opera<on: ¡ Recovery: ¡ • Write ¡name ¡of ¡each ¡open ¡ • On ¡startup, ¡see ¡if ¡any ¡files ¡ file ¡to ¡app ¡folder ¡ were ¡leR ¡open ¡ • Write ¡changes ¡to ¡backup ¡ • If ¡so, ¡look ¡for ¡backup ¡file ¡ file ¡ • If ¡so, ¡ask ¡user ¡to ¡compare ¡ • Rename ¡backup ¡file ¡to ¡be ¡ versions ¡ file ¡(atomic ¡opera<on ¡ provided ¡by ¡file ¡system) ¡ • Delete ¡list ¡in ¡app ¡folder ¡ on ¡clean ¡shutdown ¡

  14. Careful ¡Ordering ¡ • Pros ¡ – Works ¡with ¡minimal ¡support ¡in ¡the ¡disk ¡drive ¡ – Works ¡for ¡most ¡mul<-­‑step ¡opera<ons ¡ • Cons ¡ – Can ¡require ¡<me-­‑consuming ¡recovery ¡aRer ¡a ¡failure ¡ – Difficult ¡to ¡reduce ¡every ¡opera<on ¡to ¡a ¡safely ¡ interrup<ble ¡sequence ¡of ¡writes ¡ – Difficult ¡to ¡achieve ¡consistency ¡when ¡mul<ple ¡ opera<ons ¡occur ¡concurrently ¡

  15. Reliability ¡Approach ¡#2: ¡ Copy ¡on ¡Write/Write ¡Anywhere ¡ • To ¡update ¡file ¡system, ¡write ¡a ¡new ¡version ¡of ¡ the ¡file ¡system ¡containing ¡the ¡update ¡ – Never ¡update ¡in ¡place ¡ – Reuse ¡exis<ng ¡unchanged ¡disk ¡blocks ¡ • Seems ¡expensive! ¡ ¡But ¡ – Updates ¡can ¡be ¡batched ¡ – Almost ¡all ¡disk ¡writes ¡can ¡occur ¡in ¡parallel ¡ • Approach ¡taken ¡in ¡network ¡file ¡server ¡ appliances ¡(WAFL, ¡ZFS) ¡

  16. Copy ¡on ¡Write/Write ¡Anywhere ¡ Root Inode Inode File’s Inode Array Indirect Data Slots Indirect Blocks (in Inode File) Blocks Blocks Fixed Anywhere Location

  17. Copy ¡on ¡Write/Write ¡Anywhere ¡ Root Inode Inode File’s Inode Array Indirect Data Slots Indirect Blocks (in Inode File) Blocks Blocks Update Last Block of File

  18. Copy ¡on ¡Write ¡Batch ¡Update ¡ Root Root Inode File’s File’s Inode Inode’s File Indirect Data Indirect Blocks Blocks Blocks New Indirect New Nodes Root Inode New New Indirect Data Nodes of Block of Inode New Inode File Data File Blocks

  19. FFS ¡Update ¡in ¡Place ¡ Update Inode New Data Block Update Indirect Block Update Bitmap

  20. WAFL ¡Write ¡Loca<on ¡ Old Inode New Data Block Update Indirect Block Update Inode Update Bitmap Old Indirect Block Old Bitmap

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend