Full-path indexing
Full-path indexing uses complete file paths as index keys, with subtree locality determined by the key ordering.
The FAST 2015 BetrFS schema maps each path to its metadata and each pair of path and block number to a 4096-byte block, sorted so that entries of one directory sit together and a recursive scan becomes a range query. [3] Scans of a directory subtree, such as a recursive grep, can then run near disk bandwidth, and a recursive delete becomes a single range-delete message. [1]
The weak point is rename. With no indirection from name to data, renaming a directory changes the key of every descendant, and the first full-path prototype copied all data and metadata to new keys, taking 21.17 s to rename a Linux 3.11.10 source tree against 0.08 s on btrfs and 0.10 s on ext4. [3] Range rename with key lifting later made that work grow with tree height rather than subtree size. [1]
Inode-style indirection makes renames cheap but lets file contents scatter as a filesystem ages. Zoning sits between the two designs by indexing paths relative to a zone root, with a default zone size of 512 KiB. [4] Returning to full paths with key lifting ran recursive grep 1.5 times and random writes 1.2 times faster than the zoned version. [1]
Full-path keys do not alone guarantee contiguous subtrees. TokuFS metadata sorts by directory depth before pathname: /a, /b, /a/x is a small counterexample, since /b separates /a from its descendant. Its data index uses a different order. State which index and comparator are meant before assuming a subtree is one scan range. [5]
Relations
- related
- B-epsilon tree, Range rename, TokuFS
Advantages
- Sorted full path names are long and repetitive but compress well, by a factor of 20 in the first prototype, which keeps the space overhead of path keys manageable. [3]
Limitations
- Hard links break the assumption of one path per file, and the zoned design handled them by placing any file with more than one link in its own zone. [4]
Citations
- Zhan et al. The Full Path to Full-Path Indexing. FAST 2018, pp. 123-138, sections 3-7.
- Jannen et al. BetrFS: A Right-Optimized Write-Optimized File System. USENIX FAST 2015, pp. 301-315, sections 4 and 7.
- Yuan et al. Optimizing Every Operation in a Write-optimized File System. USENIX FAST 2016, sections 3-4.
- TokuFS authors. HotStorage 2012 slides, pages 22-27: different metadata and data index orders.
Further reading
Sources & caveats
- fullpath, betrfs15 and zoning are peer-reviewed USENIX FAST papers from 2018, 2015 and 2016 by one research group, read in the schema, rename and evaluation sections.
- All timings are single-testbed measurements of research prototypes in those papers, not general filesystem figures.
- Status stays research because full-path indexing appears in these sources only in research prototypes.