-
Notifications
You must be signed in to change notification settings - Fork 412
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: Merge multiple segments in gc thread #5863
Conversation
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
Signed-off-by: Wish <[email protected]>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: Wish <[email protected]>
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
Signed-off-by: Wish <[email protected]>
/merge |
@breezewish: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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. |
This pull request has been accepted and is ready to merge. Commit hash: e37ff2d
|
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/merge |
@breezewish: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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. |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/merge |
@breezewish: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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. |
This pull request has been accepted and is ready to merge. Commit hash: df80965
|
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
@breezewish: 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. |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
What problem does this PR solve?
Issue Number: ref #5237
Problem Summary:
What is changed and how it works?
In this PR, segment merge will be only running in the GC thread, instead of in other background threads. This means segment merge will have much lower priority than other segment operations now.
This PR also try to merge multiple segments all at once. This reduces write amplification when there are a lot of small segments.
The merge strategy: Pick segments until reaching (segment_limit_rows|size)/3.
Note: In the current strategy, the following segment sequence will not get merged, thus leaving a small segment in the wild:
[size=0, size=1GB]
as0+1GB > 512MB/3
.Check List
Tests
Workload: Full-speed Ingest using IngestBySplit
The workload is to first ingest replicas in full-speed, then perform full table scan for multiple times.
(Note: we added a sleep to flush retry in the previous PR. It also contributes to the decrease of flush.)
Query performance (30 sec interval) right after replica sync is finished:
We can see that query is less likely to be affected due to small number of background tasks.
However, notice that at the time when these query finished, there are still more merge tasks to do. There was still 35% remaining merge tasks (according to the
TIFLASH_SEGMENTS
table):Workload: Normal-speed Ingest using IngestBySplit
Side effects
Documentation
Release note