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 #296
Conversation
…g#commit` to solve the confuse that reason is too large log or too busy disk I/O
|
||
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 " |
afine
Jun 29, 2017
Contributor
According to the javadoc, size()
returns "Returns the current size of this channel's file." Can you explain why this is valuable?
According to the javadoc, size()
returns "Returns the current size of this channel's file." Can you explain why this is valuable?
asdf2014
Jun 30, 2017
Author
Member
@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.
@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.
phunt
Jan 19, 2018
Contributor
@asdf2014 can you move the changed text after the first sentence?
... latency. File size is ### bytes. See ...
The reason being that I know a number of users who have log triggers on this log message and I'd like to minimize the impact as much as possible.
@asdf2014 can you move the changed text after the first sentence?
... latency. File size is ### bytes. See ...
The reason being that I know a number of users who have log triggers on this log message and I'd like to minimize the impact as much as possible.
Hi @asdf2014 I'm happy with the change if it has any help to you for debugging. |
Hi, @anmolnar . Thanks, would you approve this PR? |
|
||
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 " |
…g#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: 7cf4b68 [asdf2014] Improve latency log description dd2268f [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 069c3e4) Signed-off-by: Abraham Fine <afine@apache.org> Signed-off-by: Abraham Fine <afine@apache.org>
Merged. Thanks @asdf2014! |
@afine You are welcome :-) |
…g#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 apache#296 from asdf2014/ZOOKEEPER-2824 and squashes the following commits: 7cf4b68 [asdf2014] Improve latency log description dd2268f [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
FileChannel#size
info should be added toFileTxnLog#commit
to solve the confuse that reason is too large log or too busy disk I/OExample from jenkins log: