Skip to content

Conversation

@lx1036
Copy link
Contributor

@lx1036 lx1036 commented Aug 5, 2024

remove redundant update to avoid upper replicas update must has conflict error, although it's in retry.RetryOnConflict()

Ⅰ. Describe what this PR does

remove redundant statefulset update to avoid upper replicas update must has conflict error, although it's in retry.RetryOnConflict(), result to it have to update twice unneedly.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Aug 5, 2024

Hi @lx1036. Thanks for your PR.

I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@lx1036
Copy link
Contributor Author

lx1036 commented Aug 5, 2024

/assign @cheyang

remove redundant update to avoid upper replicas update must has conflict error, although it's in retry.RetryOnConflict()

Signed-off-by: LiuXiang <lx1036@126.com>
@lx1036 lx1036 force-pushed the feature/remove-redundant-update branch from ea97037 to 0467c04 Compare August 5, 2024 06:07
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 5, 2024

@cheyang cheyang requested a review from Syspretor August 6, 2024 10:26
@Syspretor
Copy link
Collaborator

First of all, there are indeed redundant update calls here, but they do not lead to conflicts. This is due to the implementation logic for the client in the controller-runtime, which has also been validated through logs of apiserver. The logic ensures that the updated objects will overwrite the original object with update response in memory. This PR makes the code logic more elegant.
Thanks @lx1036 for the PR!
/lgtm

@cheyang Please take a look and merge it if there's no further comments

Copy link
Member

@TrafalgarZZZ TrafalgarZZZ left a comment

Choose a reason for hiding this comment

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

I think this is really a great code optimization! Thanks @lx1036
/lgtm

@fluid-e2e-bot
Copy link

fluid-e2e-bot bot commented Aug 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TrafalgarZZZ

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:

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

@fluid-e2e-bot fluid-e2e-bot bot merged commit 6cc47b8 into fluid-cloudnative:master Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants