|
@@ -412,6 +412,7 @@ class BlockReceiver implements Closeable {
|
|
void flushOrSync(boolean isSync, long seqno) throws IOException {
|
|
void flushOrSync(boolean isSync, long seqno) throws IOException {
|
|
long flushTotalNanos = 0;
|
|
long flushTotalNanos = 0;
|
|
long begin = Time.monotonicNow();
|
|
long begin = Time.monotonicNow();
|
|
|
|
+ DataNodeFaultInjector.get().delay();
|
|
if (checksumOut != null) {
|
|
if (checksumOut != null) {
|
|
long flushStartNanos = System.nanoTime();
|
|
long flushStartNanos = System.nanoTime();
|
|
checksumOut.flush();
|
|
checksumOut.flush();
|
|
@@ -445,6 +446,7 @@ class BlockReceiver implements Closeable {
|
|
}
|
|
}
|
|
long duration = Time.monotonicNow() - begin;
|
|
long duration = Time.monotonicNow() - begin;
|
|
if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) {
|
|
if (duration > datanodeSlowLogThresholdMs && LOG.isWarnEnabled()) {
|
|
|
|
+ datanode.metrics.incrSlowFlushOrSyncCount();
|
|
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()
|
|
@@ -1656,6 +1658,7 @@ class BlockReceiver implements Closeable {
|
|
}
|
|
}
|
|
// send my ack back to upstream datanode
|
|
// send my ack back to upstream datanode
|
|
long begin = Time.monotonicNow();
|
|
long begin = Time.monotonicNow();
|
|
|
|
+ DataNodeFaultInjector.get().delay();
|
|
/* for test only, no-op in production system */
|
|
/* for test only, no-op in production system */
|
|
DataNodeFaultInjector.get().delaySendingAckToUpstream(inAddr);
|
|
DataNodeFaultInjector.get().delaySendingAckToUpstream(inAddr);
|
|
replyAck.write(upstreamOut);
|
|
replyAck.write(upstreamOut);
|
|
@@ -1665,6 +1668,7 @@ class BlockReceiver implements Closeable {
|
|
inAddr,
|
|
inAddr,
|
|
duration);
|
|
duration);
|
|
if (duration > datanodeSlowLogThresholdMs) {
|
|
if (duration > datanodeSlowLogThresholdMs) {
|
|
|
|
+ datanode.metrics.incrSlowAckToUpstreamCount();
|
|
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
|