From: Siying Dong Date: Mon, 26 Jun 2017 19:32:52 +0000 (-0700) Subject: Fix bug that flush doesn't respond to fsync result X-Git-Tag: v5.4.7~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2955407c3ab7e42ff71aa5fb7b5adf3d77ff53ab;p=rocksdb.git Fix bug that flush doesn't respond to fsync result 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 --- diff --git a/HISTORY.md b/HISTORY.md index 8e8c0eec..f6fa9a00 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,8 @@ # Rocksdb Change Log +## 5.4.7 (06/28/2017) +### Bug Fixes +* Shouldn't ignore return value of fsync() in flush. + ## 5.4.6 (05/30/2017) ### Bug Fixes * Fix db_bench with lite build. diff --git a/db/builder.cc b/db/builder.cc index 65ffd449..83d788cf 100644 --- a/db/builder.cc +++ b/db/builder.cc @@ -177,7 +177,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();