[ https://issues.apache.org/jira/browse/ZOOKEEPER-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16069337#comment-16069337 ]
ASF GitHub Bot commented on ZOOKEEPER-2824: ------------------------------------------- Github user asdf2014 commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/296#discussion_r124950647 --- Diff: src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java --- @@ -332,11 +333,13 @@ public synchronized void commit() throws IOException { if (forceSync) { long startSyncNS = System.nanoTime(); - log.getChannel().force(false); + FileChannel channel = log.getChannel(); + channel.force(false); syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS); if (syncElapsedMS > fsyncWarningThresholdMS) { - LOG.warn("fsync-ing the write ahead log in " + LOG.warn("fsync-ing the write ahead log (" + + channel.size() + " bytes) in " --- End diff -- @afine Thank you for code review. When we got the warn message, will confuse that reason is `too large log` or `too busy disk I/O`? So, need to show the size of log to eliminate the `too large log` possibility. > `FileChannel#size` info should be added to `FileTxnLog#commit` to solve the > confuse that reason is too large log or too busy disk I/O > ------------------------------------------------------------------------------------------------------------------------------------- > > Key: ZOOKEEPER-2824 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2824 > Project: ZooKeeper > Issue Type: Improvement > Components: server > Affects Versions: 3.5.3 > Reporter: Benedict Jin > Assignee: Benedict Jin > Priority: Minor > Labels: logging > Fix For: 3.5.4, 3.6.0 > > Original Estimate: 24h > Remaining Estimate: 24h > > `FileChannel#size` info should be added to `FileTxnLog#commit` to solve the > confuse that reason is too large log or too busy disk I/O -- This message was sent by Atlassian JIRA (v6.4.14#64029)