Repository navigation
[eno][tombstone-recovery 4/7] Recover missing tombstones - #655
Conversation
45144ee to
3dadfa0
Compare
01364ae to
97b9c4a
Compare
97b9c4a to
e21ebcb
Compare
## Summary Add the API and shared helper foundation required by tombstone recovery, without registering a controller or changing deployed reconciliation behavior. ## Behavior - Add synthesis-bound `TombstoneRecoveryFinished` status and `TombstoneRecoveryComplete()`. - Compute `TombstoneRecoveryRequired` independently for each synthesis instead of inheriting it. - Share group/kind/namespace/name identity resolution between normal synthesis and recovery inventory diffing, including Patch targets. - Retain appended tombstones when ResourceSlice status has not yet grown to include their manifest index. - Export the ResourceSlice packing byte limit for recovery overflow packing. ## Stack This is the first of three PRs split from #655: 1. **This PR:** recovery API and helper foundation. 2. #655: opt-in tombstone recovery controller and reconciliation gate. 3. Follow-up stacked PR: ready-synthesis inventory recording and rotation. End-to-end coverage for backup and tombstone recovery will be added in a later effort. --------- Copilot-Session: 2560c464-3bb6-4181-bcc5-68520a598fa3
Add the opt-in recovery controller, synthesis gate, guarded ResourceSlice writes, recovery-only overflow cleanup protection, and namespace-isolated watches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2560c464-3bb6-4181-bcc5-68520a598fa3
Keep recovery eligibility aligned with reconstitution, preserve unfinished recovery across successor syntheses, and extend partial ResourceSlice status before writing appended tombstones. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4ad9821f-f3c9-4c1a-9f4e-85b93cbf1852
e21ebcb to
a609882
Compare
Ruinan Liu (ruinan-liu)
left a comment
There was a problem hiding this comment.
reply to comments
|
A recreated Composition can produce zero resources while downstream inventory still contains historical resources requiring deletion. If reading that inventory fails temporarily, recovery remains unfinished. The new gate blocks reconstitution, but the separate ResourceSlice controller can still mark the empty synthesis Ready. Dependent Compositions then proceed before the missing tombstones have been recovered and processed. Fix: also gate readiness publication on recovery completion when recovery is enabled. eno/internal/controllers/resourceslice/slice.go Lines 178 to 192 in a609882 eno/internal/controllers/scheduling/dependency.go Lines 10 to 19 in a609882 |
|
rename internal/controllers/backup to internal/controllers/tombstonerecovery ? |
ResourceSlice status aggregation now withholds both Ready and Reconciled for recovery-opted-in, non-deleting Compositions until TombstoneRecoveryComplete() confirms a terminal decision for the current synthesis UUID, including empty syntheses. Reconstitution records an explicit terminal decision when recovery is disabled or the Composition is outside the recovery namespace, avoiding an indefinite readiness wait. After recovery completes, normal resource readiness checks still apply. Aggregation also treats a status array shorter than spec.resources as unfinished, so newly appended tombstones cannot be overlooked. |
Ruinan Liu (ruinan-liu)
left a comment
There was a problem hiding this comment.
Reply to comment
Ruinan Liu (ruinan-liu)
left a comment
There was a problem hiding this comment.
reply comment
Ruinan Liu (ruinan-liu)
left a comment
There was a problem hiding this comment.
Respond to comments
Summary
Add an opt-in tombstone recovery controller that restores missing deletion instructions from saved inventory. Gate reconstitution and readiness until the current synthesis has a terminal recovery decision.
This PR reads existing inventory snapshots; recording and rotation are in a follow-up PR.
Behavior
--enable-tombstone-recovery. Recovery requiresPOD_NAMESPACEand watches Compositions within that namespace, respecting--composition-label-selector.eno.azure.io/recovery-enabled: "true"opt into recovery. Recovery eligibility does not evaluate--resource-filter; normal resource filtering remains unchanged.TombstoneRecoveryRequiredis true; otherwise recordNotNeeded.ReconciledandReadyfor opted-in, non-deleting Compositions until recovery reaches a terminal decision. Normal resource-status checks still apply afterward, including status entries for newly appended tombstones.TombstoneRecoveryOperatorNotEnabledorOutsideRecoveryNamespace. These decisions release the gates but preserve any outstanding recovery obligation for successor syntheses.Race Conditions and Deletion Safety
Deleted: true.These safeguards are not a cross-object or cross-cluster transaction. This PR does not fix the pre-existing executor slice-UUID assignment issue or eliminate the downstream race where an already-running deletion overlaps a newer synthesis that wants the resource.
AKS Deployment Assumptions
eno-reconciler.Stack and Follow-ups
End-to-end coverage is deferred to a later effort. Secret-based inventory storage and admission-policy protection are separate follow-up items.