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

checker: fix the issue that unhealthy region cause panic #5494

Merged
merged 3 commits into from Sep 13, 2022

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Sep 13, 2022

Signed-off-by: nolouch nolouch@gmail.com

What problem does this PR solve?

Issue Number: Close #5491

What is changed and how does it work?

checker: fix the issue that unhealthy region cause panic

Check List

Tests

  • Unit test

Release note

Fix the issue that unhealthy region cause panic

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 13, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • CabinfeverB
  • disksing

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.

Signed-off-by: nolouch <nolouch@gmail.com>
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Base: 75.55% // Head: 75.50% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (b7297ef) compared to base (772c480).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5494      +/-   ##
==========================================
- Coverage   75.55%   75.50%   -0.06%     
==========================================
  Files         320      320              
  Lines       31642    31650       +8     
==========================================
- Hits        23907    23897      -10     
- Misses       5670     5690      +20     
+ Partials     2065     2063       -2     
Flag Coverage Δ
unittests 75.50% <100.00%> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
pkg/mock/mockcluster/mockcluster.go 94.17% <100.00%> (+0.05%) ⬆️
server/schedule/checker/rule_checker.go 81.25% <100.00%> (+1.34%) ⬆️
pkg/dashboard/keyvisual/input/core.go 0.00% <0.00%> (-33.34%) ⬇️
pkg/dashboard/adapter/manager.go 79.31% <0.00%> (-9.20%) ⬇️
server/storage/kv/etcd_kv.go 79.71% <0.00%> (-5.80%) ⬇️
server/storage/storage.go 67.30% <0.00%> (-3.85%) ⬇️
server/tso/tso.go 68.53% <0.00%> (-3.38%) ⬇️
server/tso/allocator_manager.go 62.66% <0.00%> (-2.60%) ⬇️
server/storage/endpoint/meta.go 61.36% <0.00%> (-2.28%) ⬇️
server/region_syncer/client.go 84.32% <0.00%> (-2.24%) ⬇️
... and 22 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.

@@ -236,10 +236,14 @@ func (c *RuleChecker) fixLooseMatchPeer(region *core.RegionInfo, fit *placement.
checkerCounter.WithLabelValues("rule_checker", "fix-peer-role").Inc()
return operator.CreatePromoteLearnerOperator("fix-peer-role", c.cluster, region, peer)
}
if region.GetLeader() == nil {
checkerCounter.WithLabelValues("rule_checker", "region-no-leader").Inc()
return nil, nil
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can return an error, so L158 can return

Copy link
Member

Choose a reason for hiding this comment

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

agree

Copy link
Member

@rleungx rleungx Sep 13, 2022

Choose a reason for hiding this comment

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

If the region doesn't have a leader, is it necessary to check it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rleungx I think no need, address it.

Signed-off-by: nolouch <nolouch@gmail.com>
@nolouch
Copy link
Contributor Author

nolouch commented Sep 13, 2022

ptal @HunDunDM @CabinfeverB

Signed-off-by: nolouch <nolouch@gmail.com>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 13, 2022
@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 Sep 13, 2022
@rleungx
Copy link
Member

rleungx commented Sep 13, 2022

/merge

@ti-chi-bot
Copy link
Member

@rleungx: 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: b7297ef

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 13, 2022
@ti-chi-bot ti-chi-bot merged commit 16b374a into tikv:master Sep 13, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #5495.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Sep 13, 2022
close tikv#5491

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@nolouch nolouch deleted the fix-rule-panic branch September 13, 2022 11:40
ti-chi-bot added a commit that referenced this pull request Sep 20, 2022
close #5491, ref #5494

checker: fix the issue that unhealthy region cause panic

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: nolouch <nolouch@gmail.com>

Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: nolouch <nolouch@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-6.1 release-note The PR should write the 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.

multi-region-dr: pd leader panic repeatly
6 participants