Skip to content

raftstore: rely on the all-target-peer-exist guarantee during merging (#7672)#8005

Merged
hicqu merged 5 commits intotikv:release-3.0from
sre-bot:release-3.0-ed337a441652
Jun 28, 2020
Merged

raftstore: rely on the all-target-peer-exist guarantee during merging (#7672)#8005
hicqu merged 5 commits intotikv:release-3.0from
sre-bot:release-3.0-ed337a441652

Conversation

@sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Jun 3, 2020

cherry-pick #7672 to release-3.0


Signed-off-by: Liqi Geng gengliqiii@gmail.com

What problem does this PR solve?

Problem Summary:

In the past, we assume some target peers may not exist during merging. It introduces many complexities that we need to think about how to handle it.

Also, there are some cases we can not handle.

For example, a target peer does not exist during merging. Its corresponding source peer is waiting for it to be created. Then other target peers do the conf change and remove it(though it never existed). Next, the target region merges to another target region.

In this case, the waiting source peer can not find out whether it should be removed. (It's very difficult, the PD knows nothing because the target region has merged to another one)

Luckily, in tikv/pd#839 (the earliest PR about merging in PD), it checks the target peer's pending peer count must equal to zero.
So we can rely on the all-target-peer-exist guarantee to make it easier and save our brain power.

What is changed and how it works?

What's Changed:

Rely on the all-target-peer-exist guarantee during merging.
Remove some code about handling some cases when a target peer may not exist during merging.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • No code

Side effects

We should check it twice whether the earliest version can give us this guarantee.
Otherwise, it will break backward compatibility.

Release note

  • Fix a case that a peer can not be removed when its store is isolated during multiple merge process.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 3, 2020

/run-all-tests

@sre-bot sre-bot added sig/raft Component: Raft, RaftStore, etc. type/bugfix This PR fixes a bug. type/cherry-pick Type: PR - Cherry pick labels Jun 3, 2020
@sre-bot sre-bot added this to the v3.0.15 milestone Jun 3, 2020
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
@gengliqi
Copy link
Member

gengliqi commented Jun 3, 2020

/run-all-tests

@5kbpers 5kbpers modified the milestones: v3.0.15, v3.0.16 Jun 3, 2020
@hicqu
Copy link
Contributor

hicqu commented Jun 28, 2020

/merge

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

Your auto merge job has been accepted, waiting for:

  • 8135

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@sre-bot merge failed.

@hicqu
Copy link
Contributor

hicqu commented Jun 28, 2020

/run-all-tests

@hicqu
Copy link
Contributor

hicqu commented Jun 28, 2020

/run-all-tests

@hicqu
Copy link
Contributor

hicqu commented Jun 28, 2020

/run-all-tests

@hicqu hicqu merged commit 74c8a65 into tikv:release-3.0 Jun 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sig/raft Component: Raft, RaftStore, etc. status/can-merge Indicates a PR has been approved by a committer. type/bugfix This PR fixes a bug. type/cherry-pick Type: PR - Cherry pick

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants