Skip to content

Commit

Permalink
Fsync after writing global seq number in ExternalSstFileIngestionJob
Browse files Browse the repository at this point in the history
Summary:
Fsync after writing global sequence number to the ingestion file in ExternalSstFileIngestionJob. Otherwise the file metadata could be incorrect.
Closes facebook#3644

Differential Revision: D7373813

Pulled By: sagar0

fbshipit-source-id: 4da2c9e71a8beb5c08b4ac955f288ee1576358b8
  • Loading branch information
sagar0 authored and facebook-github-bot committed Mar 23, 2018
1 parent 4d51fea commit 2e3d407
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions db/external_sst_file_ingestion_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2e3d407

Please sign in to comment.