Direct I/O writable file should do fsync in Close()
Summary: We don't do fsync() after truncate in direct I/O writeable file (in fact we don't do any fsync ever). This can cause metadata not persistent to disk after the file is generated. We call it instead. Closes https://github.com/facebook/rocksdb/pull/3500 Differential Revision: D6981482 Pulled By: siying fbshipit-source-id: 7e2b591b7e5dd1b96fc0775515b8b9e6092980ef
This commit is contained in:
parent
d08d05cb62
commit
b3c5351335
@ -239,6 +239,9 @@ Status WritableFileWriter::Close() {
|
||||
// we need to let the file know where data ends.
|
||||
if (use_direct_io()) {
|
||||
interim = writable_file_->Truncate(filesize_);
|
||||
if (interim.ok()) {
|
||||
interim = writable_file_->Fsync();
|
||||
}
|
||||
if (!interim.ok() && s.ok()) {
|
||||
s = interim;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user