Skip to content

[oadp-1.6] Fix DPA reconcile race: use MergeFrom patch for status update - #2356

Open
openshift-cherrypick-robot wants to merge 2 commits into
openshift:oadp-1.6from
openshift-cherrypick-robot:cherry-pick-2353-to-oadp-1.6
Open

[oadp-1.6] Fix DPA reconcile race: use MergeFrom patch for status update#2356
openshift-cherrypick-robot wants to merge 2 commits into
openshift:oadp-1.6from
openshift-cherrypick-robot:cherry-pick-2353-to-oadp-1.6

Conversation

@openshift-cherrypick-robot

Copy link
Copy Markdown
Contributor

This is an automated cherry-pick of #2353

/assign kaovilai

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>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3c0ab37b-aa1e-42d8-a022-337c858bc451

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@kaovilai kaovilai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 5, 2026
@kaovilai

kaovilai commented Aug 5, 2026

Copy link
Copy Markdown
Member

/test tide

@kaovilai

kaovilai commented Aug 5, 2026

Copy link
Copy Markdown
Member

need 1 more reviewer

@sseago

sseago commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 5, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 8d303c2 and 2 for PR HEAD c18c5ce in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD f230e1d and 1 for PR HEAD c18c5ce in total

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

@openshift-cherrypick-robot: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [kaovilai,shubham-pampattiwar,sseago]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants