WAFL File System
WAFL(Write Anywhere File Layout)是 NetApp file servers 的 file system;它把 write-anywhere / COW、snapshots、metadata-as-files、NVRAM write cache 結合起來,適合 network storage 的 random-write workload。
Design Context
Network file server 同時服務很多 clients。Reads 可被 client/server cache 緩解;random writes 壓力大。WAFL 因此重視:
- random-write performance。
- NVRAM stable write buffering。
- cheap snapshots / clones。
- backup、testing、replication。
Metadata as Files
WAFL 把 metadata 也存在 files 中:inode file、free-block map file、free-inode map file。整個 file system 可看成 root inode 指向的一棵 block tree。
好處:metadata files 可像普通 files 一樣擴張,新增 disks 時不用固定舊式 metadata 區。
Write Anywhere + Snapshots
WAFL 不覆寫已使用 blocks;更新 data / metadata 時寫到新 free blocks,再更新 pointers。這和 D-OS-Ch14gc-Copy_on_Write_File_System 相同精神。
建立 snapshot 時,複製目前 root inode:
snapshot root → old blocks
current root → old unchanged blocks + new changed blocksSnapshot 初始幾乎不佔空間;修改後才因保留舊 blocks 而增加 space。Free-block map 必須知道哪些 snapshots 仍引用某 block。
Clones and Replication
Clone 是 read-write snapshot:以 snapshot 為基底,修改寫到新 blocks,原 snapshot 不變。
Replication 可傳送兩個 snapshots 之間改變的 blocks / metadata pointers,而不必每次複製整個 file system。
Tradeoff
優點:random writes 友善、snapshots/clones 便宜、backup/replication 自然、metadata layout 彈性。
代價:free-space accounting 複雜、snapshot 保留舊 blocks、write-anywhere 可能 fragmentation、設計依賴 appliance architecture 與 NVRAM cache。