Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clang13 build error (facebook#9374) #271

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions db/compaction/compaction_picker_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions db/db_test2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2199,7 +2199,6 @@ TEST_F(DBTest2, ReadAmpBitmapLiveInCacheAfterDBClose) {
Close();
Reopen(options);

uint64_t total_useful_bytes = 0;
std::set<int> read_keys;
std::string value;
// Iter1: Read half the DB, Read even keys
Expand All @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down
1 change: 0 additions & 1 deletion options/db_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions utilities/env_mirror.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down