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

scheduler: GetType() returns types.CheckerSchedulerType directly #8440

Merged
merged 14 commits into from
Aug 1, 2024

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Jul 25, 2024

What problem does this PR solve?

Issue Number: Ref #8379

What is changed and how does it work?

- GetType() returns types.CheckerSchedulerType directly
- keep the compatibility in `PersistOptions` and `PersistConfig“
- wrap `operator.OperatorLimitCounter.WithLabelValues().Inc()` to func `IncOperatorLimitCounter` 

Check List

Tests

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

Release note

None.

Copy link
Contributor

ti-chi-bot bot commented Jul 25, 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 release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Jul 25, 2024
Signed-off-by: okJiang <[email protected]>
@@ -395,7 +382,7 @@ func scheduleEvictLeaderOnce(name, typ string, cluster sche.SchedulerCluster, co
for _, t := range targets {
targetIDs = append(targetIDs, t.GetID())
}
op, err := operator.CreateTransferLeaderOperator(typ, cluster, region, target.GetID(), targetIDs, operator.OpLeader)
op, err := operator.CreateTransferLeaderOperator(name, cluster, region, target.GetID(), targetIDs, operator.OpLeader)
Copy link
Member Author

Choose a reason for hiding this comment

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

Using name instead of type for desc is ok

okJiang added 4 commits July 25, 2024 17:54
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
Signed-off-by: okJiang <[email protected]>
@okJiang okJiang marked this pull request as ready for review July 29, 2024 03:05
@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 Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 83.01887% with 18 lines in your changes missing coverage. Please review.

Project coverage is 77.39%. Comparing base (cb6e6e2) to head (c47389e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8440      +/-   ##
==========================================
+ Coverage   77.32%   77.39%   +0.07%     
==========================================
  Files         472      472              
  Lines       61811    61727      -84     
==========================================
- Hits        47793    47773      -20     
+ Misses      10445    10390      -55     
+ Partials     3573     3564       -9     
Flag Coverage Δ
unittests 77.39% <83.01%> (+0.07%) ⬆️

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

@okJiang
Copy link
Member Author

okJiang commented Jul 29, 2024

/cc @lhy1024 @nolouch

@ti-chi-bot ti-chi-bot bot requested review from lhy1024 and nolouch July 29, 2024 05:09
@okJiang
Copy link
Member Author

okJiang commented Jul 30, 2024

/cc @JmPotato

@ti-chi-bot ti-chi-bot bot requested a review from JmPotato July 30, 2024 06:14
Signed-off-by: okJiang <[email protected]>
AddSchedulerCfg(string, []string)
RemoveSchedulerCfg(string)
IsSchedulerDisabled(types.CheckerSchedulerType) bool
AddSchedulerCfg(types.CheckerSchedulerType, []string)
Copy link
Contributor

@nolouch nolouch Jul 31, 2024

Choose a reason for hiding this comment

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

We can consider removing this interface. here is some background:

To ensure compatibility, both configurations are retained, and we can now clean up the old one. However, there is one problem that needs to be solved: the default scheduler state needs special handling.

Copy link
Member Author

@okJiang okJiang Aug 1, 2024

Choose a reason for hiding this comment

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

The update of this comment is too large, and it seems not related to current issue. It is better to do it in a new pr. I filed an issue to track it. #8474

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, do you mean all this interface or these two function?

Makefile Outdated Show resolved Hide resolved
Signed-off-by: okJiang <[email protected]>
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Aug 1, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 1, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 1, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-01 08:58:58.332061944 +0000 UTC m=+432654.612110018: ☑️ agreed by nolouch.
  • 2024-08-01 09:33:07.086687455 +0000 UTC m=+434703.366735524: ☑️ agreed by JmPotato.

Copy link
Contributor

ti-chi-bot bot commented Aug 1, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, niubell, 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

@ti-chi-bot ti-chi-bot bot added the approved label Aug 1, 2024
@ti-chi-bot ti-chi-bot bot merged commit 87ec788 into tikv:master Aug 1, 2024
25 checks passed
@okJiang okJiang deleted the name4 branch August 7, 2024 08:16
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants