← Back to Pull requests

PSAP-2229: Prevent multiple reboots via MachineConfig creation/update sync #1474

Closed
unknown closed this pull request without merging on Mar 13, 2026 01:20 UTC
View on GitHub
unknown unknown commented on Feb 20, 2026 13:26 UTC
Author

Problem
-------
When a PerformanceProfile is created or updated, two separate MachineConfigs are written by two independent controllers:

- 50-nto- written by the NTO operator controller
- 50-performance-
written by the PerformanceProfile controller

MCO batches MachineConfig renders with a 5-second renderDelay window. If the two writes do not land within that window, MCO renders them separately, causing two node reboots instead of just one.

Solution
--------
Replace racy in-memory bootcmdline cache with a Tuned CR generation-aware, synchronization protocol between the operator controller and the PerformanceProfile controller.

1. The operator controller stores a new dependency annotation tuned.openshift.io/bootcmdline-deps on each Profile CR in the format: <RELEASE_VERSION>,<tuned-name1>:<gen1>,...<tuned-nameN>:<genN> . The tuned-daemon controller (pkg/tuned/controller.go) then propagates this dependency to the Node as the same tuned.openshift.io/bootcmdline-deps annotation alongside the existing tuned.openshift.io/bootcmdline annotation.

2. allNodesHaveCurrentBootcmdlineDeps(): eliminate the previous unreliable in-memory bootcmdline cache by checking every node in the pool has computed its bootcmdline from the same generation of Tuned CRs.

3. Added cross-controller synchronization primitive pkg/sync/bootcmdline.go:

- The PerformanceProfile controller calls IsReady(pool, "<performance-tuned-cr-name>:<gen>") before writing 50-performance-. If not ready it returns BootcmdlineNotReadyError which requeues after 30s -- fallback mechanism -- shouldn't ever happen under normal circumstances.
- The operator controller calls SignalReady(pool, bootcmdlineDeps) via a deferred call immediately after a successful 50-nto-
MachineConfig create/update. The signal carries the full bootcmdlineDeps string so the PerformanceProfile controller can verify it is based on the current performance Tuned CR generation. SignalReady() also sends the pool name to a channel, to immediately wake up PerformanceProfile controller reconciliation.

4. The PerformanceProfile controller now always creates/updates the Tuned CR first and returns early to wait for the bootcmdline-ready signal before writing its MachineConfig.

5. GetMutatedTuned now returns (Tuned, bool, error). The Tuned object is always returned (even when unchanged) so callers can read its .Generation field to construct the expected bootcmdline dependency string without an extra API call.

The same protocol is applied to the HyperShift handler, using the NodePool name as the pool key instead of the MCP name.

Unit tests are updated to reflect the new two-phase reconcile sequence (first reconcile creates/updates Tuned; second reconcile creates MachineConfig after signalBootcmdlineReady()).

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

Release Notes

New Features
Added bootcmdline dependency tracking and synchronization across cluster nodes to ensure consistent bootcmdline parameters.
Introduced bootcmdline readiness validation to coordinate resource creation and prevent incomplete deployments.
Extended HyperShift support for bootcmdline synchronization.

Improvements
Enhanced per-node bootcmdline status logging and conflict detection for better visibility into synchronization state.
Improved resource creation ordering for bootcmdline-dependent configurations.

Tests
Added bootcmdline synchronization tests with concurrent access scenarios.
* Updated existing test suite to validate new bootcmdline synchronization flows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 471 lines (+353 / -118) across 5 files Reviewer: jmencak Review duration: 29513m
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.69) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.69 · 471 lines diff across 5 files
0.69
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.368
Shallow Review Depth shallow_review_depth
0.289
Sensitive Paths sensitive_paths
0.069
Real PR Conversation Timeline
1 comments
"Review active on #1474"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 68.9% (HIGH) · Higher = larger blast radius
68.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 27.2% · Safe to merge
27.2%