diff --git a/server/src/main/java/org/opensearch/common/blobstore/stream/read/listener/ReadContextListener.java b/server/src/main/java/org/opensearch/common/blobstore/stream/read/listener/ReadContextListener.java index b464675ba3193..6ab9cff3fa458 100644 --- a/server/src/main/java/org/opensearch/common/blobstore/stream/read/listener/ReadContextListener.java +++ b/server/src/main/java/org/opensearch/common/blobstore/stream/read/listener/ReadContextListener.java @@ -94,6 +94,8 @@ private ActionListener> 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);