PageStorage: Fine grained lock on external callbacks (#5699) #5785
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automated cherry-pick of #5699
What problem does this PR solve?
Issue Number: close #5697
Problem Summary:
The GC total time in logging does not include the time costs in
clean_external_page
.In
PageStorageImpl::gcImpl
clean_external_page
, we hold thecallbacks_mutex
until all external page gc done.tiflash/dbms/src/Storages/Page/V3/PageStorageImpl.cpp
Lines 287 to 298 in 7acf7f5
while the time cost in
clean_external_page
is not ignorable and may block new StorageDeltaMerge from being createdtiflash/dbms/src/Storages/Page/V3/PageStorageImpl.cpp
Lines 400 to 408 in 7acf7f5
tiflash/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp
Lines 342 to 343 in 7acf7f5
What is changed and how it works?
cleanExternalPage
.Problem not yet resolve in this PR
Check List
Tests
Side effects
Documentation
Release note