-
Notifications
You must be signed in to change notification settings - Fork 409
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
Storages: refine SegmentReadTaskScheduler
#8557
Conversation
Skipping CI for Draft Pull Request. |
/run-all-tests |
1 similar comment
/run-all-tests |
/run-unit-tests |
f12267e
to
fe654df
Compare
SegmentReadTaskScheduler
SegmentReadTaskScheduler
/run-all-tests |
/run-integration-test |
1 similar comment
/run-integration-test |
b965301
to
c275ba1
Compare
dbms/src/Storages/DeltaMerge/ReadThread/SegmentReadTaskScheduler.h
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/ReadThread/SegmentReadTaskScheduler.h
Outdated
Show resolved
Hide resolved
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.
LGTM
@@ -127,7 +127,11 @@ class MergedTask | |||
} | |||
} | |||
|
|||
#ifndef DBMS_PUBLIC_GTEST |
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? I found these 3 methods not accessed in gtest_segment_read_tasks
.
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.
Use the member variables in gtest_segment_read_tasks
. For example,
ASSERT_EQ(merged_task->units.size(), 1);
Stopwatch sw_do_add; | ||
read_pools.add(pool); | ||
read_pools.emplace(pool->pool_id, pool); |
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.
The SegmentReadTaskScheduler::add
is public, it could be called by someone else. Wo we should assert pool
to be not nullptr
.
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.
Added.
8949a86
to
0b717e8
Compare
0b717e8
to
2586b05
Compare
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, Lloyd-Pottiger 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 |
[LGTM Timeline notifier]Timeline:
|
/hold |
/run-all-tests |
/unhold |
/cherry-pick to release-7.5 |
@JinheLin: cannot checkout In response to this:
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. |
What problem does this PR solve?
Issue Number: ref #6834
Problem Summary:
What is changed and how it works?
The main updates of this PR is removing the code of
CircularScanList
and refiningSegmentReadTaskScheduler
. RemovingCircularScanList
is because it's not very necessary.The design of
CircularScanList
is to make each iteration ofread_pools
start from the previous end position. Meanwhile, for the convenience of accessing bypool_id
, also added anunordered_map
to index all pools.CircularScanList
also will release pools that are never used, causing inconvenience in some monitoring statistics.This PR deletes the code of
CircularScanList
, and just uses anunordered_map
to storeread_pools
.When scheduling, try scheduling each pool in the
read_pools
before releasing lock.The biggest difference is that the new code will try to schedule all pools in
read_pools
before the scheduler releasing its lock.Also add some unit-tests of
SegmentReadTaskScheduler
.Add CPU usage of threads:
Check List
Tests
Side effects
Documentation
Release note