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

Merged
merged 11 commits into from
Jul 1, 2020

Conversation

JmPotato
Copy link
Member

@JmPotato JmPotato commented Jun 30, 2020

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

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Jun 30, 2020

CLA assistant check
All committers have signed the CLA.

@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Jun 30, 2020
Signed-off-by: JmPotato <ghzpotato@gmail.com>
@JmPotato
Copy link
Member Author

@sre-bot /run-all-tests

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@JmPotato JmPotato force-pushed the sync_region_leader branch from ed9710e to 265e2af Compare June 30, 2020 06:45
@JmPotato
Copy link
Member Author

@sre-bot /run-all-tests

server/cluster/cluster.go Outdated Show resolved Hide resolved
@rleungx
Copy link
Member

rleungx commented Jun 30, 2020

Would you like to add a test for it?

@JmPotato
Copy link
Member Author

Would you like to add a test for it?

Yes. I'm working on it.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@JmPotato JmPotato requested review from disksing and rleungx June 30, 2020 08:35
@JmPotato JmPotato added the component/misc Some other things. label Jun 30, 2020
@JmPotato JmPotato linked an issue Jun 30, 2020 that may be closed by this pull request
@JmPotato JmPotato requested review from nolouch and HunDunDM June 30, 2020 09:50
server/region_syncer/client.go Outdated Show resolved Hide resolved
server/region_syncer/client.go Show resolved Hide resolved
@disksing
Copy link
Contributor

LGTM

@ti-srebot
Copy link
Contributor

@disksing,Thanks for you review.

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, please update the kvproto.

Signed-off-by: JmPotato <ghzpotato@gmail.com>
@JmPotato
Copy link
Member Author

JmPotato commented Jul 1, 2020

I removed the kvproto package replacing in go.mod. Please merge this pr first. So I can rerun the build and tests.

@nolouch
Copy link
Contributor

nolouch commented Jul 1, 2020

@JmPotato That PR already merged.

@JmPotato
Copy link
Member Author

JmPotato commented Jul 1, 2020

@sre-bot /rebuild

JmPotato added 2 commits July 1, 2020 14:32
Signed-off-by: JmPotato <ghzpotato@gmail.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com>
@JmPotato
Copy link
Member Author

JmPotato commented Jul 1, 2020

/run-all-tests

@JmPotato
Copy link
Member Author

JmPotato commented Jul 1, 2020

@disksing @nolouch PTAL

@disksing
Copy link
Contributor

disksing commented Jul 1, 2020

/merge

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

/run-all-tests

@ti-srebot ti-srebot merged commit 7a54282 into tikv:master Jul 1, 2020
@JmPotato JmPotato deleted the sync_region_leader branch July 1, 2020 13:42
@JmPotato
Copy link
Member Author

JmPotato commented Jul 3, 2020

Does this pr need to be cherry-picked to release-4.0?

@nolouch nolouch added the needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. label Jul 3, 2020
@nolouch
Copy link
Contributor

nolouch commented Jul 3, 2020

@JmPotato we need.

@nolouch
Copy link
Contributor

nolouch commented Jul 3, 2020

/run-cherry-picker

@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 failed

1 similar comment
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 failed

@JmPotato
Copy link
Member Author

JmPotato commented Jul 3, 2020

/run-cherry-picker

@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 failed

@JmPotato
Copy link
Member Author

/run-cherry-picker

ti-srebot pushed a commit to ti-srebot/pd that referenced this pull request Aug 13, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #2763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/misc Some other things. contribution This PR is from a community contributor. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PD Leader Syncer the leader of region to the PD follower
6 participants