Author: rangadi
Date: Tue Jun 16 02:11:52 2009
New Revision: 785054
URL: http://svn.apache.org/viewvc?rev=785054&view=rev
Log:
HADOOP-6017. Lease Manager in NameNode does not handle certain characters
in filenames. This results in fatal errors in Secondary NameNode and while
restrating NameNode. (Tsz Wo (Nicholas), SZE via rangadi)
Modified:
hadoop/core/branches/branch-0.19/ (props changed)
hadoop/core/branches/branch-0.19/CHANGES.txt (contents, props changed)
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
Propchange: hadoop/core/branches/branch-0.19/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 16 02:11:52 2009
@@ -1 +1,2 @@
-/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,709040,709303,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,736426,738697,740077,741703,741762,743745,743892,745180,746902-746903,752073,752609,752836,753112-753113,753346,755370,755938,757448,757849,758156,759398
+/hadoop/core/branches/branch-0.20:785053
+/hadoop/core/trunk:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,709040,709303,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,736426,738697,740077,741703,741762,743745,743892,745180,746902-746903,752073,752609,752836,753112-753113,753346,755370,755938,757448,757849,758156,759398,785046
Modified: hadoop/core/branches/branch-0.19/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/CHANGES.txt?rev=785054&r1=785053&r2=785054&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.19/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.19/CHANGES.txt Tue Jun 16 02:11:52 2009
@@ -1230,6 +1230,10 @@
HADOOP-5644. Namnode is stuck in safe mode. (Suresh Srinivas via hairong)
+ HADOOP-6017. Lease Manager in NameNode does not handle certain characters
+ in filenames. This results in fatal errors in Secondary NameNode and while
+ restrating NameNode. (Tsz Wo (Nicholas), SZE via rangadi)
+
Release 0.18.3 - 2009-01-27
IMPROVEMENTS
Propchange: hadoop/core/branches/branch-0.19/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 16 02:11:52 2009
@@ -1,3 +1,3 @@
/hadoop/core/branches/branch-0.18/CHANGES.txt:727226
-/hadoop/core/branches/branch-0.20/CHANGES.txt:752591
-/hadoop/core/trunk/CHANGES.txt:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,708723,709040,709303,711717,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,735082,736426,738697,740077,741703,741762,743296,743745,743892,745180,746902-746903,752073,752590,752609,752836,753112-753113,753346,755370,755938,757448,757849,758156,759398
+/hadoop/core/branches/branch-0.20/CHANGES.txt:752591,785053
+/hadoop/core/trunk/CHANGES.txt:697306,698176,699056,699098,699415,699424,699444,699490,699517,700163,700628,700923,701273,701398,703923,704203,704261,704701,704703,704707,704712,704732,704748,704989,705391,705420,705430,705762,706350,706707,706719,706796,706802,707258,707262,708623,708641,708710,708723,709040,709303,711717,712881,713888,720602,723013,723460,723831,723918,724883,727117,727212,727217,727228,727869,732572,732777,733887,734870,735082,736426,738697,740077,741703,741762,743296,743745,743892,745180,746902-746903,752073,752590,752609,752836,753112-753113,753346,755370,755938,757448,757849,758156,759398,785046
Modified:
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java?rev=785054&r1=785053&r2=785054&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
(original)
+++
hadoop/core/branches/branch-0.19/src/hdfs/org/apache/hadoop/hdfs/server/namenode/LeaseManager.java
Tue Jun 16 02:11:52 2009
@@ -285,11 +285,12 @@
", replaceBy=" + replaceBy);
}
+ final int len = overwrite.length();
for(Map.Entry<String, Lease> entry : findLeaseWithPrefixPath(src,
sortedLeasesByPath)) {
final String oldpath = entry.getKey();
final Lease lease = entry.getValue();
- final String newpath = oldpath.replaceFirst(
- java.util.regex.Pattern.quote(overwrite), replaceBy);
+ //overwrite must be a prefix of oldpath
+ final String newpath = replaceBy + oldpath.substring(len);
if (LOG.isDebugEnabled()) {
LOG.debug("changeLease: replacing " + oldpath + " with " + newpath);
}
Modified:
hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
URL:
http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestRenameWhileOpen.java?rev=785054&r1=785053&r2=785054&view=diff
==============================================================================
---
hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
(original)
+++
hadoop/core/branches/branch-0.19/src/test/org/apache/hadoop/hdfs/TestRenameWhileOpen.java
Tue Jun 16 02:11:52 2009
@@ -82,6 +82,17 @@
fs.mkdirs(dir3);
fs.rename(dir1, dir3);
+ // create file3
+ Path file3 = new Path(dir3, "file3");
+ FSDataOutputStream stm3 = TestFileCreation.createFile(fs, file3, 1);
+ TestFileCreation.writeFile(stm3);
+ // rename file3 to some bad name
+ try {
+ fs.rename(file3, new Path(dir3, "$ "));
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
// restart cluster with the same namenode port as before.
// This ensures that leases are persisted in fsimage.
cluster.shutdown();