HDFS-11547. Add logs for slow BlockReceiver while writing data to disk. Contributed by Xiaobing Zhou.

This commit is contained in:
Arpit Agarwal 2017-03-17 19:02:24 -07:00
parent e44569b736
commit 5d7197b2e6
1 changed files with 4 additions and 0 deletions

View File

@ -711,6 +711,10 @@ private int receivePacket() throws IOException {
streams.writeDataToDisk(dataBuf.array(),
startByteToDisk, numBytesToDisk);
long duration = Time.monotonicNow() - begin;
if (duration > datanodeSlowLogThresholdMs) {
LOG.warn("Slow BlockReceiver write data to disk cost:" + duration
+ "ms (threshold=" + datanodeSlowLogThresholdMs + "ms)");
}
if (duration > maxWriteToDiskMs) {
maxWriteToDiskMs = duration;