zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From af...@apache.org
Subject zookeeper git commit: ZOOKEEPER-2824: `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
Date Thu, 01 Feb 2018 23:27:21 GMT
Repository: zookeeper
Updated Branches:
  refs/heads/branch-3.5 85acd1bed -> 0b6442a1e


ZOOKEEPER-2824: `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

`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

------
Example from jenkins [log](https://builds.apache.org/job/PreCommit-ZOOKEEPER-github-pr-build/830/console):
```java
2017-06-28 10:25:16,645 [myid:] - WARN  [SyncThread:0:FileTxnLog341] - fsync-ing the write
ahead log (1945616 bytes) in SyncThread:0 took 2240ms which will adversely effect operation
latency. See the ZooKeeper troubleshooting guide
```

Author: asdf2014 <benedictjin2016@gmail.com>
Author: asdf2014 <1571805553@qq.com>

Reviewers: Patrick Hunt <phunt@apache.org>, Andor Molnár <andor@cloudera.com>,
Abraham Fine <afine@apache.org>

Closes #296 from asdf2014/ZOOKEEPER-2824 and squashes the following commits:

7cf4b6848 [asdf2014] Improve latency log description
dd2268f2f [asdf2014] ZOOKEEPER-2824: `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

(cherry picked from commit 069c3e4fccbd56307b19b57864fbf6312ace2219)

Signed-off-by: Abraham Fine <afine@apache.org>

Signed-off-by: Abraham Fine <afine@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/0b6442a1
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/0b6442a1
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/0b6442a1

Branch: refs/heads/branch-3.5
Commit: 0b6442a1e49adae20277561941eee24631dde170
Parents: 85acd1b
Author: Benedict Jin <benedictjin2016@gmail.com>
Authored: Thu Feb 1 15:26:58 2018 -0800
Committer: Abraham Fine <afine@apache.org>
Committed: Thu Feb 1 15:27:15 2018 -0800

----------------------------------------------------------------------
 .../main/org/apache/zookeeper/server/persistence/FileTxnLog.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/0b6442a1/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
----------------------------------------------------------------------
diff --git a/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java b/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
index a35ae64..9edc38e 100644
--- a/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
+++ b/src/java/main/org/apache/zookeeper/server/persistence/FileTxnLog.java
@@ -370,7 +370,8 @@ public class FileTxnLog implements TxnLog {
             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) {
@@ -378,6 +379,7 @@ public class FileTxnLog implements TxnLog {
                             + Thread.currentThread().getName()
                             + " took " + syncElapsedMS
                             + "ms which will adversely effect operation latency. "
+                            + "File size is " + channel.size() + " bytes. "
                             + "See the ZooKeeper troubleshooting guide");
                 }
             }


Mime
View raw message