Orphan cleanup
An orphan is a managed relationship whose expected source volume UUID is absent from several
consecutive complete source observations. A single missing observation is never enough — a transient
read blip is absorbed by debounce — and because its
destination may contain the only surviving copy, DonkeyFleet never deletes an orphan automatically.
manual, approve, and auto modes all require explicit human approval.
Controller-created relationships and explicitly bound adopted relationships participate in this flow. Unbound adopted and suspended relationships are excluded by database queries.
Decision flow
Parameters and gates
| Parameter or state | Effect |
|---|---|
| Automation-profile binding | Grants a previously adopted relationship eligibility for orphan transition and cleanup review; it never grants automatic deletion |
reconcile.orphan-debounce-observations | Consecutive complete observations a source must be missing before its relationship is eligible to transition (default 3); a reappearance or any incomplete run resets the streak |
max_orphan_transitions_per_run | Absolute per-profile transition limit. If the missing count is greater than the limit, the complete Observe run is rejected and no relationship transitions |
max_orphan_transitions_pct | Optional per-profile percentage limit, evaluated with the absolute limit. Exceeding either limit blocks all transitions in that run |
| One-shot guardrail override | An approver may acknowledge a blocked profile from its guardrail notification to let that profile's orphan batch transition on the next reconcile — once, that profile only, expiring in 24 hours. It never changes the limits and never authorizes deletion |
orphan_grace_hours | Earliest time a cleanup proposal may be created, measured from persisted orphaned_at |
max_actions_per_run | Limits new destination cleanup steps started for a profile in one run; persisted jobs are still polled and recovered |
reconcile_mode | Does not change deletion authorization: every mode produces awaiting_approval |
| Effective dry-run | Blocks both deletion calls even after approval |
The transition limits protect against incomplete or unexpectedly broad source visibility loss. They are not deletion limits: they stop the lifecycle transition before any approval is possible.
Debounce and the one-shot override
A source UUID that disappears is not orphaned on the first complete observation. DonkeyFleet advances
a per-relationship missing streak and only begins the transition once the source has been absent
from reconcile.orphan-debounce-observations (default 3) consecutive complete reconciles. A
reappearance — or any incomplete run, which is never counted — resets the streak. This absorbs a
transient read blip or a single skipped cluster that would otherwise look like a mass source deletion.
When the missing count for a profile still exceeds max_orphan_transitions_per_run or
max_orphan_transitions_pct, the guardrail aborts the whole Observe run and raises an urgent
notification for that profile — no relationship transitions. That notification links to an
Acknowledge page, where an approver (the approve or administer role) can record a one-shot
override. The override lets that profile's orphan batch transition on the next reconcile and is:
- per profile — it never affects another profile's guardrail;
- one-shot — it is spent by the next run that applies the batch;
- time-boxed — it expires 24 hours after it is acknowledged if unused.
The override only releases the transition tripwire; it does not loosen the standing limits and deletes nothing. Each resulting orphan still passes through grace, a cleanup proposal, and per-item approval before any destination-side deletion.
What approval authorizes
The approval payload freezes the exact source volume UUID, destination volume UUID, SnapMirror relationship UUID, SVM route, orphan timestamp, grace eligibility time, automation profile, and action cap. Apply locks the current relationship and rejects the work if those values no longer match.
After approval and a successful revalidation, DonkeyFleet performs only destination-side work:
- delete the destination SnapMirror relationship;
- persist and poll its ONTAP job until observation confirms it is absent;
- delete the destination volume with
force=false; - persist and poll its job until observation confirms it is absent;
- resolve the cleanup intent and write audit history.
No step writes to the source cluster. If a pod or node stops, PostgreSQL retains the current step and job UUID so another replica continues from the checkpoint instead of starting over.
Approval authorizes permanent destination data deletion. Independently verify source identity,
retention requirements, and the exact destination before approving. A source that was replaced
(same name, new UUID) is detected automatically and reclassified to source_replaced drift rather
than an orphan, so it does not reach this queue — still, confirm the destination you are deleting
has no live source under a different UUID before approving.