Remove check for status returned by `InvalidatePageCache` (#8156)

Summary:
Failures in `InvalidatePageCache` will change the API contract. So we remove the status check for `InvalidatePageCache` in `SstFileWriter::Add()`, `SstFileWriter::Finish` and `Rep::DeleteRange`

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

Reviewed By: riversand963

Differential Revision: D27597012

Pulled By: ajkr

fbshipit-source-id: 2872051695d50cc47ed0f2848dc582464c00076f
main
sunby 4 years ago committed by Facebook GitHub Bot
parent 2d8518f5ea
commit c4d0e66d65
  1. 10
      table/sst_file_writer.cc

@ -99,7 +99,8 @@ struct SstFileWriter::Rep {
file_info.largest_key.assign(user_key.data(), user_key.size());
file_info.file_size = builder->FileSize();
return InvalidatePageCache(false /* closing */);
InvalidatePageCache(false /* closing */).PermitUncheckedError();
return Status::OK();
}
Status DeleteRange(const Slice& begin_key, const Slice& end_key) {
@ -133,7 +134,8 @@ struct SstFileWriter::Rep {
file_info.num_range_del_entries++;
file_info.file_size = builder->FileSize();
return InvalidatePageCache(false /* closing */);
InvalidatePageCache(false /* closing */).PermitUncheckedError();
return Status::OK();
}
Status InvalidatePageCache(bool closing) {
@ -308,9 +310,7 @@ Status SstFileWriter::Finish(ExternalSstFileInfo* file_info) {
if (s.ok()) {
s = r->file_writer->Sync(r->ioptions.use_fsync);
if (s.ok()) {
s = r->InvalidatePageCache(true /* closing */);
}
r->InvalidatePageCache(true /* closing */).PermitUncheckedError();
if (s.ok()) {
s = r->file_writer->Close();
}

Loading…
Cancel
Save