[ 
https://issues.apache.org/jira/browse/RATIS-1879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17760146#comment-17760146
 ] 

Tsz-wo Sze commented on RATIS-1879:
-----------------------------------

This issue has two aspects:
 # log corruption
 # lost of committed data

First of all, they are not the same – log corruption may only lead to lost of 
uncommitted data which is okay.

Could we prevent log corruption in all cases? It is impossible, even if we 
invoke fsync every time. No matter how we write the data (fsync or not), the 
machine can lose power in the middle of a write. Then, the log is corrupted. Of 
course, fsync could reduce the probability of corruption. We may provide an 
option to invoke fsync every time.

Our main goal is to prevent lost of committed data (except for unsafeFlush). 
Another goal is to provide some way to fix a corrupted log.

> Handle RaftLog corruption when unsafe flush is enabled.
> -------------------------------------------------------
>
>                 Key: RATIS-1879
>                 URL: https://issues.apache.org/jira/browse/RATIS-1879
>             Project: Ratis
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.0.0, 2.5.1
>            Reporter: Song Ziyang
>            Assignee: Tsz-wo Sze
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> During normal operations of the RaftServer, its containing virtual machine 
> (VM) was unexpectedly shut down and subsequently restarted. Following the VM 
> reboot, *our attempts to restart the RaftServer led to encountering the 
> subsequent exception, indicating corruption in the Raft* {*}Log{*}{*}.{*}
> *The details of this exception please refer to 
> [https://apache-iotdb.feishu.cn/docx/Zmyudq0FYoDVcsxDwHpcINyznfg]* 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to