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

Panic on leader election after `catch_up_log_for_merge` #4581

overvenus opened this issue Apr 26, 2019 · 0 comments · Fixed by #4595


Copy link

@overvenus overvenus commented Apr 26, 2019

Bug Report

TiKV panics on leader election if catch_up_log_for_merge applies a compact log command. Let's say there is a peer truncated_index = 6, applied_index = 7, commit_index = 8, last_index = 10, and the peer is going to be merged into a target. When the target applies a commit_merge command, it will first send a CatchupLog task to the peer, after receiving the task, the peer will load entries [9, lastest_commit_index] and apply them. If there are some compact log commands in these entries, truncated_index will be updated, however, the peer is going to be merged, so applied_index does not update.

There is a chance that applied_index = 7 and truncated_index = 9, this leads to panic on leader election.

The fix mentioned in #4560 also resolves this bug.

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