zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eribeiro <...@git.apache.org>
Subject [GitHub] zookeeper pull request #120: ZOOKEEPER-261
Date Thu, 12 Jan 2017 03:41:29 GMT
Github user eribeiro commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/120#discussion_r95721046
  
    --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnSnapLog.java ---
    @@ -175,11 +193,20 @@ public long restore(DataTree dt, Map<Long, Integer> sessions,
                             "No snapshot found, but there are log entries. " +
                             "Something is broken!");
                 }
    -            /* TODO: (br33d) we should either put a ConcurrentHashMap on restore()
    -             *       or use Map on save() */
    -            save(dt, (ConcurrentHashMap<Long, Integer>)sessions);
    -            /* return a zxid of zero, since we the database is empty */
    -            return 0;
    +
    +            if (suspectEmptyDB) {
    +                /* return a zxid of -1, since we are possibly missing data */
    +                LOG.warn("Unexpected empty data tree, setting zxid to -1");
    --- End diff --
    
    Are we 100% sure the data tree is empty? Couldn't it be only partially complete? I mean
the machine recorded up to transaction n, but lost transactions n+1, n+2, n+3, etc?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message