Browse Source

HDFS-6055. Change default configuration to limit file name length in HDFS. Contributed by Chris Nauroth.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1576095 13f79535-47bb-0310-9956-ffa450edef68
Chris Nauroth 11 years ago
parent
commit
5bb794566e

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -544,6 +544,9 @@ Release 2.4.0 - UNRELEASED
 
     HDFS-6070. Cleanup use of ReadStatistics in DFSInputStream. (wang)
 
+    HDFS-6055. Change default configuration to limit file name length in HDFS.
+    (cnauroth)
+
   OPTIMIZATIONS
 
     HDFS-5790. LeaseManager.findPath is very slow when many leases need recovery

+ 3 - 3
hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml

@@ -281,9 +281,9 @@
 
 <property>
   <name>dfs.namenode.fs-limits.max-component-length</name>
-  <value>0</value>
-  <description>Defines the maximum number of characters in each component
-      of a path.  A value of 0 will disable the check.</description>
+  <value>255</value>
+  <description>Defines the maximum number of bytes in UTF-8 encoding in each
+      component of a path.  A value of 0 will disable the check.</description>
 </property>
 
 <property>

+ 1 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestSymlinkHdfs.java

@@ -88,6 +88,7 @@ abstract public class TestSymlinkHdfs extends SymlinkBaseTest {
     Configuration conf = new HdfsConfiguration();
     conf.setBoolean(DFSConfigKeys.DFS_WEBHDFS_ENABLED_KEY, true);
     conf.set(FsPermission.UMASK_LABEL, "000");
+    conf.setInt(DFSConfigKeys.DFS_NAMENODE_MAX_COMPONENT_LENGTH_KEY, 0);
     cluster = new MiniDFSCluster.Builder(conf).build();
     webhdfs = WebHdfsTestUtil.getWebHdfsFileSystem(conf, WebHdfsFileSystem.SCHEME);
     dfs = cluster.getFileSystem();