CONCEPT Cited by 1 source
Block-level async clone¶
Block-level async clone is the storage-migration primitive where a source block device is cloned asynchronously into a destination device: the clone is immediately usable (attaches instantly to a new consumer), reads of un-hydrated blocks fall through to the source over the network, writes go only to the clone, and a background thread rehydrates blocks from source to destination independently of user I/O.
The decisive property: availability of the destination is decoupled from completion of the data transfer.
Definition¶
Given a source block device S and a freshly-allocated destination
device D of identical size, an async clone presents D to its
consumer immediately with these semantics:
read(D, block)where block is hydrated → served fromD.read(D, block)where block is not hydrated → fetched fromSover the network, returned to the reader, and (optionally) written through toD.write(D, block)→ served fromD; block is marked hydrated andSis never consulted for this block again.- A background hydration thread continuously fetches blocks
from
StoDindependently of user I/O, so that eventually the clone is fully hydrated andScan be released.
State is tracked in a metadata bitmap of per-block "is this hydrated?" bits.
Canonical kernel-tier implementation: dm-clone¶
The Linux kernel ships a production-grade implementation of this
concept as dm-clone. See the
Fly.io 2024-07-30
post for the map function in-source and a production deployment
story.
"dm-clone gives us a new device, of identical size, where reads
of uninitialized blocks will pull from the original. It sounds
terribly complicated, but it's actually one of the simpler kernel
lego bricks."
Why it's load-bearing for stateful-workload migration¶
Without async clone, stateful-workload migration between physical hosts collapses to two bad options (concepts/kill-copy-boot-migration-tradeoff):
copy→boot→kill— copy the volume, boot the new instance, kill the old one. Loses data because the source keeps writing while the copy runs.kill→copy→boot— kill the source, copy the volume, boot the new instance. Too slow — at multi-GB volume sizes and especially with many concurrent migrations, interruption time scales with volume size.
Async clone enables a third option — kill → clone → boot
— where clone returns immediately and the boot step can happen
in parallel with rehydration. Interruption time becomes "as fast
as stateless migration" (Fly.io); durability is preserved because
the source is killed before any new writes happen on the
destination.
Shape at other storage layers¶
The same architectural move appears at other storage layers:
- Git / repository layer — concepts/async-clone-hydration
on Git repos; the canonical wiki instance is Cloudflare
Artifacts (sources/2026-04-16-cloudflare-artifacts-versioned-storage-that-speaks-git).
git clone --filter=blob:none+ background-fetch on the blobs; the pattern is patterns/blobless-clone-lazy-hydrate. - Filesystem tier — NFS and CIFS have lazy-fetch modes for large files that behave similarly in userspace.
- Object-storage tier — S3 replication can take a similar shape if the replication destination is used as read-through cache on miss.
Key enablers¶
- Metadata bitmap small vs. data volume large. A block bitmap is orders of magnitude smaller than the data; a metadata device of tens of MB can track hundreds of GB of block state.
- Network block protocol with adequate fault-tolerance. In Fly.io's case, iSCSI survives network disruption; NBD initially didn't.
- Filesystem-aware
DISCARDsupport. Sparse volumes — the common case — can short-circuit hydration almost entirely if the filesystem can surface unused blocks. See concepts/trim-discard-integration.
Seen in¶
- sources/2024-07-30-flyio-making-machines-move — Fly.io's
cloneprimitive for stateful-Machine migration, built ondm-clone. Canonical wiki source for the block-level instance.
Related¶
- systems/dm-clone — Kernel implementation.
- concepts/kill-copy-boot-migration-tradeoff — The dilemma async clone solves.
- concepts/async-clone-hydration — Git/repo-tier sibling.
- patterns/async-block-clone-for-stateful-migration — The end-to-end migration recipe.
- patterns/blobless-clone-lazy-hydrate — Git-tier recipe.