Repository navigation
✨ feat(sink): retract exported objects on inventory deletion, un-wedge finalization (K-28/K-29/K-30) - #382
Closed
konih wants to merge 1 commit into
Closed
✨ feat(sink): retract exported objects on inventory deletion, un-wedge finalization (K-28/K-29/K-30)#382konih wants to merge 1 commit into
konih wants to merge 1 commit into
Conversation
…e finalization
K-28/C-2a: inventory deletion now deletes its exported snapshot objects
(git both engines, gitlab, s3/gcs, local) including deterministic .part
siblings and the parquet hive partition; backends that cannot retract,
git layout trees (explicit or auto-upgraded), {generation} templates and
merge-request mode announce CleanupRetained instead of a false clean
tombstone.
K-29: a sink CR deleted before its inventory no longer wedges deletion:
cleanup completes with a CleanupSinkGone event and the finalizer is
removed.
K-30: terminal cleanup wedges increment kollect_cleanup_terminal_total
and the kollect.dev/force-cleanup annotation (deletion-time only) drops
the finalizer without backend contact, announcing CleanupForced.
Known limits (documented): catch-up pathTemplate/format drift orphans
old-path objects; hive-sanitized name collisions share a partition; a
cascade-deleted credentials Secret still wedges as terminal.
Signed-off-by: Konrad Heimel <[email protected]>
Collaborator
Author
|
Superseded by #383, which contains this commit's change (retract-on-deletion), now opt-in via |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
Terminatingwhen its sink was deleted first; terminal cleanup wedges become alertable and escapable. Fixes K-28, K-29, K-30 (unify-report batch B6, captain call C-2a).inventory/<ns>/<name>identity + deterministic part siblings — sibling-inventory safety is test-locked).internal/sink/cleanup.go(routing + when retention must be announced) first; the enginedelete.gofiles then follow from it.Summary
sink.ExportCleaner(new seam):DeleteExport(ctx, paths) ([]string, error)returns what was actually removed;sink.RunCleanupExportroutes relational sinks to the existing empty-export prune, cleaner backends to object deletion, and everything else to an announced retention (CleanupRetainedWarning Event, deletion still completes).spec.layout.mode: document), the sinkpathTemplatecontains{generation}, or GitLab runsmerge_requestmode (retraction lands only at MR merge).apierrors.IsNotFoundon sink resolution during finalization →CleanupSinkGoneevent, finalizer removed, no requeue (namespaced + cluster). Transient errors still retry; terminal errors still retain the finalizer.kollect_cleanup_terminal_total{kind}(registered, catalogued, docs row, alert rule in troubleshooting) increments on terminal cleanup retention; newkollect.dev/force-cleanup: "true"annotation drops the finalizer only while deleting, without contacting backends, and recordsCleanupForced.git ls-remote) finds a feature branch already pushed (recovery of a commit stranded by a crashed attempt); no-op deletes skip the API call entirely, and the CLI engine no longer pushes pointer-only feature branches.Things to look at first
internal/sink/cleanup.go— the outcome contract (Cleaned / Pruned / Retained) and the announce gates.internal/sink/git/delete.go— both engines reuse the export lock, force-fetch semantics, staged-deletion delivery, pathspec-scoped staging (foreign mirror dirt is never committed).internal/controller/sink_cleanup.go+ both finalizers — announcement wiring, force-cleanup ordering.Risk
CleanupMatchers: exact stem + deterministic part suffix, hive partition confined to thename=segment directory); prefix-sharing siblings (appvsapp-v2) are regex-rejected before deletion and test-locked across engines.docs/operator-manual/troubleshooting.md): objects exported under a previous sinkpathTemplate/formatare unaddressable at deletion (no persisted export-path state); hive-sanitized name collisions (app-v2/app_v2) share a partition that export already co-mingles; a cascade-deleted credentials Secret still wedges as terminal (now alertable + escapable via force-cleanup); after deleting an inventory, do not merge stale unmerged export MRs on GitLab feature branches.kollect_export_duration_secondsdeliberately does not observe cleanup latency.Test evidence
task testgreen (envtest included);make lint+ go-arch-lint + markdownlint clean.Coordination notes
internal/metricswill see a trivial conflict here.api/v1alpha1/constants.goonly (no CRD schema change).