From c4d0e66d65209e6eb1b6cf3e99bd963c5195e9ac Mon Sep 17 00:00:00 2001 From: sunby Date: Tue, 6 Apr 2021 11:53:54 -0700 Subject: [PATCH] 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 --- table/sst_file_writer.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/table/sst_file_writer.cc b/table/sst_file_writer.cc index 301a254d1..47cdbb69e 100644 --- a/table/sst_file_writer.cc +++ b/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(); } -- GitLab