Skip to content

Commit

Permalink
Remove check for status returned by InvalidatePageCache (facebook#8156
Browse files Browse the repository at this point in the history
)

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: facebook#8156

Reviewed By: riversand963

Differential Revision: D27597012

Pulled By: ajkr

fbshipit-source-id: 2872051695d50cc47ed0f2848dc582464c00076f
  • Loading branch information
sunby authored and facebook-github-bot committed Apr 6, 2021
1 parent 2d8518f commit c4d0e66
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions table/sst_file_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit c4d0e66

Please sign in to comment.