Skip to content

Commit

Permalink
sync directory after file rename
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 committed Oct 4, 2023
1 parent e240cef commit e22e6ed
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ private ActionListener<Collection<String>> getFileCompletionListener() {
try {
IOUtils.fsync(tmpFileLocation, false);
Files.move(tmpFileLocation, fileLocation, StandardCopyOption.ATOMIC_MOVE);
// sync parent dir metadata
IOUtils.fsync(fileLocation.getParent(), true);
completionListener.onResponse(blobName);
} catch (IOException e) {
logger.error("Unable to rename temp file + " + tmpFileLocation, e);
Expand Down

0 comments on commit e22e6ed

Please sign in to comment.