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

View File

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