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

Add test for memtable bloom filter with WriteBufferManager #13398

Closed

Conversation

pdillinger
Copy link
Contributor

Summary: ... to ensure proper cache charging. However, this is a somewhat hazardous combination if there are many CFs and could be the target of future work.

Test Plan: this is the test

Summary: ... to ensure proper cache charging. However, this is a
somewhat hazardous combination if there are many CFs and could be the
target of future work.

Test Plan: this is the test
@facebook-github-bot
Copy link
Contributor

@pdillinger has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@pdillinger pdillinger requested a review from hx235 February 19, 2025 17:11

// Just the start of a memtable, no Bloom, rounded up to kSizeDummyEntry
ASSERT_GE(cache->GetUsage(), 1024U);
ASSERT_LE(cache->GetUsage(), 256U * 1024U);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use static constexpr std::size_t kSizeDummyEntry = CacheReservationManagerImplCacheEntryRole::kMisc::GetDummyEntrySize(); ? Same for upper bound below just so it's easier to sea how many kSizeDummyEntry in the upper bound

ASSERT_OK(Put("foo2", "bar2"));

// Expecting a memtable Bloom of ratio times write_buffer_size, memory tracked
ASSERT_GE(cache->GetUsage(), 1000000U);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: options.write_buffer_size * options.memtable_prefix_bloom_size_ratio instead of hard-coded 1000000U ? Same for 2000000U below

Copy link
Contributor

@hx235 hx235 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some details on making the hard-coded number more readable. Others LGTM

@facebook-github-bot
Copy link
Contributor

@pdillinger has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@pdillinger has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@pdillinger merged this pull request in 836e88a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants