-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Enhancement](lock) Optimize CatalogRecycleBin lock granularity to improve concurrency #48032
base: master
Are you sure you want to change the base?
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
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
|
@@ -559,20 +592,34 @@ private synchronized List<Long> getSameNamePartitionIdListToErase(long dbId, lon | |||
|
|||
private synchronized void erasePartitionWithSameName(long dbId, long tableId, String partitionName, |
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.
Can synchronized removed for this function?
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.
That’s fine. I still need to refactor. Thank you.
…prove concurrency
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
|
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
|
run p0 |
run feut |
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)