Avoid to suppress status code in ~BlockBasedTableBuilder (#7507)

Summary:
We just used a hacky way to fix db_basic_test: suppress status code in ~BlockBasedTableBuilder. Rather, we should pass them back in Finish() and suppress them in Abandon().

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7507

Test Plan: Watch existing tests to succeed.

Reviewed By: riversand963

Differential Revision: D24119527

fbshipit-source-id: 71c4d4a81c0fd1c5595224692275f20f7759973a
main
sdong 4 years ago committed by Facebook GitHub Bot
parent 5d16325ce3
commit 2496d3d4b8
  1. 2
      file/filename.cc
  2. 9
      table/block_based/block_based_table_builder.cc

@ -414,7 +414,7 @@ Status SetIdentityFile(Env* env, const std::string& dbname,
s = env->RenameFile(tmp, IdentityFileName(dbname));
}
if (!s.ok()) {
env->DeleteFile(tmp);
env->DeleteFile(tmp).PermitUncheckedError();
}
return s;
}

@ -496,13 +496,6 @@ struct BlockBasedTableBuilder::Rep {
Rep(const Rep&) = delete;
Rep& operator=(const Rep&) = delete;
~Rep() {
// They are supposed to be passed back to users through Finish()
// if the file finishes.
status.PermitUncheckedError();
io_status.PermitUncheckedError();
}
private:
Status status;
IOStatus io_status;
@ -1708,6 +1701,8 @@ void BlockBasedTableBuilder::Abandon() {
rep_->pc_rep->finished = true;
}
rep_->state = Rep::State::kClosed;
rep_->GetStatus().PermitUncheckedError();
rep_->GetIOStatus().PermitUncheckedError();
}
uint64_t BlockBasedTableBuilder::NumEntries() const {

Loading…
Cancel
Save