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

schedule: change merge match peers strategy #1339

Merged
merged 7 commits into from Dec 6, 2018

Conversation

Projects
None yet
4 participants
@Connor1996
Copy link
Member

commented Nov 22, 2018

What problem does this PR solve?

There is a case that a follower is added and transfer leader to it, and the apply process of it is slow so leader regards it as a voter but actually it is still a learner. Once that, the follower can't be a leader, but the old leader can't know that so there is no leader to serve for a while.

What is changed and how it works?

change merge match peers strategy, transfer leader to the first added follower if there is no intersection store, and remove one peer after adding one peer.

Check List

  • Unit test

Connor1996 added some commits Nov 22, 2018

@zhangjinpeng1987
Copy link
Contributor

left a comment

LGTM

@nolouch

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

@Connor1996 CI failed.

@Connor1996

This comment has been minimized.

Copy link
Member Author

commented Nov 26, 2018

@nolouch Because range cannot keep same order every time. It is a little hard to write this test case, and I am trying to figure it out.

@disksing

This comment has been minimized.

Copy link
Member

commented Nov 30, 2018

@Connor1996 Any update? Maybe you can make sure regions have only 1 intersection.

Connor1996 added some commits Nov 30, 2018

remove after add
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
add comment
Signed-off-by: Connor1996 <zbk602423539@gmail.com>

@Connor1996 Connor1996 force-pushed the Connor1996:master branch from ff2c12c to 310fab8 Nov 30, 2018

@Connor1996

This comment has been minimized.

Copy link
Member Author

commented Nov 30, 2018

@Connor1996 Connor1996 changed the title schedule: change merge leader strategy schedule: change merge match peers strategy Nov 30, 2018

statle test
Signed-off-by: Connor1996 <zbk602423539@gmail.com>

@Connor1996 Connor1996 force-pushed the Connor1996:master branch from 7d99502 to 2ea0175 Nov 30, 2018

steps = append(steps, RemovePeer{FromStore: peer.GetStoreId()})
kind |= OpRegion
index++

This comment has been minimized.

Copy link
@zhangjinpeng1987

zhangjinpeng1987 Dec 3, 2018

Contributor

Please check if index == len(toAdds) after this loop.

@nolouch

nolouch approved these changes Dec 3, 2018

Copy link
Member

left a comment

LGTM

@Connor1996 Connor1996 force-pushed the Connor1996:master branch from 1316b58 to ebbdd63 Dec 4, 2018

address comment
Signed-off-by: Connor1996 <zbk602423539@gmail.com>

@Connor1996 Connor1996 force-pushed the Connor1996:master branch from ebbdd63 to a2d3274 Dec 4, 2018

@nolouch nolouch merged commit 6ebba48 into pingcap:master Dec 6, 2018

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-pd/build Jenkins job succeeded.
Details
jenkins-ci-pd/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

Connor1996 added a commit to Connor1996/pd that referenced this pull request Dec 11, 2018

Connor1996 added a commit to Connor1996/pd that referenced this pull request Dec 11, 2018

Connor1996 added a commit that referenced this pull request Dec 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.