Skip to content

Commit 267e143

Browse files
committed
data_sync added to journal flushing
1 parent 2450b25 commit 267e143

File tree

1 file changed

+5
-2
lines changed
  • crates/hyperqueue/src/server/event/journal

1 file changed

+5
-2
lines changed

crates/hyperqueue/src/server/event/journal/write.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,14 @@ impl JournalWriter {
6565

6666
pub fn flush(&mut self) -> anyhow::Result<()> {
6767
self.file.flush()?;
68+
/* Flush does not call file sync. We want to be sure that data
69+
is written, especially on NFS.
70+
*/
71+
self.file.get_ref().sync_data()?;
6872
Ok(())
6973
}
7074

7175
pub fn finish(mut self) -> anyhow::Result<()> {
72-
self.file.flush()?;
73-
Ok(())
76+
self.flush()
7477
}
7578
}

0 commit comments

Comments
 (0)