[
https://issues.apache.org/jira/browse/ZOOKEEPER-2824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16068947#comment-16068947
]
ASF GitHub Bot commented on ZOOKEEPER-2824:
-------------------------------------------
Github user afine commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/296#discussion_r124906442
--- 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 --
According to the javadoc, `size()` returns "Returns the current size of
this channel's file." Can you explain why this is valuable?
> `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)