hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mberto...@apache.org
Subject svn commit: r1493671 - /hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
Date Mon, 17 Jun 2013 07:58:22 GMT
Author: mbertozzi
Date: Mon Jun 17 07:58:21 2013
New Revision: 1493671

URL: http://svn.apache.org/r1493671
Log:
HBASE-8749 Potential race condition between FSUtils.renameAndSetModifyTime() and HFile/LogCleaner

Modified:
    hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java

Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java?rev=1493671&r1=1493670&r2=1493671&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
(original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
Mon Jun 17 07:58:21 2013
@@ -1589,11 +1589,10 @@ public abstract class FSUtils {
     }
   }
 
-  public static boolean renameAndSetModifyTime(final FileSystem fs, Path src, Path dest)
+  public static boolean renameAndSetModifyTime(final FileSystem fs, final Path src, final
Path dest)
       throws IOException {
-    if (!fs.rename(src, dest)) return false;
     // set the modify time for TimeToLive Cleaner
-    fs.setTimes(dest, EnvironmentEdgeManager.currentTimeMillis(), -1);
-    return true;
+    fs.setTimes(src, EnvironmentEdgeManager.currentTimeMillis(), -1);
+    return fs.rename(src, dest);
   }
 }



Mime
View raw message