Try to solve persistence issues #259
1 changed files with 5 additions and 0 deletions
|
@ -902,6 +902,11 @@ impl BlockManagerLocked {
|
|||
fs::remove_file(to_delete).await?;
|
||||
}
|
||||
|
||||
// We want to ensure that when this function returns, data is properly persisted
|
||||
lx marked this conversation as resolved
Outdated
|
||||
// to disk. The first step is the sync_all above that does an fsync on the data file.
|
||||
// Now, we do an fsync on the containing directory, to ensure that the rename
|
||||
// is persisted properly. See:
|
||||
// http://thedjbway.b0llix.net/qmail/syncdir.html
|
||||
let dir = fs::OpenOptions::new()
|
||||
.read(true)
|
||||
.mode(0)
|
||||
|
|
Loading…
Reference in a new issue
If I am correct, this code is used to fsync a move, as you mentionned on Matrix?
I suggest we add a comment to avoid removing it if someone else refactor this part of the code.