Repository navigation
fix(components): separate Synced condition from Ready on CMS errors - #1227
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new Synced condition to track control-plane synchronization with the Component Management System (CMS). When transient CMS RPC errors occur, the reconciler now sets Synced=False while preserving the last known Ready condition and status.access (or setting Ready=Unknown with reason InitialSyncPending if it is the first reconcile). It also adds corresponding unit tests, updates the CRD definition, and updates the documentation. There are no review comments provided, so I have no feedback to evaluate.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Synced condition to track control-plane synchronization with the Component Management System (CMS). When CMS RPC failures occur, the reconciler now sets Synced=False (reason CMSSyncFailed) while preserving the component's last known Ready condition and status.access (or setting Ready=Unknown with reason InitialSyncPending if it is the first reconciliation). The changes span the CRD definition, reconciler lifecycle logic, helper functions, and documentation, backed by comprehensive unit tests. I have no feedback to provide as there are no review comments to assess.
fdc3a52 to
2538ac0
Compare
05ded1d to
8422036
Compare
8422036 to
deead7c
Compare
b826ced to
a498780
Compare
0129ab8 to
6744ac3
Compare
3e58bd8 to
aa3e808
Compare
aa3e808 to
0b62fa4
Compare
0b62fa4 to
6fe7c00
Compare
Decouple control-plane synchronization status (Synced=True/False with CMSSynced/CMSSyncFailed) from data-plane readiness (Ready) so transient CMS outages do not flip healthy components to Ready=False or drop status.access. Components that fail their initial CMS sync before readiness is evaluated report Ready=Unknown with reason InitialSyncPending. Bug: 548436300 TAG=agy CONV=d833b0e6-4821-48f6-8576-776d53f55a5c
Move the SetComponentIntent error classification out of applyIntent into handleIntentError so the nested Synced/cycle/sync-failure branches stay within the golangci-lint nestif limit. No behavior change. Bug: 548436300 TAG=agy CONV=d833b0e6-4821-48f6-8576-776d53f55a5c
On a transient SetComponentIntent failure, an already-actuated enabled component keeps its local health evaluation (no CMS call, no Helm upgrade) at the last evaluated generation, so Ready reflects the latest probe while Synced=False. Ready=True is preserved only while spec.enabled; a disabled component whose deactivation cannot reach CMS reports Ready=Unknown/CMSSyncFailed. Bug: 548436300 TAG=agy CONV=d833b0e6-4821-48f6-8576-776d53f55a5c
A dependency cycle, an unregistered dependency or a deactivation blocked by enabled dependents is a CMS policy decision, not a CMS outage: the bridge's write path to CMS is healthy, so Synced stays True and the block is reported by Ready instead. Document this in the Synced row so operators do not read Synced=True as "converged". Bug: 548436300 TAG=agy CONV=b2ebecbe-c04a-4fb7-a16c-d23de82ed3e5
…and outage probing Ensure shouldSyncToCMS returns true when recovering from Synced!=True so multi-pass CMS recovery always executes UpdateObservedGeneration, and use wasComponentPreviouslyActive in isActuated so 3P wrappers without spec.dependencies continue probing local health across Ready transitions during a CMS outage. Comment links: #1227 (comment) #1227 (comment) Bug: 548436300 TAG=agy CONV=d833b0e6-4821-48f6-8576-776d53f55a5c
…StringMap - Handle the dependency cycle case first in handleIntentError so the CMS sync failure path runs last without nesting; a nil reportGated error still returns the plain wrapped intent error. - Return nil for an empty map[string]any in extractStringMap before allocating. Bug: 548436300 TAG=agy CONV=d833b0e6-4821-48f6-8576-776d53f55a5c
c4372c0 to
f53b0ba
Compare
There was a problem hiding this comment.
🤖 Incremental PR Approval
Clean rebase detected with zero semantic patch lines changed.
Preserving prior approval by @janzak-dev on commit c4372c0.
There was a problem hiding this comment.
🤖 Incremental PR Approval
Clean rebase detected with zero semantic patch lines changed.
Preserving prior approval by @janzak-dev on commit c4372c0.
Summary
Adds a
Syncedcondition that reports control-plane sync with CMS separately from data-plane readiness. A transient CMS error now setsSynced=False/CMSSyncFailedand keepsstatus.access. Workloads that are already running keep being health-probed, soReadyfollows the latest local probe instead of flipping toFalse.Motivation & Context
A CMS outage used to flip healthy Components to
Ready=Falseand dropstatus.access, which blocks experiment placement even though the workloads are fine.Key Changes
Syncedcondition (CMSSynced/CMSSyncFailed) and aSyncedprinter column in the CRD.recordCMSSyncFailurekeepsstatus.accesswhen a CMS RPC fails. It reads the old value back viaParseAccessFromUnstructuredinto the newExistingAccessinput.SetComponentIntentfails transiently, an already-actuated enabled Component keeps local health evaluation (refreshLocalHealth) at the last evaluated generation. That pass makes no CMS call and runs no Helm upgrade, soReadyshows real local failures.Ready=Trueis kept only whilespec.enabled. A disabled Component whose deactivation can't reach CMS reportsReady=Unknown/CMSSyncFailed.Ready=Unknown/InitialSyncPending.CMSDeletionFailed/CMSDeactivationFailedReady reasons.Stack Position
Assumptions
Ready=Trueonly while enabled). Unit tests cover the new behaviour. If this is wrong, the CMS-outage checkpoint must be re-run before merge.Verification & Testing
bazel test //pkg/components/bridge/...(newTestReconcileComponent_CMSOutageRefreshesLocalHealth).bazel build //pkg/components/... //cmd/xmc_bridge/... //cmd/actuator/...and the bridge tests.//test/e2e:components_lifecycle_testpassed with the whole stack applied (before the hardening commit).tools/analyze_diff_size.py): 204 prod / 289 test / 5 doc lines.golangci-lint run(v1.64.6) clean on./pkg/components/bridge/....Live Deployment & Manual Testing
enable_components: true, Spanner-backed CMS), upgraded with the dev-environment upgrade script.5/5,16/16pods Ready) before and after the checkpoint.mainand before the hardening commit.SyncedconditionSynced=True (CMSSynced)alongsideReady=True (ComponentHealthy).clickhouseandmt-cp1-syncwent toSynced=False (CMSSyncFailed).Ready=True(samelastTransitionTime) andstatus.access.envVarswere kept.mt-cp1-init)Synced=FalseandReady=Unknown (InitialSyncPending); after recovery it becameSynced=TrueandReady=True.Related Issues / Bugs
Bug: 548436300
TAG=agy
CONV=d833b0e6-4821-48f6-8576-776d53f55a5c
Stack created with GitHub Stacks CLI • Give Feedback 💬