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

ASF GitHub Bot commented on FLINK-9325:
---------------------------------------

Github user sihuazhou commented on the issue:

    https://github.com/apache/flink/pull/5982
  
    Hi @StephanEwen Thank you very much for your reply, I'm not sure whether 
just overriding `close()` to do `super.close()` + `rename()` is enough, for 
example.
    ```
    try (outputStream = new TwoPhraseFSDatautputStream(...)) {
        outputStream.write("part1");
        throw new RuntimeException("xxx");
        outputStream.write("part2");
    }
    ```
    This will also rename the `tmp file` to the `target file`, because we just 
`rename()` in `close()`. And the current `TwoPhraseFSDatautputStream` works as 
a wrapper so it should have supported all the file system. I'm not sure whether 
I misunderstand what your meaning... please let knows if I misunderstand 
something and your opinion, Thanks!



> generate the _meta file for checkpoint only when the writing is truly 
> successful
> --------------------------------------------------------------------------------
>
>                 Key: FLINK-9325
>                 URL: https://issues.apache.org/jira/browse/FLINK-9325
>             Project: Flink
>          Issue Type: Improvement
>          Components: State Backends, Checkpointing
>    Affects Versions: 1.5.0
>            Reporter: Sihua Zhou
>            Assignee: Sihua Zhou
>            Priority: Major
>
> We should generate the _meta file for checkpoint only when the writing is 
> totally successful. We should write the metadata file first to a temp file 
> and then atomically rename it (with an equivalent workaround for S3). 



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

Reply via email to