HDFS-12814. Add blockId when warning slow mirror/disk in BlockReceiver. Contributed by Jiandan Yang.

This commit is contained in:
Weiwei Yang 2017-11-16 16:19:53 +08:00
parent 09a1342608
commit 462e25a3b2
1 changed files with 11 additions and 5 deletions

View File

@ -434,7 +434,8 @@ class BlockReceiver implements Closeable {
if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) { if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) {
LOG.warn("Slow flushOrSync took " + duration + "ms (threshold=" LOG.warn("Slow flushOrSync took " + duration + "ms (threshold="
+ datanodeSlowLogThresholdMs + "ms), isSync:" + isSync + ", flushTotalNanos=" + datanodeSlowLogThresholdMs + "ms), isSync:" + isSync + ", flushTotalNanos="
+ flushTotalNanos + "ns, volume=" + getVolumeBaseUri()); + flushTotalNanos + "ns, volume=" + getVolumeBaseUri()
+ ", blockId=" + replicaInfo.getBlockId());
} }
} }
@ -591,7 +592,8 @@ class BlockReceiver implements Closeable {
if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) { if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) {
LOG.warn("Slow BlockReceiver write packet to mirror took " + duration LOG.warn("Slow BlockReceiver write packet to mirror took " + duration
+ "ms (threshold=" + datanodeSlowLogThresholdMs + "ms), " + "ms (threshold=" + datanodeSlowLogThresholdMs + "ms), "
+ "downstream DNs=" + Arrays.toString(downstreamDNs)); + "downstream DNs=" + Arrays.toString(downstreamDNs)
+ ", blockId=" + replicaInfo.getBlockId());
} }
} catch (IOException e) { } catch (IOException e) {
handleMirrorOutError(e); handleMirrorOutError(e);
@ -725,7 +727,8 @@ class BlockReceiver implements Closeable {
if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) { if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) {
LOG.warn("Slow BlockReceiver write data to disk cost:" + duration LOG.warn("Slow BlockReceiver write data to disk cost:" + duration
+ "ms (threshold=" + datanodeSlowLogThresholdMs + "ms), " + "ms (threshold=" + datanodeSlowLogThresholdMs + "ms), "
+ "volume=" + getVolumeBaseUri()); + "volume=" + getVolumeBaseUri()
+ ", blockId=" + replicaInfo.getBlockId());
} }
if (duration > maxWriteToDiskMs) { if (duration > maxWriteToDiskMs) {
@ -917,7 +920,8 @@ class BlockReceiver implements Closeable {
if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) { if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) {
LOG.warn("Slow manageWriterOsCache took " + duration LOG.warn("Slow manageWriterOsCache took " + duration
+ "ms (threshold=" + datanodeSlowLogThresholdMs + "ms (threshold=" + datanodeSlowLogThresholdMs
+ "ms), volume=" + getVolumeBaseUri()); + "ms), volume=" + getVolumeBaseUri()
+ ", blockId=" + replicaInfo.getBlockId());
} }
} }
} catch (Throwable t) { } catch (Throwable t) {
@ -1629,7 +1633,9 @@ class BlockReceiver implements Closeable {
if (duration > datanodeSlowLogThresholdMs) { if (duration > datanodeSlowLogThresholdMs) {
LOG.warn("Slow PacketResponder send ack to upstream took " + duration LOG.warn("Slow PacketResponder send ack to upstream took " + duration
+ "ms (threshold=" + datanodeSlowLogThresholdMs + "ms), " + myString + "ms (threshold=" + datanodeSlowLogThresholdMs + "ms), " + myString
+ ", replyAck=" + replyAck); + ", replyAck=" + replyAck
+ ", downstream DNs=" + Arrays.toString(downstreamDNs)
+ ", blockId=" + replicaInfo.getBlockId());
} else if (LOG.isDebugEnabled()) { } else if (LOG.isDebugEnabled()) {
LOG.debug(myString + ", replyAck=" + replyAck); LOG.debug(myString + ", replyAck=" + replyAck);
} }