The Write-Anywhere-File- Layout (WAFL) Ohad Rodeh TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.1/36 Introduction This lecture is based on File System Design for an NFS File Dave Hitz, James Lau, Michael Server Appliance Malcolm. Proceedings of the USENIX Winter 1994 Technical Conference The WAFL design is used today in Network-Appliance (cid:2)lers TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.2/36 Appliance for NFS NFS is Network File System 1. A standard protocol to access a remote (cid:2)le-system 2. Create/Delete (cid:2)le 3. Read/Write An appliance is a special purpose device TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.3/36 Main ideas New (cid:2)le-system idea 1. Write-Anywhere-File-Layout (WAFL) 2. Create snapshots ef(cid:2)ciently 3. Uses a copy-on-write technique 4. Minimizes disk-space that snapshots consume Snapshots are used to eliminate the need for (cid:2)le-system consistency checks after an unclean shutdown TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.4/36 Design goals WAFL is to be used inside an NFS appliance Tuned speci(cid:2)cally for NFS Increased write workload due to problematic caching at client WAFL should: 1. Provide fast NFS service 2. Support large (cid:2)le systems (tens of GB) that grow dynamically as disks are added. This simpli(cid:2)es management, users don’t want multiple partitions. 3. Provide high performance while supporting RAID 4. Support RAID in order to tolerate failed disks TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.5/36 gracefully 5. Restart quickly after a crash. Traditional FSCK is too slow. Snapshots Snapshot: read-only copy of the entire (cid:2)le system. Why use snapshots? 1. Users can access snapshots through NFS to recover (cid:2)les that they have accidentally changed or removed 2. System administrators can use snapshots to create backups safely from a running system 3. WAFL uses Snapshots internally so that it can recover quickly from crashes TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.6/36 Structure WAFL is similar in many ways to FFS It uses 4 KB blocks with no fragments The i-node is similar to FFS, with some exceptions 1. Contains 16 block pointers 2. All the block pointers refer to blocks at the same level 3. I-nodes for (cid:2)les smaller than 64 KB use the 16 block pointers to point to data blocks 4. I-nodes for (cid:2)les larger than 64 KB point to indirect blocks which point to actual (cid:2)le data 5. I-nodes for even larger (cid:2)les point to doubly indirect TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.7/36 blocks 6. For very small (cid:2)les, data is stored in the i-node itself Meta data (cid:2)les WAFL stores meta-data in (cid:2)les There are three meta-data (cid:2)les 1. I-node (cid:2)le, contains the i-nodes for the (cid:2)le system 2. Block-map (cid:2)le, identi(cid:2)es free blocks 3. I-node-map (cid:2)le, identi(cid:2)es free i-nodes The term map is used instead of bit map because these (cid:2)les use more than one bit for each entry TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.8/36 Why use (cid:2)les to hold meta-data? Allows writing meta-data blocks anywhere on disk Write-anywhere allows operating ef(cid:2)ciently with RAID 1. WAFL works with RAID-4 2. Scheduling multiple writes to the same RAID stripe whenever possible 3. Avoid the 4-to-1 short-write penalty Makes it easy to increase the size of the (cid:2)le system on the (cid:3)y TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.9/36 Why use (cid:2)les to hold meta-data? II When a new disk is added 1. Server automatically increase the sizes of the meta-data (cid:2)les 2. The system administrator can increase the number of i-nodes in the (cid:2)le system manually if the default is too small TheWrite-Anywhere-File-Layout(WAFL)(cid:150)p.10/36
Description: