-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 after snapshot is aborted #11618
Labels
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
severity/major
type/bug
The issue is confirmed as a bug.
Comments
/cc @BusyJay @NingLin-P |
gengliqi
added
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
type/bug
The issue is confirmed as a bug.
labels
Dec 9, 2021
any update? |
I will fix it in a simple way first. |
tonyxuqqi
added a commit
to tonyxuqqi/tikv
that referenced
this issue
Jan 5, 2022
…kv#11618 Signed-off-by: tonyxuqqi <tonyxuqi@outlook.com>
tonyxuqqi
added a commit
to tonyxuqqi/tikv
that referenced
this issue
Jan 5, 2022
Signed-off-by: tonyxuqqi <tonyxuqi@outlook.com>
/assign tonyxuqqi |
tonyxuqqi
added a commit
to tonyxuqqi/tikv
that referenced
this issue
Jan 6, 2022
Signed-off-by: tonyxuqqi <tonyxuqi@outlook.com>
tonyxuqqi
added a commit
to tonyxuqqi/tikv
that referenced
this issue
Jan 7, 2022
Signed-off-by: tonyxuqqi <tonyxuqi@outlook.com>
tonyxuqqi
added a commit
to tonyxuqqi/tikv
that referenced
this issue
Jan 7, 2022
Signed-off-by: tonyxuqqi <tonyxuqi@outlook.com>
ti-chi-bot
added a commit
that referenced
this issue
Apr 13, 2022
This was referenced Apr 13, 2022
close due to #11796 |
ti-chi-bot
pushed a commit
that referenced
this issue
Dec 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
severity/major
type/bug
The issue is confirmed as a bug.
Affected version
v5.0.0-v5.0.5, v5.1.0-v5.1.3, v5.2.0-v5.2.3
Bug Report
TiKV's version is 5.2.2.
If the snapshot is aborted, the peer can tick because
is_applying_snapshot
returns false here.tikv/components/raftstore/src/store/fsm/peer.rs
Lines 1180 to 1194 in 7acaec5
After the election timeout,
hup
will be called and panic will happen because the log betweenapplied_index
andlast_index
does not exist.In release-4.0, since the
advance_apply
is called after the snapshot is just persisted then theapplied_index
is updated, this panic can not happen. Actually, it’s just good luck.In 5.3 and master, the
is_applying_snapshot
is replaced withis_handling_snapshot
. Theis_handling_snapshot
returns true even when the snapshot is aborted. Therefore, panic won't happen either.In most cases, the peer will be destroyed soon if the snapshot is aborted. However, when the network is partitioned for a while duration that time, the peer may stay exist for a long time. This is because the peer needs an extra message to trigger the destroy process.
We can fix this bug by moving the position of
advance_apply
like release-4.0 but the root cause is not completely resolved. There may be some other bugs hidden under the iceberg.We should totally fix this bug(maybe bugs) by destroying peer after snapshot is aborted.
The text was updated successfully, but these errors were encountered: