diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java index 0ca222c083c9b..eeec1bb728825 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java @@ -1826,7 +1826,7 @@ public ReplicaInPipeline convertTemporaryToRbw( if(rbw.getState() != ReplicaState.RBW) { throw new IOException("Expected replica state: " + ReplicaState.RBW + " obtained " + rbw.getState() + " for converting block " - + b.getBlockId()); + + b); } // overwrite the RBW in the volume map volumeMap.add(b.getBlockPoolId(), rbw.getReplicaInfo()); @@ -1977,7 +1977,7 @@ public void finalizeBlock(ExtendedBlock b, boolean fsyncDir) b.getBlockPoolId(), getStorageUuidForLock(b))) { if (Thread.interrupted()) { // Don't allow data modifications from interrupted threads - throw new IOException("Cannot finalize block from Interrupted Thread"); + throw new IOException("Cannot finalize block: " + b + " from Interrupted Thread"); } replicaInfo = getReplicaInfo(b); if (replicaInfo.getState() == ReplicaState.FINALIZED) { @@ -2016,7 +2016,7 @@ private ReplicaInfo finalizeReplica(String bpid, ReplicaInfo replicaInfo) if (volumeMap.get(bpid, replicaInfo.getBlockId()).getGenerationStamp() > replicaInfo.getGenerationStamp()) { throw new IOException("Generation Stamp should be monotonically " - + "increased."); + + "increased bpid: " + bpid + ", block: " + replicaInfo); } ReplicaInfo newReplicaInfo = null; @@ -2028,7 +2028,7 @@ private ReplicaInfo finalizeReplica(String bpid, ReplicaInfo replicaInfo) } else { FsVolumeImpl v = (FsVolumeImpl)replicaInfo.getVolume(); if (v == null) { - throw new IOException("No volume for block " + replicaInfo); + throw new IOException("No volume for bpid: " + bpid + ", block: " + replicaInfo); } newReplicaInfo = v.addFinalizedBlock( @@ -2070,7 +2070,7 @@ public void unfinalizeBlock(ExtendedBlock b) throws IOException { volumeMap.remove(b.getBlockPoolId(), b.getLocalBlock()); // delete the on-disk temp file - if (delBlockFromDisk(replicaInfo)) { + if (delBlockFromDisk(replicaInfo, b.getBlockPoolId())) { LOG.warn("Block " + b + " unfinalized and removed. "); } if (replicaInfo.getVolume().isTransientStorage()) { @@ -2091,14 +2091,14 @@ public void unfinalizeBlock(ExtendedBlock b) throws IOException { * @param info the replica that needs to be deleted * @return true if data for the replica are deleted; false otherwise */ - private boolean delBlockFromDisk(ReplicaInfo info) { + private boolean delBlockFromDisk(ReplicaInfo info, String bpid) { if (!info.deleteBlockData()) { - LOG.warn("Not able to delete the block data for replica " + info); + LOG.warn("Not able to delete the block data for replica {}, bpid: {}", info, bpid); return false; } else { // remove the meta file if (!info.deleteMetadata()) { - LOG.warn("Not able to delete the meta data for replica " + info); + LOG.warn("Not able to delete the meta data for replica {}, bpid: {}", info, bpid); return false; } }