Copy-on-abundant-write
Copy-on-abundant-write is a research cloning policy that buffers changes to a clone and unshares data only after enough changes accumulate to justify copying.
The policy comes from BetrFS 0.5, a write-optimized file system whose B-epsilon-tree was turned into a directed acyclic graph so that clones can share nodes. A clone is persisted by writing a message into the root, and later small changes stay as buffered messages instead of forcing an immediate copy. [1]
A shared node is copied only when it must become simple, with a reference count of 1, before messages are flushed into it. That happens when enough messages accumulate in its parent, the abundant-write case, or when background healing must split or merge the node, so structural maintenance can also require unsharing. Nodes are typically 2 to 4 MiB, which makes early copying costly. [1]
It is not a generic Linux reflink option. The reflink interface only requires that writes to a shared region stay private to the written file, without fixing when or at what granularity data is copied, and disk filesystems generally require block-aligned ranges. [3]
Relations
Advantages
- In the paper's container-creation test, cloning was up to two orders of magnitude faster than a simple recursive copy. [1]
Limitations
- Renames and clones change tree topology, so the design needs extra structures, GOTO messages and translation prefixes, to correct stale keys in shared data. [1]
Citations
- Zhan et al., How to Copy Files, FAST 2020, sections 1-4
- Linux man-pages: ioctl_ficlonerange(2), share data of one file with another
Further reading
Sources & caveats
- fast2020 is the FAST 2020 paper How to Copy Files by Zhan et al. (University of North Carolina at Chapel Hill, Rutgers, Stony Brook and others), read in sections 1 to 4.
- ficlone is the Linux man-pages entry ioctl_ficlonerange(2), read in its description and errors.
- The reference-count condition, healing-triggered unsharing, 2 to 4 MiB nodes and the two-orders-of-magnitude result come from fast2020. The private-write rule and block alignment come from ficlone.