Skip to content

[eno][backup 5/7] Record synthesis inventory - #657

Closed
Ruinan Liu (ruinan-liu) wants to merge 4 commits into
users/ruinanliu/backup-2-corefrom
users/ruinanliu/backup-5-inventory-recording
Closed

Ruinan Liu (ruinan-liu) wants to merge 4 commits into
users/ruinanliu/backup-2-corefrom
users/ruinanliu/backup-5-inventory-recording

Conversation

@ruinan-liu

Copy link
Copy Markdown
Collaborator

Summary

Complete the opt-in backup lifecycle by recording inventory after recovery finishes and the current synthesis becomes ready. This PR is stacked on #655.

Behavior

  • Build the current synthesis inventory from its complete ResourceSlice set after readiness.
  • Create and verify the synthesis-specific ConfigMap in downstream kube-system.
  • Preserve historical inventory when recovery recorded an unresolved inventory read or invalid inventory.
  • Delete other inventories in the same namespace-and-synthesizer lineage only after the replacement is persisted and verified.
  • Keep inventory recording status-free; it does not modify Composition status or repeat the recovery diff.

Race conditions

  • Re-read the Composition directly before snapshot creation and before each old-inventory deletion, requiring the same current synthesis UUID, readiness, and nondeleting state.
  • Include the synthesis UUID in the snapshot name so obsolete work cannot overwrite a newer synthesis snapshot.
  • On AlreadyExists, verify the stored snapshot exactly instead of treating existence as success or overwriting it.
  • Delete only inventories returned by the operation's initial lineage-scoped list, with UID and resourceVersion preconditions to protect replaced or modified ConfigMaps.

These checks reject obsolete operations but are not a cross-cluster transaction; a synthesis may still change immediately after a freshness read.

Stack

  1. Recovery API and helper foundation.
  2. [eno][tombstone-recovery 4/7] Recover missing tombstones #655: tombstone recovery controller and gate.
  3. This PR: ready-synthesis inventory recording and rotation.

Inventory retirement and periodic garbage collection remain follow-up work. End-to-end coverage for backup and tombstone recovery will be added in a later effort.

Define synthesis-scoped recovery completion, reset recovery requirements for each synthesis, and share resource identity semantics between normal slicing and inventory diffing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2560c464-3bb6-4181-bcc5-68520a598fa3
Keep the per-synthesis recovery expectation and generated API persistence coverage with the foundation behavior they verify.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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
Persist and verify ready synthesis inventory snapshots, then rotate superseded lineage snapshots with freshness and object preconditions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2560c464-3bb6-4181-bcc5-68520a598fa3
@ruinan-liu
Ruinan Liu (ruinan-liu) force-pushed the users/ruinanliu/backup-5-inventory-recording branch from fa6ebac to 7bc7ab5 Compare September 21, 2026 21:06
@ruinan-liu
Ruinan Liu (ruinan-liu) removed this pull request from stack #658 September 28, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant