# Cumulus: cleaning is not immediate reclamation

**Result:** copying live data out of a partially used segment can increase
retained storage until the last snapshot referencing the old segment expires.
Evaluate the complete retained set, not only the newest backup.

## Why the distinction matters

Cumulus's non-in-place cleaner prevents future snapshots from reusing selected
segments. Earlier snapshots retain their original references. This preserves
immutable backup history but delays reclamation.
[FAST 2009, sections 3.5 and 4.2](https://www.usenix.org/legacy/events/fast09/tech/full_papers/vrable/vrable_html/index.html)

The extended journal study separates dead space from duplicate copies created
by cleaning. Its multi-snapshot policy retains seven daily snapshots and older
weekly snapshots, twelve in total. Storage is averaged across the observation
period; daily upload excludes the initial full backup. The reported minimum
is workload- and policy-dependent, not a universal cleaning threshold.
[TOS 2009, section 5.2.3 and Figure 5](https://cseweb.ucsd.edu/~voelker/pubs/cumulus-tos09.pdf)

## Reproducible example

This is an original **constructed accounting example**, not execution of Cumulus
or replication of its experiments. There are two immutable data segments:

- `old` contains object `old/a` with 80 bytes and `old/b` with 20 bytes.
- `new` contains another copy of the same 80-byte content, `new/a`.

Snapshot `s0` needs both old objects. Snapshot `s1` needs only `old/a`.
After copying, snapshot `s2` needs only `new/a`. Creating `s2` does not alter
`s0` or `s1`.

| Retained set | Required stored payload | Unique payload | Stranded payload | Duplicate live payload |
| --- | ---: | ---: | ---: | ---: |
| s1, before copying | 100 | 80 | 20 | 0 |
| s0, s1, before copying | 100 | 100 | 0 | 0 |
| s0, s1, s2 | 180 | 100 | 0 | 80 |
| s1, s2 | 180 | 80 | 20 | 80 |
| s2 only | 80 | 80 | 0 | 0 |

All values are bytes. "Required stored" sums entire segments referenced by at
least one retained snapshot, after collecting all zero-reference segments.
It is not the allocated size of an actual repository directory. The fixture
declares both candidate segments even for states preceding the copy.

Referenced payload counts each physical object once. Unique payload counts
each declared content identity once, even when stored in both segments.
Stranded payload is inside a required segment but unreferenced.
Duplicate live payload is referenced payload minus unique payload.
Thus: **stored = unique + stranded + duplicate**.

Deleting `s0` frees nothing while `s1` still needs `old/a`. A collector
examining `s2` alone would wrongly classify `old` as disposable. The tests
cover all eight retention subsets and three explicit latest-only counterexamples.

## Run and inspect

Use Node.js 22 or later; no packages, credentials or network calls are needed.
Download [fixture.json](fixture.json), [model.mjs](model.mjs),
[model.test.mjs](model.test.mjs), [results.json](results.json) and [table.md](table.md)
into one directory.

```sh
node model.mjs --check
node --test model.test.mjs
```

To recompute the two output files after changing the fixture:

```sh
node model.mjs --write
```

The output records SHA-256 hashes of the model and fixture. Invalid references,
duplicate identities, inconsistent content lengths and unsafe integer counts
are rejected. The model never deletes files or contacts a backup repository.

## Scope and interpretation

The declared content identities are assumptions, not cryptographic verification.
The example omits metadata, TAR framing, compression, encryption, object slices,
transfer/request charges, concurrent changes and retention locks. It cannot select
a production cleaning threshold or predict a bill. Real garbage collection also
requires a complete, trustworthy inventory and appropriate concurrency controls.

The historical format has segment-relative object addresses, optional slices and
a descriptor containing the root and segment inventory. A referenced slice still
requires its containing segment. Its version heading and descriptor example differ;
this guide does not claim to validate either wire format.
[Official format documentation](https://www.sysnet.ucsd.edu/projects/cumulus/doc/format.txt)

The design notes distinguish direct block references from chains of patches.
Independently removable snapshot descriptions can still share underlying storage.
[Official design notes](https://www.sysnet.ucsd.edu/projects/cumulus/doc/design.txt)

## Provenance

Source review and model created 2026-12-02 by Hesela.
Paper authors: Michael Vrable, Stefan Savage and Geoffrey M. Voelker.
FAST 2009: pages 225-238. Expanded ACM TOS 5(4), article 14:
DOI [10.1145/1629080.1629084](https://doi.org/10.1145/1629080.1629084).
These are related publications, not two independent empirical confirmations.
The underlying historical traces and Cumulus executable were not run.

[Canonical Cumulus record](https://hesela.dev/terms/cumulus/) /
[Incremental backup](https://hesela.dev/terms/incremental-backup/) /
[Recovery verification context](https://hesela.com/analyses/backup-verification-is-not-a-restore-test/).

Code, fixture and tables in this directory are original Hesela work.
No paper text, upstream code or historical trace is redistributed.
