HDFS-11547. Add logs for slow BlockReceiver while writing data to disk. Contributed by Xiaobing Zhou.
This commit is contained in:
parent
e44569b736
commit
5d7197b2e6
|
@ -711,6 +711,10 @@ class BlockReceiver implements Closeable {
|
||||||
streams.writeDataToDisk(dataBuf.array(),
|
streams.writeDataToDisk(dataBuf.array(),
|
||||||
startByteToDisk, numBytesToDisk);
|
startByteToDisk, numBytesToDisk);
|
||||||
long duration = Time.monotonicNow() - begin;
|
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) {
|
if (duration > maxWriteToDiskMs) {
|
||||||
maxWriteToDiskMs = duration;
|
maxWriteToDiskMs = duration;
|
||||||
|
|
Loading…
Reference in New Issue