330 likes | 514 Views
Journaling vs Soft Updates: Asynchronous Metadata Protection in File Systems. Margo I. Seltzer, Harvard, Gregory R. Ganger CMU, M. Kirk McKusick , Keith A. Smith, Harvard, Craig A.N. Soules CMU, Christopher A. Stein, Harvard Presenters: Arjumand Younus and Muhammad Atif Qureshi.
E N D
Journaling vs Soft Updates: Asynchronous Metadata Protection in File Systems Margo I. Seltzer, Harvard, Gregory R. Ganger CMU, M. Kirk McKusick, Keith A. Smith, Harvard, Craig A.N. Soules CMU, Christopher A. Stein, Harvard Presenters: ArjumandYounus and Muhammad AtifQureshi
Outline • Introduction: The Problem • Solutions • Synchronous Writes • Soft Updates • Journaling • Comparative Evaluation • Feature Comparison • Measurements • Conclusion
Problem Statement • File system meta-data update problem • Interdependencies must be cared for during disk updates
Metadata Operations • Metadata operations modify the structure of the file system • Creating, deleting or renaming files, directories or special files • Data must be written to disk in such a way that the file system can be recovered to a consistent state after a system crash
Deleting a File (1/3) i-node-1 abc def i-node-2 ghi i-node-3 Assume we want to delete file “def”
Deleting a File (2/3) i-node-1 abc ? def ghi i-node-3 Cannot delete i-node before directory entry “def”
Deleting a File (3/3) • Correct sequence is • Write to disk directory block containing deleted directory entry “def” • Write to disk i-node block containing deleted i-node • Leaves the file system in a consistent state
Creating a File (1/3) i-node-1 abc ghi i-node-3 Assume we want to create new file “tuv”
Creating a File (2/3) i-node-1 abc ghi i-node-3 tuv ? Cannot write directory entry “tuv” before i-node
Creating a File (3/3) • Correct sequence is • Write to disk i-node block containing new i-node • Write to disk directory block containing new directory entry • Leaves the file system in a consistent state
Approaches to Metadata Management • Synchronous Writes • FFS • Ordered Writes • Soft Updats • Logged Writes • Journaling
Synchronous Writes • Soft Updates • Journaling • LFFS-file • LFFS-wafs
Synchronous Writes • Used by FFS to guarantee consistency of metadata: • All metadata updates are done through blocking writes • Increases the cost of metadata updates • Can significantly impact the performance of whole file system
Soft Updates • Uses delayed writes (write back) • Maintain dependency informationabout cached pieces of metadata: • This i-node must be updated before/after this directory entry • Guarantees that metadata blocks are written to disk in the required order
Problems in Soft Updates (1/2) • Soft Updates guarantee that file system will recover into a consistent state but not necessarily the most recent one • Some updates could be lost • Cyclical dependencies: • Same directory block contains entries to be created and entries to be deleted • These entries point to i-nodes in the same block
Problems in Soft Updates (2/2) Block B Block A def --- i-node-2 ---------- • Cannot write block A before block B: • Block A contains a new directory entry pointing to block B • Cannot write block B before block A: • Block A contains a deleted directory entry pointing to block B NEW xyz NEW i-node-3 We want to delete file “def”andcreate new file “xyz”
def Solution to Soft Update Problem (1/2) • Roll back metadata in one of the blocks to an earlier, safe state • (Safe state does not contain new directory entry) Block A
Solution to Soft Update Problem (2/2) • Write first block with metadata that were rolled back (block A’ of example) • Write blocks that can be written after first block has been written (block B of example) • Roll forward block that was rolled back • Write that block • Breaks the cyclical dependency but must nowwrite twice block A
Journaling • Logs metadata operations • Writes metadata in-place asynchronously • Write-ahead logging (WAL) protocol guarantees recoverability. • Journaling systems can provide • same durability semantics as FFS if log is forced to disk after each meta-data operation • the laxer semantics of Soft Updates if log writes are buffered until entire buffers are full • Will discuss two implementations • LFFS-file • LFFS-wafs
LFFS-file • Maintains a circular log in a pre-allocated file in the FFS (about 1% of file system size) • Buffer header of each modified block in cache identifies the first and last log entries describing an update to the block • LFFS-file maintains its log asynchronously • Maintains file system integrity, but does not guarantee durability of updates
LFFS-wafs (1/2) • Implements its log in an auxiliary file system:Write Ahead File System (WAFS) • Can be mounted and unmounted • Can append data • Can return data by sequential or keyed reads • Same checkpointing scheme and write-ahead logging protocol as LFFS-file
LFFS-wafs (2/2) • Major advantage of WAFS is additional flexibility: • Can put WAFS on separate disk drive to avoid I/O contention • Can even put it in NVRAM • LFS-wafs normally usessynchronous writes • Metadata operations are persistent upon return from the system call • Same durability semantics as FFS
Properties of Metadata Operations • Feature Comparison • Experimental Setup & Measurements
Properties of Metadata Operations • Integrity • The file system is always recoverable • Durability • Updates are persistent once the call returns • Atomicity • No partial metadata operations are visible after recovery
Experimental Setup • Software • Modified FreeBSD kernel and 2 journaling file system implementations (LFFS-wafs, LFFS-file) • Hardware • 500 MHz Xeon Pentium III • 512 MB RAM • 3 x 9GB 10,000 RPM Seagate Cheetahs • Compared performances of • Standard FFS • FFS mounted with the async option • FFS mounted with Soft Updates • FFS augmented with a file log using asynchronous log writes • FFS augmented with a WAFS log using • Synchronous /asynchronous log writes • WAFS log on same/different drive
Comments on Microbenchmark Results • FFS-async performsbest • Original FFS, LFFS-wafs-2sync andLFFS-wafs-1sync performworst • Synchronous log updates are costly • LFFS-file outperforms LFFS-wafs-2async and LFFS-wafs-1async • LFFS-file uses bigger block clustersfor log writes • Additional Results • Read/write performance identical for all systems • All async systems have similar create throughput • Soft updates has great delete performance due to its ability to do background work
Macrobenchmarks • SSH-build • Unpacks, configures and builds ssh • NetNews • Simulates the work of a news server • SDET • Emulates user interactive software development workload • Postmark • Designed to model the workload seen by ISPs under heavy load: combination of email, news and e-commerce transactions
Conclusions • Journaling alone is not sufficient to “solve” the meta-data update problem • Cannot realize its full potential when synchronous semantics are required • When that condition is relaxed, journaling and Soft Updates perform comparably in most cases
Problems • Only a single file system with a single write-ordering model and a single approach to writing the journal was evaluated. • Under what circumstances will soft update perform better and where will Journaling perform better were not close ended. • It looks more of survey paper than conclusive stance over issues at hands. • High performance applicants will find it too naive to accept as practioners guide (Who will be its first implementer). • Work load taken were too sparse and were too high level to close end a discussion in particular discipline and does not offer a final say. • Survey was good, but analysis lacked to comprehend a pin pointed viewpoint. • Performance over array (disks) must have appealed high performance applicants, but paper does not provide any knowledge for such meaningful debate.