tidb-operator icon indicating copy to clipboard operation
tidb-operator copied to clipboard

[WIP] Optimization for CreateOrUpdateConfigMap

Open mianhk opened this issue 4 years ago • 39 comments

What problem does this PR solve?

Close #3737

What is changed and how does it work?

Code changes

  • [x] Has Go code change
  • [ ] Has CI related scripts change

Tests

  • [x] Unit test
  • [ ] E2E test
  • [x] 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.

Optimization for CreateOrUpdateConfigMap

mianhk avatar Sep 01 '21 04:09 mianhk

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • DanielZhangQD
  • july2993

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment. After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.

ti-chi-bot avatar Sep 01 '21 04:09 ti-chi-bot

@mianhk Even with this PR, the function here https://github.com/pingcap/tidb-operator/blob/master/pkg/controller/generic_control.go#L425 will also call the Create API first, so it does not fix this issue thoroughly.

DanielZhangQD avatar Sep 13 '21 04:09 DanielZhangQD

Codecov Report

Merging #4170 (5b0e271) into master (dc276de) will increase coverage by 0.01%. The diff coverage is 70.00%.

@@            Coverage Diff             @@
##           master    #4170      +/-   ##
==========================================
+ Coverage   61.65%   61.67%   +0.01%     
==========================================
  Files         181      181              
  Lines       19482    19520      +38     
==========================================
+ Hits        12011    12038      +27     
- Misses       6313     6315       +2     
- Partials     1158     1167       +9     
Flag Coverage Δ
unittest 61.67% <70.00%> (+0.01%) :arrow_up:

codecov-commenter avatar Sep 30 '21 03:09 codecov-commenter

@mianhk Even with this PR, the function here https://github.com/pingcap/tidb-operator/blob/master/pkg/controller/generic_control.go#L425 will also call the Create API first, so it does not fix this issue thoroughly.

I fixed this by CheckAndUpdateConfigMap and check the configMap by ConfigMapLister. And if is it necessary to create or upgrade other resources before after checking by Listers.

mianhk avatar Sep 30 '21 03:09 mianhk

/run-all-tests

DanielZhangQD avatar Oct 12 '21 08:10 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 11 '21 06:11 DanielZhangQD

/merge

DanielZhangQD avatar Nov 11 '21 06:11 DanielZhangQD

This pull request has been accepted and is ready to merge.

Commit hash: 5c0099586a50f08e0a454d0ba4eef58a87a015b0

ti-chi-bot avatar Nov 11 '21 06:11 ti-chi-bot

/run-all-tests

DanielZhangQD avatar Nov 11 '21 11:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 12 '21 05:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 12 '21 09:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 12 '21 12:11 DanielZhangQD

/test pull-e2e-kind-serial

DanielZhangQD avatar Nov 12 '21 14:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 15 '21 11:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 16 '21 03:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 16 '21 09:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 16 '21 11:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 16 '21 12:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 17 '21 00:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Nov 17 '21 10:11 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Dec 03 '21 04:12 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Dec 06 '21 02:12 DanielZhangQD

/merge

DanielZhangQD avatar Dec 06 '21 02:12 DanielZhangQD

This pull request has been accepted and is ready to merge.

Commit hash: 742d0e100cc7e47d4713fde04cf543c025f42be5

ti-chi-bot avatar Dec 06 '21 02:12 ti-chi-bot

/run-all-tests

DanielZhangQD avatar Dec 06 '21 13:12 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Dec 07 '21 00:12 DanielZhangQD

/test pull-e2e-kind-br

DanielZhangQD avatar Dec 07 '21 01:12 DanielZhangQD

/test pull-e2e-kind

DanielZhangQD avatar Dec 07 '21 02:12 DanielZhangQD

/run-all-tests

DanielZhangQD avatar Dec 07 '21 06:12 DanielZhangQD

/test pull-e2e-kind

DanielZhangQD avatar Dec 07 '21 09:12 DanielZhangQD