Repository navigation
OSAC-3548: Fix premature restart_trigger echo in syncStatus - #1005
mennyaboush wants to merge 1 commit into
Conversation
|
@mennyaboush: This pull request references OSAC-3548 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe reconciler now requires matching operator specification and status restart triggers before it clears restart conditions and updates fulfillment status. Tests cover completed and incomplete restart synchronization. ChangesRestart synchronization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The fulfillment controller reconciles within milliseconds of a restart_trigger update (event-driven via pg_notify) and reads stale PowerSynced=True from the K8s CR before the operator has processed the restart. This caused it to prematurely echo status.restart_trigger, making restartPending=false permanently and leaving the BMI stuck in STARTING state. Guard the trigger echo on the operator having also echoed Status.RestartTrigger on the CR (object.Spec.RestartTrigger == object.Status.RestartTrigger). The operator only writes this after the restart truly completes, so a stale PowerSynced=True from before the restart is correctly skipped. Fixes: https://redhat.atlassian.net/browse/OSAC-3548 Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: MENNY ABOUSH <maboush@maboush-thinkpadt14gen5.raanaii.csb>
1d9191f to
ce4d788
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ajamias, mennyaboush The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary
Fix a race condition where the fulfillment controller prematurely echoes
status.restart_triggerbefore the operator has processed the restart, leaving the BMI permanently stuck inStartingstate.Root Cause
The fulfillment controller is event-driven via
pg_notifyand reconciles within milliseconds of arestart_triggerupdate. It reads stalePowerSynced=Truefrom the K8s CR (the operator hasn't acted yet) and interprets it as "restart completed", echoingstatus.restart_trigger = spec.restart_trigger. This makesrestartPending=falsepermanently, and theif !restartPending { continue }guard insyncStatus()skips allPowerSyncedprocessing forever.Fix
Guard the trigger echo on the operator having also echoed
Status.RestartTriggeron the K8s CR (object.Spec.RestartTrigger == object.Status.RestartTrigger). The operator only writes this after the restart truly completes (line 638 ofbaremetalinstance_controller.go), so a stalePowerSynced=Truefrom before the restart is correctly skipped.Testing
Status.RestartTriggermatching (happy path)Evidence
Bug reproduced on CI (4 consecutive runs on osac-test-infra PR #277) and on remote dev cluster (osac-sno). Detailed analysis in OSAC-3548.
Jira
OSAC-3548
Related
Assisted-by: Claude Code noreply@anthropic.com
Summary by CodeRabbit