Github user maoling commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/553#discussion_r198735418
--- Diff:
src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java ---
@@ -254,7 +254,7 @@ public synchronized boolean append(TxnHeader hdr,
Record txn)
for (File f : files) {
long fzxid = Util.getZxidFromName(f.getName(),
LOG_FILE_PREFIX);
if (fzxid > snapshotZxid) {
- continue;
+ break;
}
// the files
--- End diff --
@a470577391 Yes,since the files is already order by zxid asc.
I have two suggestions personally if you want to open a new JIRA:
1: rename the method to a explicit one, `getLogFiles` is ambiguous
2. use Java8 lambda to rewrite the method elegantly,`stream, filter, max
`will be useful.
---