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

ctl: add a message if the scheduler does not exist #8503

Merged
merged 5 commits into from
Sep 9, 2024

Conversation

HuSharp
Copy link
Member

@HuSharp HuSharp commented Aug 7, 2024

What problem does this PR solve?

Issue Number: Ref #4399

What is changed and how does it work?

before

./pd-ctl scheduler config evict-leader-scheduler  add-store 2
Failed! [404] 404 page not found

After

./pd-ctl scheduler config evict-leader-scheduler  add-store  2
Failed! scheduler evict-leader-scheduler not found.

Check List

Tests

  • Unit test

Release note

ctl: add a message if the scheduler does not exist

Signed-off-by: husharp <ihusharp@gmail.com>
@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the dco. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 7, 2024
@HuSharp HuSharp requested a review from lhy1024 August 7, 2024 09:33
Signed-off-by: husharp <ihusharp@gmail.com>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 7, 2024
@HuSharp
Copy link
Member Author

HuSharp commented Aug 7, 2024

@okJiang PTAL, thx!

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Project coverage is 77.64%. Comparing base (3abbd72) to head (fb8a2a3).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8503      +/-   ##
==========================================
+ Coverage   77.60%   77.64%   +0.03%     
==========================================
  Files         474      474              
  Lines       61852    61864      +12     
==========================================
+ Hits        48003    48036      +33     
+ Misses      10317    10295      -22     
- Partials     3532     3533       +1     
Flag Coverage Δ
unittests 77.64% <69.23%> (+0.03%) ⬆️

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

Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

Please add an issue for this pr

tools/pd-ctl/pdctl/command/scheduler.go Outdated Show resolved Hide resolved
tools/pd-ctl/pdctl/command/scheduler.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 6, 2024
Copy link
Contributor

ti-chi-bot bot commented Sep 6, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-07 09:46:54.508111192 +0000 UTC m=+431744.375210281: ☑️ agreed by lhy1024.
  • 2024-09-06 06:29:42.822729465 +0000 UTC m=+598707.340782387: ☑️ agreed by rleungx.

@rleungx
Copy link
Member

rleungx commented Sep 6, 2024

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 6, 2024
@rleungx
Copy link
Member

rleungx commented Sep 6, 2024

Let's wait for @okJiang to approve.

@HuSharp
Copy link
Member Author

HuSharp commented Sep 6, 2024

After discussing with PM. He gives suggestions for these 2 issues:

ask: what will error msg be like?

PM: The failed msg is Unable to update config: schedulerXX does not exist.

ask: Also, I noticed there are 2 ways for evictLeader and grantLeader:

  1. ./pd-ctl scheduler add evict-leader-scheduler <store-id>
    If there is no evict leader scheduler before, no error will be reported and the scheduler for this store will be generated
  2. ./pd-ctl scheduler config evict-leader-scheduler add-store <store_id>
    If there is no evict leader scheduler before, it will report the error: Failed! [404] 404 page not found

PM: Since add and config are two subcommands, it doesn't seem necessary to unify them, which makes sense.

cc @songrijie @okJiang @rleungx

Signed-off-by: husharp <ihusharp@gmail.com>
@HuSharp HuSharp requested a review from okJiang September 9, 2024 02:31
Copy link
Contributor

ti-chi-bot bot commented Sep 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

@HuSharp
Copy link
Member Author

HuSharp commented Sep 9, 2024

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 9, 2024
@ti-chi-bot ti-chi-bot bot merged commit 98e0407 into tikv:master Sep 9, 2024
23 of 25 checks passed
@HuSharp HuSharp deleted the add_error_msg branch September 9, 2024 06:13
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 Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants