[
https://issues.apache.org/jira/browse/RATIS-1995?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze resolved RATIS-1995.
-------------------------------
Fix Version/s: 3.2.0
Resolution: Fixed
The pull request is merged.
After the change, when the leader election candidate has non-empty commits, it
won't accept a vote from a peer voter with empty Raft log.
> Prevent data loss when a storage is accidentally re-formatted
> -------------------------------------------------------------
>
> Key: RATIS-1995
> URL: https://issues.apache.org/jira/browse/RATIS-1995
> Project: Ratis
> Issue Type: Bug
> Components: election
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Major
> Fix For: 3.2.0
>
>
> Similar to the problem described in RATIS-1677, if the RaftStorage in a peer
> is accidentally re-formatted, it could cause data loss.
> Consider the following
> # Server A and Server B were fast and had commit index 100 while server C had
> commit index 90.
> # The RaftStorage of Server A was accidentally re-formatted and Server A was
> restarted. Its commit index became -1.
> # Server C started a leader election and Server A voted for it. The commit
> index became 90 – it lost the commits from index 91 to index 100.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)