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

cluster: save to the region cache when pending-peers or down-peers change #3462

Merged
merged 4 commits into from
Mar 12, 2021

Conversation

HunDunDM
Copy link
Member

What problem does this PR solve?

close #3456

What is changed and how it works?

  • Before: save to the region cache when pending-peers or down-peers exists
  • After: save to the region cache when pending-peers or down-peers change

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • save to the region cache when pending-peers or down-peers change

…ange

Signed-off-by: HunDunDM <hundundm@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>
@HunDunDM HunDunDM requested a review from nolouch March 10, 2021 15:09
@ti-chi-bot ti-chi-bot requested a review from rleungx March 10, 2021 15:09
@HunDunDM HunDunDM added component/cluster Cluster logic. needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. type/bugfix This PR fixes a bug. labels Mar 10, 2021
@HunDunDM HunDunDM self-assigned this Mar 10, 2021
Signed-off-by: HunDunDM <hundundm@gmail.com>
@codecov
Copy link

codecov bot commented Mar 10, 2021

Codecov Report

Merging #3462 (26f7dcf) into master (0b7e2e8) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3462      +/-   ##
==========================================
+ Coverage   74.90%   74.98%   +0.08%     
==========================================
  Files         244      244              
  Lines       23559    23578      +19     
==========================================
+ Hits        17646    17680      +34     
+ Misses       4322     4315       -7     
+ Partials     1591     1583       -8     
Flag Coverage Δ
unittests 74.98% <100.00%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
server/cluster/cluster.go 83.17% <100.00%> (+0.04%) ⬆️
server/core/region.go 90.33% <100.00%> (+0.35%) ⬆️
server/core/region_option.go 83.33% <100.00%> (+0.40%) ⬆️
server/tso/local_allocator.go 72.46% <0.00%> (-7.25%) ⬇️
server/server.go 71.98% <0.00%> (-0.78%) ⬇️
server/grpc_service.go 57.26% <0.00%> (-0.51%) ⬇️
server/handler.go 41.97% <0.00%> (-0.50%) ⬇️
client/client.go 67.01% <0.00%> (-0.18%) ⬇️
server/tso/tso.go 72.39% <0.00%> (+0.61%) ⬆️
server/tso/allocator_manager.go 75.58% <0.00%> (+0.83%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b7e2e8...26f7dcf. Read the comment docs.

Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 10, 2021
if len(region.GetDownPeers()) > 0 || len(region.GetPendingPeers()) > 0 {
saveCache = true
if !core.SortedPeersStatsEqual(region.GetDownPeers(), origin.GetDownPeers()) {
log.Debug("down-peers changed", zap.Uint64("region-id", region.GetID()))
Copy link
Member

Choose a reason for hiding this comment

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

How about printing the difference?

Copy link
Member Author

Choose a reason for hiding this comment

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

Personally, I think pending is more common, so I used the Debug level.

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • nolouch

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@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 Mar 12, 2021
@lhy1024
Copy link
Contributor

lhy1024 commented Mar 12, 2021

/merge

@ti-chi-bot
Copy link
Member

@lhy1024: 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: e23b725

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 12, 2021
@HunDunDM
Copy link
Member Author

/run-all-tests

@ti-chi-bot ti-chi-bot merged commit b1ba2d0 into tikv:master Mar 12, 2021
ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Mar 12, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.0 in PR #3470

@HunDunDM HunDunDM deleted the pending-down branch March 12, 2021 10:01
ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Mar 12, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #3471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cluster Cluster logic. needs-cherry-pick-release-3.0 The PR needs to cherry pick to release-3.0 branch. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Abnormalities in TiKV may cause slow PD heartbeat processing
6 participants