Github user lvfangmin commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/510#discussion_r192631195 --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java --- @@ -320,6 +332,11 @@ public synchronized void commit() throws IOException { long syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS); if (syncElapsedMS > fsyncWarningThresholdMS) { + if(serverStats != null) { + serverStats.incrementFsyncThresholdExceedCount(); + } else { + LOG.warn("fsyncWarningThresholdMS exceeded, but serverStats not added in FileTxnLog!"); --- End diff -- This log seems redundant to me, we can tell the fsync threshold exceeded from the log at line 340, and serverStats is set, we know there will be stats in serverStats, otherwise we know it's not set.
---