]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix bug that flush doesn't respond to fsync result
authorSiying Dong <siying.d@fb.com>
Mon, 26 Jun 2017 19:32:52 +0000 (12:32 -0700)
committersdong <siying.d@fb.com>
Mon, 26 Jun 2017 19:59:48 +0000 (12:59 -0700)
Summary:
With a regression bug was introduced two years ago, by https://github.com/facebook/rocksdb/commit/6e9fbeb27c38329f33ae541302c44c8db8374f8c , we fail to check return status of fsync call. This can cause we miss the information from the file system and can potentially cause corrupted data which we could have been detected.
Closes https://github.com/facebook/rocksdb/pull/2495

Reviewed By: ajkr

Differential Revision: D5321949

Pulled By: siying

fbshipit-source-id: c68117914bb40700198fc37d0e4c63163a8a1031

HISTORY.md
db/builder.cc

index 939f9e1e16696e64e6fc66225c42fe2acf20549c..f58b60dfc582c0edfc8f42d5bae1f3f0ea84bab2 100644 (file)
@@ -1,6 +1,9 @@
 # Rocksdb Change Log
 ## Unreleased
 
+### Bu Fixes
+* Shouldn't ignore return value of fsync() in flush.
+
 ## 5.5.0 (05/17/2017)
 ### New Features
 * FIFO compaction to support Intra L0 compaction too with CompactionOptionsFIFO.allow_compaction=true.
index 0c0bbb236b60dc9af629a49cd5e89e18d2b109c5..ec77036190e4f5c895be952bd16e17a861e615dd 100644 (file)
@@ -179,7 +179,7 @@ Status BuildTable(
     // Finish and check for file errors
     if (s.ok() && !empty) {
       StopWatch sw(env, ioptions.statistics, TABLE_SYNC_MICROS);
-      file_writer->Sync(ioptions.use_fsync);
+      s = file_writer->Sync(ioptions.use_fsync);
     }
     if (s.ok() && !empty) {
       s = file_writer->Close();