[Enhancement](lock) Optimize CatalogRecycleBin lock granularity to improve concurrency#48032
Closed
felixwluo wants to merge 3 commits intoapache:masterfrom
Closed
[Enhancement](lock) Optimize CatalogRecycleBin lock granularity to improve concurrency#48032felixwluo wants to merge 3 commits intoapache:masterfrom
felixwluo wants to merge 3 commits intoapache:masterfrom
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
TPC-H: Total hot run time: 31505 ms |
TPC-DS: Total hot run time: 189844 ms |
ClickBench: Total hot run time: 30.09 s |
Vallishp
reviewed
Feb 18, 2025
| @@ -559,20 +592,34 @@ private synchronized List<Long> getSameNamePartitionIdListToErase(long dbId, lon | |||
|
|
|||
| private synchronized void erasePartitionWithSameName(long dbId, long tableId, String partitionName, | |||
Contributor
There was a problem hiding this comment.
Can synchronized removed for this function?
Member
Author
There was a problem hiding this comment.
That’s fine. I still need to refactor. Thank you.
Member
Author
|
run buildall |
TPC-H: Total hot run time: 31630 ms |
TPC-DS: Total hot run time: 190797 ms |
ClickBench: Total hot run time: 30.62 s |
Member
Author
|
run buildall |
TPC-H: Total hot run time: 31193 ms |
TPC-DS: Total hot run time: 190172 ms |
ClickBench: Total hot run time: 30.56 s |
Member
Author
|
run p0 |
Member
Author
|
run feut |
…prove concurrency
Member
Author
|
run buildall |
TPC-H: Total hot run time: 31688 ms |
TPC-DS: Total hot run time: 184046 ms |
ClickBench: Total hot run time: 30.56 s |
Contributor
|
We're closing this PR because it hasn't been updated in a while. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What problem does this PR solve?
Issue Number: close #47997
Ideas
Use read and write lock to separate read and write operations:
1-1. Read operations (query, check status, etc.) use read locks.
1-2. Write operations (add, delete, etc.) use write locks.
1-3. Multiple read operations can be executed concurrently.
Divide the operation into three stages
2-1. Before acquiring the lock: Preparation work.
2-2. While holding the lock: Perform only necessary data structure modifications.
2-3. After releasing the lock: Execute time-consuming operations.
Implementation strategy
3-1. Data preparation stage:
- Collect the data to be processed before acquiring the lock
- Pre-allocate necessary data structures
3-2. Critical section operations:
- Modify only shared data structures
- Keep the lock hold time as short as possible
3-3. Subsequent processing:
- Move I/O operations outside the lock
- Log-related operations should also be outside the lock
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)