HDFS-10667. Report more accurate info about data corruption location. (Yuanbo Liu via Yongjun Zhang)
(cherry picked from commit eb7ff0c992
)
This commit is contained in:
parent
096d3fa25c
commit
bd84cf3036
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue