[oadp-1.5] Fix DPA reconcile race: use MergeFrom patch for status update - #2357
[oadp-1.5] Fix DPA reconcile race: use MergeFrom patch for status update#2357kaovilai wants to merge 2 commits into
Conversation
Status().Update requires an exact resourceVersion match, so concurrent
reconciles racing on the same DPA hit optimistic-lock conflicts
("the object has been modified"). Switch to a Status().Patch with
client.MergeFrom(origDpa), which doesn't check resourceVersion, so it
no longer fails when another reconcile loop updated the object first.
Fixes openshift#2236
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
The original wording blamed "concurrent reconciles", but controller-runtime serializes reconciles per object key (single leader-elected replica), so two reconciles of the same DPA never run concurrently. The real cause is a stale informer-cache read racing a prior status write. Fable review round 1 caught this. Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.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 |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, shubham-pampattiwar, sseago The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@kaovilai: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Cherry-pick of #2353 onto oadp-1.5.
Conflict resolution: oadp-dev had
updateReadinessConditionscode not present in oadp-1.5; resolved by keeping the oadp-1.5 structure and only applying theUpdate→Patch(MergeFrom)change.Note
Proposed by chai-bot (redhat-chai-bot), opened as draft via Claude Code.