HBASE-8749 Potential race condition between FSUtils.renameAndSetModifyTime() and HFile/LogCleaner
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1493670 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f38b70170e
commit
62f513257e
|
@ -1645,11 +1645,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue