Skip to content

Commit e5105fc

Browse files
tomscutHarshitGupta11
authored andcommitted
HDFS-16274. Improve error msg for FSNamesystem#startFileInt (apache#3554)
* HDFS-16274. Improve log for FSNamesystem#startFileInt * fix failed unit test
1 parent 468177b commit e5105fc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,11 +2722,10 @@ private HdfsFileStatus startFileInt(String src,
27222722
iip = FSDirWriteFileOp.resolvePathForStartFile(
27232723
dir, pc, src, flag, createParent);
27242724

2725-
27262725
if (blockSize < minBlockSize) {
2727-
throw new IOException("Specified block size is less than configured" +
2728-
" minimum value (" + DFSConfigKeys.DFS_NAMENODE_MIN_BLOCK_SIZE_KEY
2729-
+ "): " + blockSize + " < " + minBlockSize);
2726+
throw new IOException("Specified block size " + blockSize +
2727+
" is less than configured minimum value " +
2728+
DFSConfigKeys.DFS_NAMENODE_MIN_BLOCK_SIZE_KEY + "=" + minBlockSize);
27302729
}
27312730

27322731
if (shouldReplicate) {

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileLimit.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,9 @@ public void testMinBlockSizeLimit() throws Exception {
210210
assert false : "Expected IOException after creating a file with small" +
211211
" blocks ";
212212
} catch (IOException e) {
213-
GenericTestUtils.assertExceptionContains("Specified block size is less",
214-
e);
213+
GenericTestUtils.assertExceptionContains(
214+
"is less than configured minimum value " +
215+
"dfs.namenode.fs-limits.min-block-size=", e);
215216
}
216217
} finally {
217218
cluster.shutdown();

0 commit comments

Comments
 (0)