Add db_test2 to to ASSERT_STATUS_CHECKED (#8640)

Summary:
This is the `db_test2` parts of https://github.com/facebook/rocksdb/pull/7737 reworked on the latest HEAD.

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

Reviewed By: akankshamahajan15

Differential Revision: D30303684

Pulled By: mrambacher

fbshipit-source-id: 263e2f82d849bde4048b60aed8b31e7deed4706a
main
Adam Retter 3 years ago committed by Facebook GitHub Bot
parent 9b0a32f802
commit 5de333fd99
  1. 1
      Makefile
  2. 2
      db/db_impl/db_impl.cc
  3. 6
      db/db_impl/db_impl_open.cc
  4. 457
      db/db_test2.cc
  5. 2
      db/db_test_util.h
  6. 6
      file/filename.cc
  7. 4
      table/block_fetcher.h

@ -525,7 +525,6 @@ ifdef ASSERT_STATUS_CHECKED
TESTS_FAILING_ASC = \
c_test \
db_test \
db_test2 \
env_test \
range_locking_test \
testutil_test \

@ -5103,7 +5103,7 @@ Status DBImpl::EndTrace() {
s = tracer_->Close();
tracer_.reset();
} else {
return Status::IOError("No trace file to close");
s = Status::IOError("No trace file to close");
}
return s;
}

@ -1434,8 +1434,10 @@ Status DBImpl::WriteLevel0TableForRecovery(int job_id, ColumnFamilyData* cfd,
meta.fd.GetFileSize(), s.ToString().c_str());
mutex_.Lock();
io_s.PermitUncheckedError(); // TODO(AR) is this correct, or should we
// return io_s if not ok()?
// TODO(AR) is this ok?
if (!io_s.ok() && s.ok()) {
s = io_s;
}
}
}
ReleaseFileNumberFromPendingOutputs(pending_outputs_inserted_elem);

File diff suppressed because it is too large Load Diff

@ -403,7 +403,7 @@ class SpecialEnv : public EnvWrapper {
Status Sync() override {
++env_->sync_counter_;
if (env_->corrupt_in_sync_) {
Append(std::string(33000, ' '));
EXPECT_OK(Append(std::string(33000, ' ')));
return Status::IOError("Ingested Sync Failure");
}
if (env_->skip_fsync_) {

@ -395,7 +395,11 @@ IOStatus SetCurrentFile(FileSystem* fs, const std::string& dbname,
s = directory_to_fsync->Fsync(IOOptions(), nullptr);
}
} else {
fs->DeleteFile(tmp, IOOptions(), nullptr);
fs->DeleteFile(tmp, IOOptions(), nullptr)
.PermitUncheckedError(); // NOTE: PermitUncheckedError is acceptable
// here as we are already handling an error
// case, and this is just a best-attempt
// effort at some cleanup
}
return s;
}

@ -62,7 +62,9 @@ class BlockFetcher {
cache_options_(cache_options),
memory_allocator_(memory_allocator),
memory_allocator_compressed_(memory_allocator_compressed),
for_compaction_(for_compaction) {}
for_compaction_(for_compaction) {
io_status_.PermitUncheckedError(); // TODO(AR) can we improve on this?
}
IOStatus ReadBlockContents();
CompressionType get_compression_type() const { return compression_type_; }

Loading…
Cancel
Save