cleanup
Reclaim storage by removing old Lance versions (destructive).
cleanup removes manifests. And the fragments unique to those manifests,
older than a retention policy. It is destructive: once a Lance version is
removed, its data cannot be read via --snapshot. The command runs in
preview mode unless --confirm is passed.
Usage
omnigraph cleanup <path> --keep <N> [--older-than <duration>] --confirm [options]Arguments
| Argument | Required | Description |
|---|---|---|
path | yes | Graph URI (local path or s3://); required unless resolved from --target / --config |
Options
| Option | Required | Default | Description |
|---|---|---|---|
--keep | one of --keep / --older-than | — | Number of recent Lance versions to retain per table |
--older-than | one of --keep / --older-than | — | Only remove versions older than this duration (Go-style: 7d, 24h, 90m, 2w) |
--confirm | yes (to actually delete) | — | Required to run the deletion. Without it, the command prints what it would remove |
--target | no | — | Named graph from omnigraph.yaml |
--config | no | — | Path to an omnigraph.yaml |
--json | no | — | Output stats as JSON |
At least one of --keep or --older-than must be supplied. When both are
set, both must hold for a version to be eligible for removal.
Recovery floor. Keep at least 3
--keep lower than 3 is unsafe. The open-time recovery sweep can roll a
branch back to the manifest-pinned version of an affected table, which is
typically HEAD-1 (and occasionally further back) during a Phase B → Phase C
drift. If --keep drops below 3, recovery may target a version that has
already been garbage-collected, breaking the branch open.
The shipped default of --keep 10 is safe for normal use.
Output
For each table the command returns TableCleanupStats:
| Field | Description |
|---|---|
table_key | The node or edge type whose storage was inspected |
bytes_removed | Disk space freed for that table |
old_versions_removed | Number of Lance versions deleted |
Example
Preview a cleanup without making changes:
omnigraph cleanup ./graph.omni --keep 10 --older-than 30dRun the cleanup for real:
omnigraph cleanup ./graph.omni --keep 10 --older-than 30d --confirmUse the JSON output for monitoring or capacity-planning automation:
omnigraph cleanup ./graph.omni --keep 10 --confirm --json