[oadp-1.6] Fix DPA reconcile race: use MergeFrom patch for status update - #2356
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 |
kaovilai
left a comment
There was a problem hiding this comment.
Cherry-pick of #2353. Snapshots the DPA before reconcile mutates it and switches the final status write from Update() to Patch(MergeFrom(origDpa)), avoiding optimistic-lock conflicts when the informer cache lags a concurrent status write. Sound, minimal fix, no unresolved review threads.
Note
Responses generated with Claude
|
/test tide |
|
need 1 more reviewer |
|
/lgtm |
|
@openshift-cherrypick-robot: 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, openshift-cherrypick-robot, 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 |
This is an automated cherry-pick of #2353
/assign kaovilai