diff --git a/db/compaction/compaction_picker_test.cc b/db/compaction/compaction_picker_test.cc index c75b14a7946..a44b35b096f 100644 --- a/db/compaction/compaction_picker_test.cc +++ b/db/compaction/compaction_picker_test.cc @@ -516,13 +516,11 @@ TEST_F(CompactionPickerTest, NeedsCompactionFIFO) { // verify whether compaction is needed based on the current // size of L0 files. - uint64_t current_size = 0; for (int i = 1; i <= kFileCount; ++i) { NewVersionStorage(1, kCompactionStyleFIFO); Add(0, i, ToString((i + 100) * 1000).c_str(), - ToString((i + 100) * 1000 + 999).c_str(), - kFileSize, 0, i * 100, i * 100 + 99); - current_size += kFileSize; + ToString((i + 100) * 1000 + 999).c_str(), kFileSize, 0, i * 100, + i * 100 + 99); UpdateVersionStorageInfo(); ASSERT_EQ(fifo_compaction_picker.NeedsCompaction(vstorage_.get()), vstorage_->CompactionScore(0) >= 1); diff --git a/db/db_test2.cc b/db/db_test2.cc index a7b3d2b4aba..33e7cc20eb5 100644 --- a/db/db_test2.cc +++ b/db/db_test2.cc @@ -2199,7 +2199,6 @@ TEST_F(DBTest2, ReadAmpBitmapLiveInCacheAfterDBClose) { Close(); Reopen(options); - uint64_t total_useful_bytes = 0; std::set read_keys; std::string value; // Iter1: Read half the DB, Read even keys @@ -2210,8 +2209,6 @@ TEST_F(DBTest2, ReadAmpBitmapLiveInCacheAfterDBClose) { if (read_keys.find(i) == read_keys.end()) { auto internal_key = InternalKey(key, 0, ValueType::kTypeValue); - total_useful_bytes += - GetEncodedEntrySize(internal_key.size(), value.size()); read_keys.insert(i); } } @@ -2237,8 +2234,6 @@ TEST_F(DBTest2, ReadAmpBitmapLiveInCacheAfterDBClose) { if (read_keys.find(i) == read_keys.end()) { auto internal_key = InternalKey(key, 0, ValueType::kTypeValue); - total_useful_bytes += - GetEncodedEntrySize(internal_key.size(), value.size()); read_keys.insert(i); } } diff --git a/options/db_options.h b/options/db_options.h index 01c737bc4c3..39ebf680db6 100644 --- a/options/db_options.h +++ b/options/db_options.h @@ -87,7 +87,6 @@ struct ImmutableDBOptions { struct MutableDBOptions { MutableDBOptions(); - explicit MutableDBOptions(const MutableDBOptions& options) = default; explicit MutableDBOptions(const DBOptions& options); void Dump(Logger* log) const; diff --git a/utilities/env_mirror.cc b/utilities/env_mirror.cc index b6cbd69ecce..76a8d14d8b8 100644 --- a/utilities/env_mirror.cc +++ b/utilities/env_mirror.cc @@ -27,13 +27,17 @@ class SequentialFileMirror : public SequentialFile { if (as == Status::OK()) { char* bscratch = new char[n]; Slice bslice; +#ifndef NDEBUG size_t off = 0; +#endif size_t left = aslice.size(); while (left) { Status bs = b_->Read(left, &bslice, bscratch); +#ifndef NDEBUG assert(as == bs); assert(memcmp(bscratch, scratch + off, bslice.size()) == 0); off += bslice.size(); +#endif left -= bslice.size(); } delete[] bscratch;