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 1c077098a9..4829e8c578 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 @@ -57,6 +57,7 @@ import org.apache.hadoop.util.DataChecksum; import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.Time; +import org.apache.hadoop.util.DiskChecker.DiskOutOfSpaceException; import org.apache.hadoop.tracing.Span; import org.apache.hadoop.tracing.Tracer; @@ -274,10 +275,9 @@ class BlockReceiver implements Closeable { if (isCreate) { BlockMetadataHeader.writeHeader(checksumOut, diskChecksum); } - } catch (ReplicaAlreadyExistsException bae) { - throw bae; - } catch (ReplicaNotFoundException bne) { - throw bne; + } catch (ReplicaAlreadyExistsException | ReplicaNotFoundException + | DiskOutOfSpaceException e) { + throw e; } catch(IOException ioe) { if (replicaInfo != null) { replicaInfo.releaseAllBytesReserved(); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/RoundRobinVolumeChoosingPolicy.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/RoundRobinVolumeChoosingPolicy.java index fe010b35a4..fcf07a820d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/RoundRobinVolumeChoosingPolicy.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/RoundRobinVolumeChoosingPolicy.java @@ -117,14 +117,13 @@ private V chooseVolume(final int curVolumeIndex, final List volumes, maxAvailable = availableVolumeSize; } + LOG.warn("The volume[{}] with the available space (={} B) is " + + "less than the block size (={} B).", volume.getBaseURI(), + availableVolumeSize, blockSize); if (curVolume == startVolume) { throw new DiskOutOfSpaceException("Out of space: " + "The volume with the most available space (=" + maxAvailable + " B) is less than the block size (=" + blockSize + " B)."); - } else { - LOG.warn("The volume[{}] with the available space (={} B) is " - + "less than the block size (={} B).", volume.getBaseURI(), - availableVolumeSize, blockSize); } } }