diff --git a/HISTORY.md b/HISTORY.md index 4e9e4ca6e76d151ad24be1991107d5668c87f6fe..824582713f9e65ebddd9c1391295d44f1718f804 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -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 diff --git a/db/external_sst_file_ingestion_job.cc b/db/external_sst_file_ingestion_job.cc index 89b977ce0ea3f5532805e57c7b5cb03cb5e25be0..b37440e47c747fb406ff8f2ee75344d3b71b8e53 100644 --- a/db/external_sst_file_ingestion_job.cc +++ b/db/external_sst_file_ingestion_job.cc @@ -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; }