fix(kom): recover deletions missed during downtime - #1556
Draft
Pybsama wants to merge 1 commit into
Draft
Conversation
Warm controller sources before the direct-API recovery scan and gate workers until persisted state has been restored. Preserve recoverable state on read or publish failure and decode persisted keys using the REST-mapped resource scope. Signed-off-by: sama Pyb <peiyibopybsama@gmail.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Contributor
|
@Pybsama this PR has been inactive for 14 days. Do you need help finishing it, or should we close it for now? Feel free to reopen anytime. |
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.
Summary
This preserves the existing exported
LoadState(ctx)API; the manager startuppath uses the new scope-aware recovery method.
Closes #1542.
Why the startup ordering matters
A scan before the controller source starts still leaves a gap: an object can be
present during the scan and disappear before the informer's initial list,
producing neither
NotFoundnor a delete event. The state-loader runnabletherefore waits for the controller's idempotent source warmup first, performs
the direct-API verification second, and only then releases the shared worker
barrier.
If source warmup, state loading, an API read, or recovery publication fails,
Manager.Startreturns the error so the workload can retry instead of runningwith silently stale quarantine state.
Type of Change
Component(s) Affected
Testing
Validation completed on Darwin arm64 with Kubernetes envtest 1.36.2:
go vet ./...go build ./...golangci-lintv2.5.0: 0 issuesmake lint-testgofmtandgit diff --checkThe regression coverage includes a real Manager lifecycle, a Pod deleted with
zero grace while the monitor is stopped, direct reads before the manager cache
starts, non-
NotFoundAPI errors, recovery publication failure, Node deletion,cluster- and namespace-scoped slash/prefix collisions, and state left by a
removed policy.
Checklist