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

syncer: sync region leaders between PD leader and follower (#2591) #2795

Merged
merged 2 commits into from
Aug 19, 2020

Conversation

JmPotato
Copy link
Member

cherry-pick #2591 to release-4.0


Signed-off-by: JmPotato ghzpotato@gmail.com

What problem does this PR solve?

Add the feature requested in issue #2542

What is changed and how it works?

Add region_leaders field in SyncRegionResponse to pass the region's leader info between PD leader and follower. And the region leader changing will also trigger sync now to make the region leader info more accurate.

Check List

Tests

  • Unit test

Related changes

Release note

  • Sync region leaders between PD leader and followers rather than just waiting for heartbeats.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@JmPotato JmPotato added the component/misc Some other things. label Aug 18, 2020
@JmPotato JmPotato added this to the v4.0.5 milestone Aug 18, 2020
@codecov
Copy link

codecov bot commented Aug 18, 2020

Codecov Report

Merging #2795 into release-4.0 will increase coverage by 0.02%.
The diff coverage is 87.80%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-4.0    #2795      +/-   ##
===============================================
+ Coverage        77.41%   77.44%   +0.02%     
===============================================
  Files              206      206              
  Lines            22630    22652      +22     
===============================================
+ Hits             17520    17542      +22     
  Misses            3790     3790              
  Partials          1320     1320              
Impacted Files Coverage Δ
server/region_syncer/server.go 80.55% <85.71%> (-0.70%) ⬇️
server/region_syncer/client.go 86.86% <88.88%> (+0.60%) ⬆️
server/cluster/cluster.go 80.87% <100.00%> (ø)
server/heartbeat_streams.go 68.00% <0.00%> (-6.00%) ⬇️
server/tso/tso.go 78.94% <0.00%> (-1.98%) ⬇️
server/grpc_service.go 59.07% <0.00%> (-0.97%) ⬇️
pkg/btree/btree.go 86.84% <0.00%> (-0.81%) ⬇️
server/handler.go 50.76% <0.00%> (-0.44%) ⬇️
server/member/leader.go 74.31% <0.00%> (+0.77%) ⬆️
server/cluster/coordinator.go 71.22% <0.00%> (+1.19%) ⬆️
... and 2 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 d27a803...fa1814d. Read the comment docs.

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 19, 2020
Copy link
Member

@HunDunDM HunDunDM 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-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Aug 19, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 19, 2020
@HunDunDM
Copy link
Member

/run-all-tests

@nolouch
Copy link
Contributor

nolouch commented Aug 19, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 19, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

1 similar comment
@JmPotato
Copy link
Member Author

/run-all-tests

@ti-srebot
Copy link
Contributor

@JmPotato merge failed.

@JmPotato
Copy link
Member Author

/run-all-tests

1 similar comment
@JmPotato
Copy link
Member Author

/run-all-tests

@JmPotato JmPotato merged commit 7e31082 into tikv:release-4.0 Aug 19, 2020
@JmPotato JmPotato deleted the sync_region_leader branch August 19, 2020 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/misc Some other things. 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