From eb7ff0c9927131f4a797148b970a95a1abf7d847 Mon Sep 17 00:00:00 2001 From: Yongjun Zhang Date: Wed, 27 Jul 2016 13:58:04 -0700 Subject: [PATCH] HDFS-10667. Report more accurate info about data corruption location. (Yuanbo Liu via Yongjun Zhang) --- .../apache/hadoop/hdfs/server/datanode/BlockReceiver.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 8f9138ca6bb..b6f0b011464 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 @@ -470,7 +470,13 @@ class BlockReceiver implements Closeable { try { clientChecksum.verifyChunkedSums(dataBuf, checksumBuf, clientname, 0); } catch (ChecksumException ce) { - LOG.warn("Checksum error in block " + block + " from " + inAddr, ce); + PacketHeader header = packetReceiver.getHeader(); + String specificOffset = "specific offsets are:" + + " offsetInBlock = " + header.getOffsetInBlock() + + " offsetInPacket = " + ce.getPos(); + LOG.warn("Checksum error in block " + + block + " from " + inAddr + + ", " + specificOffset, ce); // No need to report to namenode when client is writing. if (srcDataNode != null && isDatanode) { try {