You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/08/23 14:50:47 UTC

[GitHub] [ratis] SzyWilliam commented on a diff in pull request #720: RATIS-1681. Use atomic_move to enhance robustness

SzyWilliam commented on code in PR #720:
URL: https://github.com/apache/ratis/pull/720#discussion_r952729705


##########
ratis-common/src/main/java/org/apache/ratis/util/FileUtils.java:
##########
@@ -77,7 +77,7 @@ static void move(File src, File dst) throws IOException {
 
   static void move(Path src, Path dst) throws IOException {
     LogUtils.runAndLog(LOG,
-        () -> Files.move(src, dst),
+        () -> Files.move(src, dst, StandardCopyOption.ATOMIC_MOVE),

Review Comment:
   Thanks for your review! Indeed we may encounter cross disk move, so I'll add the fallback retry logic.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org