Skip to content

Conversation

@PetterZhukov
Copy link

What problem does this PR solve?

There will be a large number of 409 errors when confirming the existence of resources through creation operations in CreateOrUpdate
Modify the logic to confirm the existence of resources through Exist.

Closes #6234 #6322

What is changed and how does it work?

Code changes

  • Has Go code change
  • Has CI related scripts change

Tests

  • Unit test
  • E2E test
  • Manual test
  • No code

Side effects

  • Breaking backward compatibility
  • Other side effects:

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.

Fix the issue that instead of creating the resource in every sync cycle, first check whether it already exists because just use create-api will cause many 409 responses.

@ti-chi-bot ti-chi-bot bot requested a review from howardlau1999 September 25, 2025 08:13
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign weekface for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2025

Hi @PetterZhukov. Thanks for your PR.

I'm waiting for a pingcap 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.

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.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Sep 25, 2025

Welcome @PetterZhukov! It looks like this is your first PR to pingcap/tidb-operator 🎉

@pingcap-cla-assistant
Copy link

pingcap-cla-assistant bot commented Sep 25, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ liubog2008
❌ PetterZhukov
You have signed the CLA already but the status is still pending? Let us recheck it.

@ti-chi-bot ti-chi-bot bot added the size/XS label Sep 25, 2025
// 1. try to create and see if there is any conflicts
err := c.client.Create(context.TODO(), desired)
if errors.IsAlreadyExists(err) {
exist, err := c.Exist(client.ObjectKeyFromObject(desired), obj)
Copy link
Member

Choose a reason for hiding this comment

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

please also change the comment

@liubog2008
Copy link
Member

/run-all-tests

@liubog2008
Copy link
Member

/ok-to-test

@codecov-commenter
Copy link

codecov-commenter commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.02%. Comparing base (a16b2e8) to head (440edf2).
⚠️ Report is 65 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (a16b2e8) and HEAD (440edf2). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (a16b2e8) HEAD (440edf2)
unittest 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6472       +/-   ##
===========================================
- Coverage   57.19%   47.02%   -10.18%     
===========================================
  Files         259      218       -41     
  Lines       33233    32124     -1109     
===========================================
- Hits        19008    15105     -3903     
- Misses      12291    15106     +2815     
+ Partials     1934     1913       -21     
Flag Coverage Δ
e2e 47.02% <60.00%> (?)
unittest ?
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ti-chi-bot ti-chi-bot bot added size/S and removed size/XS labels Sep 29, 2025
@liubog2008
Copy link
Member

/run-all-tests

@liubog2008
Copy link
Member

/run-pull-e2e-kind-across-kubernetes

@liubog2008
Copy link
Member

cc @csuzhangxc

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.

tidb-operator v1.6.1 is not fully compatible with k8s v1.33.1, every 30 sec tidb-operator is trying to create second discovery service

3 participants