-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
raftstore: change the condition of proposing rollback merge #6584
Conversation
398ebba
to
f9ccd0d
Compare
Please fix the conflict. |
f9ccd0d
to
0cedb5e
Compare
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
cd57266
to
9b9f2d9
Compare
PTAL |
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
dfe8a1d
to
1c53a53
Compare
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
30cfa39
to
2db59be
Compare
PTAL |
.peer | ||
.add_want_rollback_merge_peer(self.fsm.peer_id()); | ||
if self.fsm.peer.want_rollback_merge_peers.len() | ||
>= raft::majority( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to ensure peers in want_rollback_merge_peers
matches the current peer_list
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be ensured. If a peer can be added to want_rollback_merge_peers
, it must be in current peer_list
because its PrepareMerge
commit index is the same as the leader's.
self.fsm.peer.pending_merge_state = None; | ||
self.fsm.peer.want_rollback_merge_peers.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should clear when applying snapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After applying a snapshot, on_ready_rollback_merge
will be called.
/run-all-tests |
@gengliqi merge failed. |
/merge |
/run-all-tests |
cherry pick to release-4.0 in PR #7664 |
I think 3.0 and 3.1 also needs this fix. |
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
Yes. 2.1 needs it too. I will add proto first then cherry-pick to these branches |
/run-cherry-picker |
cherry pick to release-3.1 in PR #7762 |
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
Signed-off-by: Liqi Geng <gengliqiii@gmail.com>
txn: only wake up waiters when locks are indeed released (tikv#7379) (tikv#7585) Signed-off-by: youjiali1995 <zlwgx1023@gmail.com> txn: don't protect rollback for BatchRollback (tikv#7605) (tikv#7608) Signed-off-by: youjiali1995 <zlwgx1023@gmail.com> tidb_query: add is true/false keep null ScalarFuncSig (tikv#7532) (tikv#7566) Signed-off-by: zhongzc <zhongzc_arch@outlook.com> tidb_query: fix the logical behavior of floats (tikv#7342) (tikv#7582) Signed-off-by: zhongzc <zhongzc_arch@outlook.com> tidb_query: fix converting bytes to bool (tikv#7486) (tikv#7547) Signed-off-by: zhongzc <zhongzc_arch@outlook.com> raftstore: change the condition of proposing rollback merge (tikv#6584) (tikv#7762) Signed-off-by: Liqi Geng <gengliqiii@gmail.com> Signed-off-by: Tong Zhigao <tongzhigao@pingcap.com>
Signed-off-by: Liqi Geng gengliqiii@gmail.com
What have you changed?
In the previous implementation, the source peer will propose rollback merge
after the local target peer's epoch is larger than recorded previously.
In the current implementation, the rollback merge proposal can be proposed only when
the number of peers who want to rollback merge is greater than the majority of all
peers. If so, this merge is impossible to succeed.
The added failpoint test constructs a case that writing data to source region
after merging. This operation can succeed in the previous implementation which
causes data loss.
What is the type of the changes?
How is the PR tested?
Does this PR affect documentation (docs) or should it be mentioned in the release notes?
No
Does this PR affect
tidb-ansible
?No