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

rg/controller: use the default resource group if the requested one doesn't exist #8387

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Jul 11, 2024

What problem does this PR solve?

Issue Number: close #8388.

What is changed and how does it work?

Fallback to use the default resource group if the requested one doesn't exist.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test
image

Release note

None.

@JmPotato JmPotato requested review from nolouch and HuSharp July 11, 2024 06:45
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 11, 2024
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.28%. Comparing base (b3697fa) to head (67e3482).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8387      +/-   ##
==========================================
- Coverage   77.30%   77.28%   -0.02%     
==========================================
  Files         471      471              
  Lines       61679    61696      +17     
==========================================
+ Hits        47679    47682       +3     
- Misses      10413    10436      +23     
+ Partials     3587     3578       -9     
Flag Coverage Δ
unittests 77.28% <92.85%> (-0.02%) ⬇️

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

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@@ -356,22 +357,27 @@ func (c *ResourceGroupsController) Start(ctx context.Context) {
if err = proto.Unmarshal(item.Kv.Value, group); err != nil {
continue
}
if item, ok := c.groupsController.Load(group.Name); ok {
gc := item.(*groupCostController)
if gc, ok := c.loadGroupController(group.Name); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we reset the tombstone flag in here if the user deletes it and creates it again?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch. Fixed.

Comment on lines 606 to 605
log.Warn("[resource group controller] resource group name does not exist", zap.String("name", resourceGroupName))
return &rmpb.Consumption{}, nil
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to advance the log and remove return?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's better not to do so since that may cause a lot of logs during the workload.

@@ -402,8 +403,9 @@ func (suite *resourceManagerClientTestSuite) TestResourceGroupController() {
CPUMsCost: 1,
}

controller, _ := controller.NewResourceGroupController(suite.ctx, 1, cli, cfg, controller.EnableSingleGroupByKeyspace())
Copy link
Member

Choose a reason for hiding this comment

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

why remove EnableSingleGroupByKeyspace?

Copy link
Member Author

Choose a reason for hiding this comment

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

Enabling it will prevent the controller from starting the watch channel, this test needs it.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@JmPotato JmPotato requested review from nolouch and HuSharp July 12, 2024 10:55
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 15, 2024
Copy link
Contributor

@nolouch nolouch 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 15, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HuSharp, nolouch

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

Copy link
Contributor

ti-chi-bot bot commented Jul 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-15 02:13:17.974040736 +0000 UTC m=+233619.964982207: ☑️ agreed by HuSharp.
  • 2024-07-15 05:03:52.663868382 +0000 UTC m=+243854.654809837: ☑️ agreed by nolouch.

Copy link
Contributor

ti-chi-bot bot commented Jul 15, 2024

@JmPotato: Your PR was out of date, I have automatically updated it for you.

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.

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 ti-chi-bot bot merged commit 0c7dc0b into tikv:master Jul 15, 2024
25 checks passed
@JmPotato JmPotato deleted the rg_fallback branch July 15, 2024 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support fallback to the default resource group when the specified one does not exist
3 participants