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

resource_controller: load RU config from the remote server when initializing controller #6048

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Feb 24, 2023

Signed-off-by: JmPotato ghzpotato@gmail.com

What problem does this PR solve?

Issue Number: ref #6038. Should merge after #6041.

What is changed and how does it work?

- Load RU config from the remote server when initializing controller. 

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 24, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • nolouch

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 ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Feb 24, 2023
@JmPotato
Copy link
Member Author

/cc @HuSharp

Please help take a look also.

@ti-chi-bot
Copy link
Member

@JmPotato: GitHub didn't allow me to request PR reviews from the following users: HuSharp.

Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @HuSharp

Please help take a look also.

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.

@codecov
Copy link

codecov bot commented Feb 24, 2023

Codecov Report

Patch coverage: 57.89% and project coverage change: -0.10 ⚠️

Comparison is base (f999ad5) 74.00% compared to head (ea85630) 73.90%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6048      +/-   ##
==========================================
- Coverage   74.00%   73.90%   -0.10%     
==========================================
  Files         380      380              
  Lines       37728    37740      +12     
==========================================
- Hits        27920    27892      -28     
- Misses       7352     7377      +25     
- Partials     2456     2471      +15     
Flag Coverage Δ
unittests 73.90% <57.89%> (-0.10%) ⬇️

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

Impacted Files Coverage Δ
client/resource_group/controller/controller.go 61.37% <55.55%> (-0.24%) ⬇️
client/resource_group/controller/config.go 100.00% <100.00%> (+62.50%) ⬆️
pkg/errs/errs.go 75.00% <0.00%> (-25.00%) ⬇️
pkg/mcs/discovery/register.go 53.48% <0.00%> (-18.61%) ⬇️
pkg/tso/local_allocator.go 62.16% <0.00%> (-9.46%) ⬇️
pkg/dashboard/adapter/manager.go 79.31% <0.00%> (-9.20%) ⬇️
pkg/election/leadership.go 76.28% <0.00%> (-4.13%) ⬇️
pkg/utils/etcdutil/etcdutil.go 76.42% <0.00%> (-4.07%) ⬇️
pkg/tso/allocator_manager.go 63.20% <0.00%> (-2.60%) ⬇️
pkg/member/member.go 62.69% <0.00%> (-1.56%) ⬇️
... and 14 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 27, 2023
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 1, 2023
Signed-off-by: JmPotato <ghzpotato@gmail.com>
return nil, err
}
}
// TODO: do we need to reload the config from remote server periodically?
Copy link
Member

@HuSharp HuSharp Mar 1, 2023

Choose a reason for hiding this comment

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

Do u mean we need to watch it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but since the RU model config won't be modified frequently, I think it's ok to leave this as a nice-to-have option.

Copy link
Contributor

@nolouch nolouch Mar 1, 2023

Choose a reason for hiding this comment

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

Maybe we can consider adding an API to the triage reload later. it's more "manual" and no need to restart the node.

return nil, err
}
}
// TODO: do we need to reload the config from remote server periodically?
Copy link
Member

Choose a reason for hiding this comment

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

IMO, reload is not required for now, and the cluster control surface can restart tidb

Copy link
Member Author

Choose a reason for hiding this comment

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

I just removed this TODO.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 1, 2023
Comment on lines 104 to 107
var err error
if requestUnitConfig == nil {
if requestUnitConfig, err = loadRequestUnitConfig(ctx, provider); err != nil {
return nil, err
Copy link
Member

Choose a reason for hiding this comment

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

If we don't need to reload, maybe we can move the error in if block.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is because requestUnitConfig has been defined as the function parameter, we can not re-assign it with :=.

Copy link
Member

Choose a reason for hiding this comment

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

I mean what about

	if requestUnitConfig == nil {
	var err error

Copy link
Member 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: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.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
Copy link
Member

@HuSharp: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments.

In response to this:

LGTM!

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 added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 1, 2023
@nolouch
Copy link
Contributor

nolouch commented Mar 1, 2023

/merge

@ti-chi-bot
Copy link
Member

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

/run-all-tests

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
Member

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

Commit hash: ea85630

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 1, 2023
@ti-chi-bot ti-chi-bot merged commit c82b237 into tikv:master Mar 1, 2023
@JmPotato JmPotato deleted the remote_ru_model branch March 1, 2023 09:47
rleungx pushed a commit to rleungx/pd that referenced this pull request Apr 19, 2023
…alizing controller (tikv#6048)

ref tikv#6038, ref tikv#6041

- Load RU config from the remote server when initializing controller.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/resource-control release-note-none Denotes a PR that doesn't merit a release note. 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.

5 participants