Browse Source

HADOOP-745. Fix a synchronization bug in the HDFS namenode. Contributed by Dhruba.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@492248 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 years ago
parent
commit
2c1fda8a61
2 changed files with 5 additions and 2 deletions
  1. 3 0
      CHANGES.txt
  2. 2 2
      src/java/org/apache/hadoop/dfs/FSNamesystem.java

+ 3 - 0
CHANGES.txt

@@ -159,6 +159,9 @@ Trunk (unreleased changes)
 44. HADOOP-849.  Fix OutOfMemory exceptions in TaskTracker due to a
     file handle leak in SequenceFile.  (Devaraj Das via cutting)
 
+45. HADOOP-745.  Fix a synchronization bug in the HDFS namenode.
+    (Dhruba Borthakur via cutting)
+
 
 Release 0.9.2 - 2006-12-15
 

+ 2 - 2
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -780,7 +780,7 @@ class FSNamesystem implements FSConstants {
     /**
      * Change the indicated filename.
      */
-    public boolean renameTo(UTF8 src, UTF8 dst) throws IOException {
+    public synchronized boolean renameTo(UTF8 src, UTF8 dst) throws IOException {
         NameNode.stateChangeLog.debug("DIR* NameSystem.renameTo: " + src + " to " + dst );
         if( isInSafeMode() )
           throw new SafeModeException( "Cannot rename " + src, safeMode );
@@ -869,7 +869,7 @@ class FSNamesystem implements FSConstants {
     /**
      * Create all the necessary directories
      */
-    public boolean mkdirs( String src ) throws IOException {
+    public synchronized boolean mkdirs( String src ) throws IOException {
         boolean    success;
         NameNode.stateChangeLog.debug("DIR* NameSystem.mkdirs: " + src );
         if( isInSafeMode() )