feat(hotfix): record per-component finalize state and scope hotfix tags - #523
Merged
Merged
Conversation
A hotfix on a selected component now records its state at state.components.<name>.<env> through the scoped serializer instead of rewriting the whole flat state node, so a concurrent hotfix on another component keeps its recorded state intact across the CommitWithRetry re-apply on a 409. The finalizer overlays the component's persisted rows, re-applies the hotfix, and node-patches only its own subtree; an empty component keeps the flat path, byte-identical. Hotfix tags resolve through the component's tag grammar (strict prefix), so a hotfix tag is created and looked up in the component's namespace and never cross-matches a sibling. The finalizer records env/<component>/<env> for a component and env/<env> otherwise. Refs #293. Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
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.
Problem
The hotfix finalizer records state via a whole-flat-node rewrite, so on a multi-component manifest a concurrent hotfix on one component would drop a sibling's
state.components.*under theCommitWithRetry409 re-apply. Hotfix tags are also not component-namespaced.Fix
component(threaded from--component). When set, it overlays the component's persisted rows, re-applies the hotfix, and node-patches onlystate.components.<name>.<env>viaWriteScopedState, preserving sibling subtrees. Empty component keeps the flatWriteManifestStatepath, byte-identical.env/<component>/<env>for a component,env/<env>otherwise.Scope is finalize state, tag scoping, and the env-branch name inside finalize. The promote rejoin cleanup and the generator emitting
--componenton the hotfix step are separate changes; until the generator wiring lands, the component path is inert.Verification
go build ./...,go test ./...(2624 pass),go test -raceon hotfix+config (677 pass),golangci-lint run ./...clean; single-component byte-identical baseline gate green. The load-bearing concurrency testTestHotfixFinalize_ConcurrentFinalize_SiblingSurvivesThrough409Reapplydrives the realhotfixMutation -> CommitWithRetrypath: a 409-once fake injects a concurrent sibling's subtree; this component's node lands while the sibling survives verbatim including an unmodeled key. A byte-identical single-component test proves the empty-component mutation equals the directWriteManifestStatereference.Refs #293.