Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

use merge-patch on finalizer operations to resolve racing conflicts #1389

Merged

Conversation

mars1024
Copy link
Contributor

What this PR does / why we need it:
Patch is more efficient than Update to handle racing conditions on high-frequency changes of objects, which is also recommended by kubernetes spec.

Which issue(s) this PR fixes:
Try to avoid some errors, like https://github.com/kubernetes-sigs/kubefed/blob/4dbd63b07de4b2bcebf3bd2632e0ec08e254f4c3/pkg/controller/sync/controller.go#L283

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 31, 2021
@k8s-ci-robot k8s-ci-robot requested review from makkes and xunpan March 31, 2021 01:57
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 31, 2021
@mars1024 mars1024 force-pushed the feat/patch-replace-update branch from 89ef98e to 053597a Compare March 31, 2021 03:43
@swiftslee
Copy link
Contributor

There are many Update operations. Could you tell me why do you only change the finalizer update operation?

@mars1024
Copy link
Contributor Author

mars1024 commented Apr 1, 2021

There are many Update operations. Could you tell me why do you only change the finalizer update operation?

Actually, this is only the first step. I'll try to use more Patch after this merged.

@swiftslee
Copy link
Contributor

There are many Update operations. Could you tell me why do you only change the finalizer update operation?

Actually, this is only the first step. I'll try to use more Patch after this merged.

@hectorj2f What's your suggestion?

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

I'd like to see a more consistent and global change of Update to Patch operations across the whole code. I agree with @mars1024 here.

@mars1024
Copy link
Contributor Author

mars1024 commented Apr 2, 2021

I'd like to see a more consistent and global change of Update to Patch operations across the whole code. I agree with @mars1024 here.

Thanks for your agreement, @hectorj2f , and I think this PR is already ready as the first step.

@makkes
Copy link
Contributor

makkes commented Apr 6, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 6, 2021
@mars1024
Copy link
Contributor Author

mars1024 commented Apr 9, 2021

friendly ping @hectorj2f for approval or more comments

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

@mars1024 What did it happen with the rest of changes to use Patch instead of Update ?

@mars1024
Copy link
Contributor Author

@mars1024 What did it happen with the rest of changes to use Patch instead of Update ?

Recently I didn't have much time on this, so I opened an help-wanted UMBRELLA issue to track the rest changes.

@hectorj2f
Copy link
Contributor

/lgtm

@hectorj2f
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hectorj2f, makkes, mars1024

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2021
@k8s-ci-robot k8s-ci-robot merged commit 5ee5335 into kubernetes-retired:master Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants