From 4842d1ea5f05b3739b69250688f67125bcedde7b Mon Sep 17 00:00:00 2001 From: Mikhail Antonov Date: Thu, 16 Aug 2018 16:39:24 -0700 Subject: [PATCH] VerifyChecksum() API should preserve options Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/4275 Reviewed By: yiwu-arbug Differential Revision: D9369766 Pulled By: mikhail-antonov fbshipit-source-id: d91b64c34cc1976b324a260767fce343fa32afde --- db/db_impl.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/db/db_impl.cc b/db/db_impl.cc index 0088ee56d..eb6421c29 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -3007,8 +3007,6 @@ Status DBImpl::IngestExternalFile( Status DBImpl::VerifyChecksum() { Status s; - Options options; - EnvOptions env_options; std::vector cfd_list; { InstrumentedMutexLock l(&mutex_); @@ -3026,13 +3024,19 @@ Status DBImpl::VerifyChecksum() { for (auto& sv : sv_list) { VersionStorageInfo* vstorage = sv->current->storage_info(); ColumnFamilyData* cfd = sv->current->cfd(); + Options opts; + { + InstrumentedMutexLock l(&mutex_); + opts = Options(BuildDBOptions(immutable_db_options_, + mutable_db_options_), cfd->GetLatestCFOptions()); + } for (int i = 0; i < vstorage->num_non_empty_levels() && s.ok(); i++) { for (size_t j = 0; j < vstorage->LevelFilesBrief(i).num_files && s.ok(); j++) { const auto& fd = vstorage->LevelFilesBrief(i).files[j].fd; std::string fname = TableFileName(cfd->ioptions()->cf_paths, fd.GetNumber(), fd.GetPathId()); - s = rocksdb::VerifySstFileChecksum(options, env_options, fname); + s = rocksdb::VerifySstFileChecksum(opts, env_options_, fname); } } if (!s.ok()) {