You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Song Ziyang (Jira)" <ji...@apache.org> on 2022/10/25 07:30:00 UTC

[jira] [Commented] (RATIS-1708) RaftLog file channel closed before async flush ends

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

Song Ziyang commented on RATIS-1708:
------------------------------------

[~szetszwo] I found that this pr is not picked into 2.4.0 :(. 

The problem is reproduced every run when turning on async/unsafe flush option. Simply turning off async flush will lead to a 40% increase of request latency. Is there any workarounds we can take under 2.4.0?

> RaftLog file channel closed before async flush ends
> ---------------------------------------------------
>
>                 Key: RATIS-1708
>                 URL: https://issues.apache.org/jira/browse/RATIS-1708
>             Project: Ratis
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Song Ziyang
>            Assignee: Song Ziyang
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: 746_review.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When remove a peer from current raft group, we receive flooding error message
>  
> 2022-09-13 16:31:07,877 [192.168.130.5_40010@group-000100000004-SegmentedRaftLogWorker-flush-thread1] ERROR o.a.r.s.r.s.BufferedWriteChannel:115 - Failed to flush channel
> java.nio.channels.ClosedChannelException: null
>         at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:110)
>         at sun.nio.ch.FileChannelImpl.force(FileChannelImpl.java:379)
>         at org.apache.ratis.server.raftlog.segmented.BufferedWriteChannel.fileChannelForce(BufferedWriteChannel.java:113)
>         at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
>  
> After checking the code, we think that the raft log is closed before asyncFlush future returns. That is, close() should wait the result in ([https://github.com/apache/ratis/blob/b7b87340b9ef5197fd751dd1a5dd1f9b68b8ffab/ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/BufferedWriteChannel.java#L106)] 



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