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_group_client: add defined errors #6033

Merged
merged 5 commits into from
Feb 22, 2023

Conversation

CabinfeverB
Copy link
Member

What problem does this PR solve?

Issue Number: ref #5851

What is changed and how does it work?

add defined error for other pkgs to judge

Check List

Tests

  • Unit test
  • Integration test

Release note

None.

Signed-off-by: Cabinfever_B <[email protected]>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Feb 21, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • lhy1024

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 21, 2023
@CabinfeverB CabinfeverB requested review from nolouch and removed request for Yisaer February 21, 2023 10:00
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Feb 21, 2023
ErrClientGetResourceGroup = errors.Normalize("get resource group %s failed, %v", errors.RFCCodeText("PD:client:ErrClientGetResourceGroup"))
ErrClientListResourceGroup = errors.Normalize("get all resource group failed, %v", errors.RFCCodeText("PD:client:ErrClientListResourceGroup"))
ErrClientResourceGroupConfigUnavailable = errors.Normalize("resource group %s config is unavailable, %v", errors.RFCCodeText("PD:client:ErrClientResourceGroupConfigUnavailable"))
ErrClientResourceGroupLimited = errors.Normalize("resource group limiter has no enough token", errors.RFCCodeText("PD:client:ErrClientResourceGroupLimited"))
Copy link
Contributor

Choose a reason for hiding this comment

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

better use throttled.

Signed-off-by: Cabinfever_B <[email protected]>
@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Base: 74.81% // Head: 74.78% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (9b140d9) compared to base (723fd74).
Patch coverage: 22.22% of modified lines in pull request are covered.

❗ Current head 9b140d9 differs from pull request most recent head 3c61048. Consider uploading reports for the commit 3c61048 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6033      +/-   ##
==========================================
- Coverage   74.81%   74.78%   -0.04%     
==========================================
  Files         365      365              
  Lines       36552    36552              
==========================================
- Hits        27348    27335      -13     
- Misses       6808     6819      +11     
- Partials     2396     2398       +2     
Flag Coverage Δ
unittests 74.78% <22.22%> (-0.04%) ⬇️

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.61% <0.00%> (ø)
client/resource_manager_client.go 66.84% <25.00%> (ø)
client/resource_group/controller/limiter.go 67.50% <100.00%> (ø)
pkg/dashboard/keyvisual/input/core.go 0.00% <0.00%> (-33.34%) ⬇️
pkg/tso/local_allocator.go 62.16% <0.00%> (-16.22%) ⬇️
pkg/member/member.go 60.00% <0.00%> (-5.79%) ⬇️
pkg/dashboard/adapter/manager.go 74.71% <0.00%> (-4.60%) ⬇️
pkg/election/leadership.go 76.28% <0.00%> (-4.13%) ⬇️
pkg/tso/tso.go 65.73% <0.00%> (-3.94%) ⬇️
server/schedulers/shuffle_hot_region.go 56.66% <0.00%> (-3.34%) ⬇️
... and 20 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.

ErrClientGetResourceGroup = errors.Normalize("get resource group failed, %v", errors.RFCCodeText("PD:client:ErrClientGetResourceGroup"))
ErrClientListResourceGroup = errors.Normalize("get all resource group failed, %v", errors.RFCCodeText("PD:client:ErrClientListResourceGroup"))
ErrClientResourceGroupConfigUnavailable = errors.Normalize("resource group config is unavailable, %v", errors.RFCCodeText("PD:client:ErrClientResourceGroupConfigUnavailable"))
ErrClientResourceGroupThrottled = errors.Normalize("exceed resource group quota limitation", errors.RFCCodeText("PD:client:ErrClientResourceGroupThrottled"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ErrClientResourceGroupThrottled = errors.Normalize("exceed resource group quota limitation", errors.RFCCodeText("PD:client:ErrClientResourceGroupThrottled"))
ErrClientResourceGroupThrottled = errors.Normalize("exceeded resource group quota limitation", errors.RFCCodeText("PD:client:ErrClientResourceGroupThrottled"))

Signed-off-by: Cabinfever_B <[email protected]>
@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 Feb 22, 2023
@JmPotato
Copy link
Member

/merge

@ti-chi-bot
Copy link
Member

@JmPotato: 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: 9fc2228

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Feb 22, 2023
@ti-chi-bot
Copy link
Member

@CabinfeverB: 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 merged commit 94d05f0 into tikv:master Feb 22, 2023
@CabinfeverB CabinfeverB deleted the resource-manager/error branch February 24, 2023 08:21
CabinfeverB added a commit to CabinfeverB/pd that referenced this pull request Feb 27, 2023
ref tikv#5851

Signed-off-by: Cabinfever_B <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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