You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz Wo Nicholas Sze (JIRA)" <ji...@apache.org> on 2019/06/13 00:16:00 UTC

[jira] [Commented] (RATIS-587) FinalizeLogSegment should flush the contents of log

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

Tsz Wo Nicholas Sze commented on RATIS-587:
-------------------------------------------

It seems not a problem since WriteLog will flush and then update flushIndex.  The transactions are not consider as success until the flushIndex is updated.  I.e. either the data are already flushed (so that close don't has to flush it), or the data is not considered as persistent so that it can be lost.

> FinalizeLogSegment should flush the contents of log
> ---------------------------------------------------
>
>                 Key: RATIS-587
>                 URL: https://issues.apache.org/jira/browse/RATIS-587
>             Project: Ratis
>          Issue Type: Bug
>          Components: LogService
>            Reporter: Supratim Deka
>            Priority: Major
>
> SegmentedRaftLog uses a BufferedWriteChannel for writing the log.
> FinalizeLogSegment task is enqueued when a segment fills up. This task closes the channel and does cleanup.
> SegmentedRaftLogOutputStream.close() internally invokes BufferedWriteChannel.flush(false)
> the false passed to flush indicates not to flush the buffer cache.
> This means that the contents of the log file are not persisted on disk. An abrupt power failure could result in loss of committed log entries. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)