Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mci finalizer with patch operation #18

Merged

Conversation

XiShanYongYe-Chang
Copy link
Member

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

In large-scale scenarios, when a large number of MCI objects are created in a short period of time, errors will occur more frequently: the object has been modified please apply your changes to the latest version and try again. It caused an error in adding the finalizer and re-entering the queue to wait for reconcile. However, due to the large number of elements in the queue, the current queuing time of the elements is longer. long.

So add mci finalizer with patch operation.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Apr 2, 2024
@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 2, 2024
@RainbowMango
Copy link
Member

It caused an error in adding the finalizer and re-entering the queue to wait for reconcile.

Can you provide a log? I'd like to see which line of code conflicts.

Signed-off-by: changzhen <changzhen5@huawei.com>
@RainbowMango
Copy link
Member

@XiShanYongYe-Chang It is quite suspicious that the conflict occurred at the beginning of the reconcile process.
Shall we open an issue to track this problem?

@XiShanYongYe-Chang
Copy link
Member Author

XiShanYongYe-Chang commented Apr 2, 2024

This problem does not occur when the code on the master branch is used for local build and test. It occurs during secondary development of a third-party platform.

@RainbowMango
Copy link
Member

This problem does not occur when the code on the master branch is used for local build and test. It occurs during secondary development of a third-party platform.

Yeah. We can't control how the cloud provider implements or modifies the MCI objects. From this perspective, we can move this forward.

@XiShanYongYe-Chang
Copy link
Member Author

XiShanYongYe-Chang commented Apr 2, 2024

This place update the MultiClusterIngress object:

This make a conflict with the mci-controller add finalizer. The relate log for controller is that:

mci_service_locations.go:81] Success to sync multiClusterIngress(demo/mci-100) service locations
serviceexport_propagation_controller.go:124] "service's cluster results" namespace="demo" name="service-100" clusters=["xxx","ttt"]
mci_controller.go:98] "failed to update mci with finalizer" err="Operation cannot be fulfilled on multiclusteringresses.networking.karmada.io \"mci-100\": the object has been modified; please apply your changes to the latest version and try again" namespace="demo" name="mci-100"
controller.go:329] "Reconciler error" err="Operation cannot be fulfilled on multiclusteringresses.networking.karmada.io \"mci-100\": the object has been modified; please apply your changes to the latest version and try again" controller="multiclusteringress-controller" object="demo/mci-100" namespace="demo" name="mci-100" reconcileID="b6529093-571f-4648-8bae-5ba1347ce448"

@RainbowMango
Copy link
Member

Great! Now we have enough confidence to move this forward.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2024
@karmada-bot karmada-bot merged commit 38032a6 into karmada-io:main Apr 2, 2024
4 checks passed
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants