Handle failed Finish() in SST file writer

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 https://github.com/facebook/rocksdb/pull/1901

Differential Revision: D4601373

Pulled By: ajkr

fbshipit-source-id: e5678be
main
Andrew Kryczka 8 years ago committed by Facebook Github Bot
parent 8efb5ffa2a
commit e67232cff5
  1. 3
      table/sst_file_writer.cc

@ -189,10 +189,7 @@ Status SstFileWriter::Finish(ExternalSstFileInfo* file_info) {
if (s.ok()) { if (s.ok()) {
s = r->file_writer->Close(); s = r->file_writer->Close();
} }
} else {
r->builder->Abandon();
} }
if (!s.ok()) { if (!s.ok()) {
r->ioptions.env->DeleteFile(r->file_info.file_path); r->ioptions.env->DeleteFile(r->file_info.file_path);
} }

Loading…
Cancel
Save