Skip to content

Commit

Permalink
Handle failed Finish() in SST file writer
Browse files Browse the repository at this point in the history
Summary:
The assertion in Abandon() fails when called after Finish() fails. Finish() already closes the builder so there's no need to call Abandon().
Closes #1901

Differential Revision: D4601373

Pulled By: ajkr

fbshipit-source-id: e5678be
  • Loading branch information
ajkr authored and facebook-github-bot committed Feb 23, 2017
1 parent 8efb5ff commit e67232c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions table/sst_file_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,7 @@ Status SstFileWriter::Finish(ExternalSstFileInfo* file_info) {
if (s.ok()) {
s = r->file_writer->Close();
}
} else {
r->builder->Abandon();
}

if (!s.ok()) {
r->ioptions.env->DeleteFile(r->file_info.file_path);
}
Expand Down

0 comments on commit e67232c

Please sign in to comment.