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

*: instead scheduler type string of types.CheckerSchedulerType #8485

Merged
merged 18 commits into from
Aug 8, 2024

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Aug 2, 2024

What problem does this PR solve?

Issue Number: Ref #8379

What is changed and how does it work?

- Remove the old scheduler type, such as BalanceLeaderType
- Instead old scheduler type string of types.CheckerSchedulerType
- Instead old scheduler name of types.CheckerSchedulerType in SchedulerRegisterMap

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.

Signed-off-by: okJiang <819421878@qq.com>
Copy link
Contributor

ti-chi-bot bot commented Aug 2, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 2, 2024
okJiang added 2 commits August 5, 2024 10:32
Signed-off-by: okJiang <819421878@qq.com>
Signed-off-by: okJiang <819421878@qq.com>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 5, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 5, 2024

PR needs rebase.

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.

okJiang added 5 commits August 5, 2024 15:11
Signed-off-by: okJiang <819421878@qq.com>
Signed-off-by: okJiang <819421878@qq.com>
Signed-off-by: okJiang <819421878@qq.com>
Signed-off-by: okJiang <819421878@qq.com>
Signed-off-by: okJiang <819421878@qq.com>
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

Attention: Patch coverage is 85.29412% with 15 lines in your changes missing coverage. Please review.

Project coverage is 77.38%. Comparing base (7741924) to head (ebcc655).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8485      +/-   ##
==========================================
- Coverage   77.40%   77.38%   -0.02%     
==========================================
  Files         472      472              
  Lines       61800    61826      +26     
==========================================
+ Hits        47838    47846       +8     
- Misses      10395    10415      +20     
+ Partials     3567     3565       -2     
Flag Coverage Δ
unittests 77.38% <85.29%> (-0.02%) ⬇️

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

@okJiang okJiang marked this pull request as ready for review August 5, 2024 09:01
@okJiang okJiang changed the title [wip]: instead of scheduler type *: instead scheduler type string of new type Aug 5, 2024
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 5, 2024
Signed-off-by: okJiang <819421878@qq.com>
@@ -275,7 +276,7 @@ func (c *Coordinator) InitSchedulers(needRun bool) {
typ := schedulers.FindSchedulerTypeByName(name)
var cfg sc.SchedulerConfig
for _, c := range scheduleCfg.Schedulers {
if c.Type == typ {
if c.Type == types.SchedulerTypeCompatibleMap[typ] {
Copy link
Member Author

Choose a reason for hiding this comment

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

How about renaming to ConvertNewType2OldStr

@okJiang okJiang changed the title *: instead scheduler type string of new type *: instead scheduler type string of types.CheckerSchedulerType Aug 5, 2024
}

// SchedulerStr2Type is a map to convert the scheduler string to the CheckerSchedulerType.
SchedulerStr2Type = map[string]CheckerSchedulerType{
Copy link
Member

Choose a reason for hiding this comment

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

StringToSchedulerType

Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

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

The rest LGTM

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 7, 2024
okJiang added 2 commits August 7, 2024 13:11
Signed-off-by: okJiang <819421878@qq.com>
Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

the rest LGTM

@@ -43,8 +43,6 @@ import (
const (
// BalanceLeaderName is balance leader scheduler name.
BalanceLeaderName = "balance-leader-scheduler"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we will unify 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.

It will be in the next pr

@@ -309,11 +309,12 @@ func (c *Cluster) updateScheduler() {
)
// Create the newly added schedulers.
for _, scheduler := range latestSchedulersConfig {
schedulerType := types.ConvertOldStr2Type[scheduler.Type]
Copy link
Contributor

Choose a reason for hiding this comment

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

How does ConvertOldStrToType sound to you? Variable names with embedded numbers are not common in PD.

Copy link
Member Author

Choose a reason for hiding this comment

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

They are same for me. I can update it

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 8, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-07 04:08:37.757777715 +0000 UTC m=+411447.624876804: ☑️ agreed by rleungx.
  • 2024-08-08 08:11:08.650574412 +0000 UTC m=+512398.517673586: ☑️ agreed by lhy1024.

@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 8, 2024
Signed-off-by: okJiang <819421878@qq.com>
Copy link
Contributor

ti-chi-bot bot commented Aug 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024, niubell, rleungx

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

@ti-chi-bot ti-chi-bot bot added the approved label Aug 8, 2024
@ti-chi-bot ti-chi-bot bot merged commit 8644ec6 into tikv:master Aug 8, 2024
25 checks passed
@okJiang okJiang deleted the name5 branch August 8, 2024 13:52
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants