Github user anmolnar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/567#discussion_r202364713
--- Diff:
src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
@@ -347,6 +397,13 @@ public synchronized void commit() throws IOException {
while (streamsToFlush.size() > 1) {
streamsToFlush.removeFirst().close();
}
+
+ // Roll the log file if we exceed the size limit
+ long logSize = getCurrentLogSize();
--- End diff --
Please change the order of the if conditions. You probably don't want to
calculate the current log file size if the feature is disabled. Probably not a
big deal performance-wise, but I think it's cleaner code.
---