sijie commented on a change in pull request #1130: handle zookeeper session expire in zk ledger manager URL: https://github.com/apache/bookkeeper/pull/1130#discussion_r167467453
########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java ########## @@ -409,7 +426,7 @@ public void processResult(int rc, String path, Object ctx, byte[] data, Stat sta public void writeLedgerMetadata(final long ledgerId, final LedgerMetadata metadata, final GenericCallback<Void> cb) { Version v = metadata.getVersion(); - if (Version.NEW == v || !(v instanceof LongVersion)) { + if (!(v instanceof LongVersion)) { Review comment: this is a bug. if you take a look at this line (https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/AbstractZkLedgerManager.java#L416), it directly casts v to LongVersion. so the passed-in `metadata.getVersion()` has to be `LongVersion`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services