From 3ecd3628d45983bc7f9f410a4b6ca6959026f4ab Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sun, 20 Dec 2020 15:18:25 +0530 Subject: [PATCH] HDFS-15733. Add seqno in log when BlockReceiver receive packet. Contributed by Haibin Huang. --- .../apache/hadoop/hdfs/server/datanode/BlockReceiver.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java index b6970020b9..825905fb45 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java @@ -537,10 +537,9 @@ private int receivePacket() throws IOException { packetReceiver.receiveNextPacket(in); PacketHeader header = packetReceiver.getHeader(); - if (LOG.isDebugEnabled()){ - LOG.debug("Receiving one packet for block " + block + - ": " + header); - } + long seqno = header.getSeqno(); + LOG.debug("Receiving one packet for block {} seqno:{} header:{} ", block, + seqno, header); // Sanity check the header if (header.getOffsetInBlock() > replicaInfo.getNumBytes()) { @@ -556,7 +555,6 @@ private int receivePacket() throws IOException { } long offsetInBlock = header.getOffsetInBlock(); - long seqno = header.getSeqno(); boolean lastPacketInBlock = header.isLastPacketInBlock(); final int len = header.getDataLen(); boolean syncBlock = header.getSyncBlock();