-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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 UT to test BG read qps behavior during upgrade for pr11406 #11522
Conversation
@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@hx235 has updated the pull request. You must reimport the pull request before landing. |
@hx235 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
||
#ifndef NDEBUG | ||
std::pair<size_t*, size_t*> prefetch_off_len_pair = {&prefetch_off, | ||
&prefetch_len}; | ||
TEST_SYNC_POINT_CALLBACK("BlockBasedTable::Open::TailPrefetchLen", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resurrect a sync point that no test used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test!
|
||
SyncPoint::GetInstance()->ClearAllCallBacks(); | ||
|
||
// To simulate a DB undergoing the upgrade where tail size to prefetch is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this would not be needed, as it overrides some of the logic, but I suppose it is OK. It's probably tricky to reliably force the heuristics to be wrong the way we want.
Context/Summary:
When db is upgrading to adopt pr11406, it's possible for RocksDB to infer a small tail size to prefetch for pre-upgrade files. Such small tail size would have caused 1 file read per index or filter partition if partitioned index or filer is used. This PR provides a UT to show this would not happen.
Misc: refactor the related UTs a bit to make this new UT more readable.
Test:
If logic of upgrade is wrong e.g,
, then the UT will fail like below