You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by enixon <gi...@git.apache.org> on 2018/08/09 01:13:15 UTC

[GitHub] zookeeper pull request #560: ZOOKEEPER-3082: Fix server snapshot behavior wh...

Github user enixon commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/560#discussion_r208781421
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnSnapLog.java ---
    @@ -399,8 +399,30 @@ public void save(DataTree dataTree,
             File snapshotFile = new File(snapDir, Util.makeSnapshotName(lastZxid));
             LOG.info("Snapshotting: 0x{} to {}", Long.toHexString(lastZxid),
                     snapshotFile);
    -        snapLog.serialize(dataTree, sessionsWithTimeouts, snapshotFile, syncSnap);
    -
    +        try {
    +            snapLog.serialize(dataTree, sessionsWithTimeouts, snapshotFile, syncSnap);
    +        } catch (IOException e) {
    +            if (snapshotFile.length() == 0) {
    --- End diff --
    
    Created https://issues.apache.org/jira/browse/ZOOKEEPER-3115 to record this idea of deleting the snapshot file on general IOException's and we can continue the conversation there.


---