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

resourcemanager: do not check existence when add resource group #6717

Merged
merged 10 commits into from Jul 3, 2023

Conversation

glorv
Copy link
Contributor

@glorv glorv commented Jun 29, 2023

What problem does this PR solve?

Issue Number: ref #5851, ref pingcap/tidb#45050

What is changed and how does it work?

Do not check the existence of target resource group to make create resource group idempotent.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jun 29, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • HuSharp

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.

Signed-off-by: glorv <glorvs@163.com>
@ti-chi-bot ti-chi-bot bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 29, 2023
Signed-off-by: glorv <glorvs@163.com>
@ti-chi-bot ti-chi-bot bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 29, 2023
Signed-off-by: glorv <glorvs@163.com>
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.32 🎉

Comparison is base (87b5ade) 74.30% compared to head (4b9be9c) 74.63%.

❗ Current head 4b9be9c differs from pull request most recent head a6de32e. Consider uploading reports for the commit a6de32e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6717      +/-   ##
==========================================
+ Coverage   74.30%   74.63%   +0.32%     
==========================================
  Files         410      417       +7     
  Lines       42853    43625     +772     
==========================================
+ Hits        31842    32558     +716     
- Misses       8158     8181      +23     
- Partials     2853     2886      +33     
Flag Coverage Δ
unittests 74.63% <ø> (+0.32%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/mcs/resourcemanager/server/manager.go 82.10% <ø> (+0.56%) ⬆️

... and 43 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -789,7 +789,7 @@ func (suite *resourceManagerClientTestSuite) TestBasicResourceGroupCURD() {
}
// Create Resource Group
resp, err := cli.AddResourceGroup(suite.ctx, group)
checkErr(err, tcase.addSuccess)
checkErr(err, true)
if tcase.addSuccess {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's better to change addSuccess name to meet now the test AddResourceGroup behavior will actually succeed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: glorv <glorvs@163.com>
Copy link
Member

@HuSharp HuSharp left a comment

Choose a reason for hiding this comment

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

LGTM!

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 30, 2023
@HuSharp HuSharp requested review from CabinfeverB and removed request for lhy1024 June 30, 2023 07:04
Copy link
Member

@CabinfeverB CabinfeverB left a comment

Choose a reason for hiding this comment

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

Can we add some comment for this behavior? REST LGTM

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 30, 2023
_, ok := m.groups[grouppb.Name]
m.RUnlock()
if ok {
return errs.ErrResourceGroupAlreadyExists.FastGenByArgs(grouppb.Name)
Copy link
Member

Choose a reason for hiding this comment

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

Need to remove the ErrResourceGroupAlreadyExists related error definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

Signed-off-by: glorv <glorvs@163.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 3, 2023
glorv added 2 commits July 3, 2023 10:53
Signed-off-by: glorv <glorvs@163.com>
@CabinfeverB
Copy link
Member

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 3, 2023

@CabinfeverB: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 3, 2023

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

Commit hash: 4b9be9c

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 3, 2023
@ti-chi-bot ti-chi-bot bot merged commit 5f7236f into tikv:master Jul 3, 2023
22 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #6739.

ti-chi-bot bot added a commit that referenced this pull request Oct 12, 2023
… (#6739)

ref #5851, ref pingcap/tidb#45050

Signed-off-by: glorv <glorvs@163.com>

Co-authored-by: glorv <glorvs@163.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.1 release-note-none size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants