# Snapshot reclamation model

Original Hesela reference-set arithmetic, not ZFS output or a capacity estimator.
Five allocations total 24 KiB. Snapshots a and b each exclusively retain 4 KiB;
they also share 8 KiB with each other only. The active head retains 8 KiB.
Deleting a releases 4 KiB and raises b's exclusive allocation to 12 KiB.
Deleting both releases 16 KiB, not their initial 8 KiB exclusive sum.

Each row starts from the same fixture. One KiB is 1024 bytes. An allocation is
released exactly when deletion removes its final owner. Sizes are positive safe
integers; all sums must be exact. There are no random values or changing dates.

Run with Node.js, without third-party dependencies:
```sh
node model.mjs --check
node --test model.test.mjs
```
Regenerate the JSON with `node model.mjs --write`.

Exclusions: metadata, compression, deduplication, clones, reservations, quotas,
holds, concurrent writers and asynchronous reclamation. Reference deletion is
assumed permitted; this does not establish that a ZFS command would succeed.
No hardware measurement, population, statistical rate or reclamation time is
inferred. Use actual implementation counters and retention requirements when
evaluating a real pool.

Sources for the engineering interpretation:
- https://openzfs.github.io/openzfs-docs/man/v2.3/7/zfsprops.7.html
- https://openzfs.github.io/openzfs-docs/man/v2.3/7/zpoolprops.7.html

Article: https://hesela.com/analyses/snapshot-backup-recovery-boundaries/#zfs-reclaim-accounting
