Brian Nixon created ZOOKEEPER-3115:
--------------------------------------

             Summary: Delete snapshot file on error
                 Key: ZOOKEEPER-3115
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3115
             Project: ZooKeeper
          Issue Type: Improvement
          Components: server
    Affects Versions: 3.6.0
            Reporter: Brian Nixon


ZOOKEEPER-3082 guards against one particular failure mode that can cause a 
corrupt snapshot, when a empty file is created with a valid snapshot file name. 
All other instances of IOException when writing the snapshot are simply allowed 
to propagate up the stack.

One idea that came up during review 
([https://github.com/apache/zookeeper/pull/560)] was whether we would ever want 
to leave a snapshot file on disk when an IOException is thrown. Clearly 
something has gone wrong at this point and rather than leave a potentially 
corrupt file, we can delete it and trust the transaction log when restoring the 
necessary transactions.

It would be great to modify FileTxnSnapLog::save to delete snapshot files more 
often on exceptions - provided that there's a way to identify when the file in 
that case is needed or corrupt.



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

Reply via email to