Yield CPU for concurrent flush and concurrent mergeDelta#5410
Yield CPU for concurrent flush and concurrent mergeDelta#5410ti-chi-bot merged 6 commits intomasterfrom
Conversation
Signed-off-by: Wish <breezewish@outlook.com>
|
[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. DetailsReviewer can indicate their review by submitting an approval review. |
|
/run-all-tests |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
|
/run-all-tests |
Coverage for changed filesCoverage summaryfull 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. DetailsInstructions 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. DetailsCommit hash: 68ee85f |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created: #5423. |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
In response to a cherrypick label: new pull request created: #5424. |
|
In response to a cherrypick label: cannot checkout |
|
/run-cherry-picker |
Signed-off-by: Wish <breezewish@outlook.com>
Signed-off-by: Wish <breezewish@outlook.com>
What problem does this PR solve?
Issue Number: close #5409
What is changed and how it works?
Add sleep for
flushCacheandmergeDeltaBySegment:When
flushCacheis retrying, wait backoff will be 5ms ~ 100ms (considering that existing flushCache usually takes short time to finish).When
mergeDeltaBySegmentis retrying, wait backoff will be 50ms ~ 1s (considering that split-prepare could take several seconds to finish).Check List
Tests
To test with the fix, I introduced a
splitEachSegmentdebug function locally to manually trigger a split:The test case is to trigger the split for a 1GB segment, and then perform a mergeDelta at the same time.
Before the fix (using release v6.1):
when there are both split (takes 10s) and mergeDelta (takes 20s in total, blocked by split for 10s), there are 211K retries in 10s when the mergeDelta is blocked:
The CPU usage is around 200% during the split+mergeDelta:
After the fix:
there are only 14 retry attempts with exp backoff:
The CPU usage keeps around 100% (first 11s for split, next 10s for mergeDelta):
Note: As there is maximum 1s backoff, the CPU usage dropped for a short while when split was finished and the mergeDelta was not yet started.
Side effects
Documentation
Release note