-
Notifications
You must be signed in to change notification settings - Fork 411
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
Storage: Refactor DMFileReader #8854
Conversation
1d1e04f
to
fe76785
Compare
b3a0211
to
04e780c
Compare
/run-all-tests |
/run-integration-test |
{ | ||
PackRange target_range{start_pack_id, start_pack_id + pack_count}; | ||
|
||
RangeWithStrategys range_and_strategys; |
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.
Strategies
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.
keep this, it means multiple RangeWithStrategy
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.
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
1f1c8e8
to
1c3dbf6
Compare
Signed-off-by: Lloyd-Pottiger <[email protected]>
@@ -142,7 +154,7 @@ class DMFileReader | |||
/// Filters | |||
DMFilePackFilter pack_filter; | |||
|
|||
std::vector<size_t> skip_packs_by_column{}; | |||
std::vector<bool> must_seek; |
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.
avoid using std::vector<bool>
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.
DMFileReader
will be created for each segment in a query. If multiple queries are running at the same time, a lot of DMFileReader
will be created. And if there are cop tasks, it is even worse. So reducing memory is important for DMFileReader
.
And since must_seek
is a private member, which means it only can be accessed inside, so no outer reference refers to it, meanwhile, the life cycle of the inside reference will always shorter than must_seek
itself. So it is safe.
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.
Why not use bitset?
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.
std::bitset
can not decide size in run time. std::vecotr<bool>
is safe in this case.
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.
How about boost::dynamic_bitset
? It is dynamic. Moreover, it supports efficient batch set bits (while std::fill(std::vector<bool>)
does not stipulate its complexity and may have poor performance in some stds)
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.
boost::dynamic_bitset::operator[]
also return a reference.
Anyway, must_seek
is removed.
/run-build-release |
download tiflash binary(linux amd64) at http://fileserver.pingcap.net/download/builds/pingcap/test/tiflash/38e747a896302ec18787acfb713375a1d9532453/centos7/tiflash-linux-amd64.tar.gz |
Signed-off-by: Lloyd-Pottiger <[email protected]>
Remove unused header
Totally agree, I will remove it. |
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CalvinNeo, JinheLin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Lloyd-Pottiger: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/hold |
Signed-off-by: Lloyd-Pottiger <[email protected]>
134c463
to
1fe9d18
Compare
/run-all-tests |
/run-unit-test |
/unhold |
/run-all-tests |
/run-unit-test |
This reverts commit 238e43c.
What problem does this PR solve?
Issue Number: ref #6233
Problem Summary:
What is changed and how it works?
Refactor DMFileReader to make life easier~
Separate the packs can do clean read.
Check List
Tests
Side effects
Documentation
Release note