diff --git a/util/file_reader_writer.cc b/util/file_reader_writer.cc index 448efa7e3..677cf2076 100644 --- a/util/file_reader_writer.cc +++ b/util/file_reader_writer.cc @@ -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; }