]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fsync after writing global seq number in ExternalSstFileIngestionJob
authorSagar Vemuri <svemuri@fb.com>
Fri, 23 Mar 2018 00:34:52 +0000 (17:34 -0700)
committerSagar Vemuri <svemuri@fb.com>
Fri, 23 Mar 2018 18:15:55 +0000 (11:15 -0700)
Summary:
Fsync after writing global sequence number to the ingestion file in ExternalSstFileIngestionJob. Otherwise the file metadata could be incorrect.
Closes https://github.com/facebook/rocksdb/pull/3644

Differential Revision: D7373813

Pulled By: sagar0

fbshipit-source-id: 4da2c9e71a8beb5c08b4ac955f288ee1576358b8

HISTORY.md
db/external_sst_file_ingestion_job.cc

index fec7c4ea0219139c294fdda657ff692cba429747..9fb7ce9eb672438e29786df5d91c3d928e9714c5 100644 (file)
@@ -1,4 +1,8 @@
 # Rocksdb Change Log
+## 5.12.2 (3/23/2018)
+### Bug Fixes
+* Fsync after writing global seq number to the ingestion file in ExternalSstFileIngestionJob.
+
 ## 5.12.1 (3/16/2018)
 ### Public API Change
 * RocksDBOptionsParser::Parse()'s `ignore_unknown_options` argument will only be effective if the option file shows it is generated using a higher version of RocksDB than the current version.
index 2b91e0051bcab23a1182303e5a4c1ca44d00cfc9..1a6f238866a318eea9f8aaf60329779b5775b3a2 100644 (file)
@@ -509,6 +509,9 @@ Status ExternalSstFileIngestionJob::AssignGlobalSeqnoForIngestedFile(
   std::string seqno_val;
   PutFixed64(&seqno_val, seqno);
   status = rwfile->Write(file_to_ingest->global_seqno_offset, seqno_val);
+  if (status.ok()) {
+    status = rwfile->Fsync();
+  }
   if (status.ok()) {
     file_to_ingest->assigned_seqno = seqno;
   }