diff --git a/db/db_impl/db_impl_secondary.cc b/db/db_impl/db_impl_secondary.cc index f0502fc0a20..7bb4e56b9fa 100644 --- a/db/db_impl/db_impl_secondary.cc +++ b/db/db_impl/db_impl_secondary.cc @@ -205,8 +205,6 @@ Status DBImplSecondary::RecoverLogFiles( auto it = log_readers_.find(log_number); assert(it != log_readers_.end()); log::FragmentBufferedReader* reader = it->second->reader_; - Status* wal_read_status = it->second->status_; - assert(wal_read_status); // Manually update the file number allocation counter in VersionSet. versions_->MarkFileNumberUsed(log_number); @@ -218,7 +216,7 @@ Status DBImplSecondary::RecoverLogFiles( while (reader->ReadRecord(&record, &scratch, immutable_db_options_.wal_recovery_mode) && - wal_read_status->ok() && status.ok()) { + status.ok()) { if (record.size() < WriteBatchInternal::kHeader) { reader->GetReporter()->Corruption( record.size(), Status::Corruption("log record too small")); @@ -323,9 +321,6 @@ Status DBImplSecondary::RecoverLogFiles( reader->GetReporter()->Corruption(record.size(), status); } } - if (status.ok() && !wal_read_status->ok()) { - status = *wal_read_status; - } if (!status.ok()) { return status; } diff --git a/db/db_impl/db_impl_secondary.h b/db/db_impl/db_impl_secondary.h index f1a40af3792..f8924beb5cc 100644 --- a/db/db_impl/db_impl_secondary.h +++ b/db/db_impl/db_impl_secondary.h @@ -17,18 +17,15 @@ namespace ROCKSDB_NAMESPACE { // A wrapper class to hold log reader, log reporter, log status. class LogReaderContainer { public: - LogReaderContainer() - : reader_(nullptr), reporter_(nullptr), status_(nullptr) {} + LogReaderContainer() : reader_(nullptr), reporter_(nullptr) {} LogReaderContainer(Env* env, std::shared_ptr info_log, std::string fname, std::unique_ptr&& file_reader, uint64_t log_number) { LogReporter* reporter = new LogReporter(); - status_ = new Status(); reporter->env = env; reporter->info_log = info_log.get(); reporter->fname = std::move(fname); - reporter->status = status_; reporter_ = reporter; // We intentially make log::Reader do checksumming even if // paranoid_checks==false so that corruptions cause entire commits @@ -40,11 +37,9 @@ class LogReaderContainer { } log::FragmentBufferedReader* reader_; log::Reader::Reporter* reporter_; - Status* status_; ~LogReaderContainer() { delete reader_; delete reporter_; - delete status_; } private: