]> 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 21:52:21 +0000 (14:52 -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 e9688249dba6f5424c7c26f41c6e90d6d1b31f79..56e6dd9055cfa25bf716840e5a67d38719c2313c 100644 (file)
@@ -5,7 +5,7 @@
 ### New Features
 
 ### Bug Fixes
-
+* Fsync after writing global seq number to the ingestion file in ExternalSstFileIngestionJob.
 
 ## 5.13.0 (3/20/2018)
 ### Public API Change
index 89b977ce0ea3f5532805e57c7b5cb03cb5e25be0..b37440e47c747fb406ff8f2ee75344d3b71b8e53 100644 (file)
@@ -510,6 +510,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;
   }