[fix](cooldown)No need to rdlock inside get_cooldown_tablets, there's enough rdlock inside tablet internal function calls.#39211
Merged
gavinchou merged 1 commit intoapache:masterfrom Aug 30, 2024
Conversation
…rdlock inside tablet internal function calls.
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 39925 ms |
TPC-DS: Total hot run time: 201114 ms |
ClickBench: Total hot run time: 30.84 s |
Contributor
Author
|
run beut |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 39706 ms |
TPC-DS: Total hot run time: 201213 ms |
ClickBench: Total hot run time: 31.34 s |
Contributor
Author
|
run cloud_p1 |
Contributor
Author
|
run external |
gavinchou
approved these changes
Aug 30, 2024
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
dataroaring
pushed a commit
that referenced
this pull request
Oct 9, 2024
… enough rdlock inside tablet internal function calls. (#39211) ## Proposed changes There's a recurse rdlock inside get_cooldown;when using libcxx,libcxx‘s shared_mutex dosen't support recursive lock, so causes hangs below: #0 0x00007f788b101a35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00005636b8ff996f in std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) () #2 0x00005636b8ffad8b in std::__1::__shared_mutex_base::lock_shared() () #3 0x00005636addc524c in doris::Tablet::_has_data_to_cooldown() () #4 0x00005636addc353b in doris::Tablet::pick_cooldown_rowset() () #5 0x00005636addc56b9 in doris::Tablet::need_cooldown(long*, unsigned long*) () #6 0x00005636adde52f7 in doris::TabletManager::get_cooldown_tablets(std::__1::vector<std::__1::shared_ptr<doris::Tablet>, std::__1::allocator<std::__1::shared_ptr<doris::Tablet> > >*, std::__1::vector<std::__1::shared_ptr<doris::Rowset>, std::__1::allocator<std::__1::shared_ptr<doris::Rowset> > >*, std::__1::function<bool (std::__1::shared_ptr<doris::Tablet> const&)>) () #7 0x00005636adb0ed81 in doris::StorageEngine::_cooldown_tasks_producer_callback() () #8 0x00005636ae17a253 in doris::Thread::supervise_thread(void*) () #9 0x00007f788b0fdea5 in start_thread () from /lib64/libpthread.so.0 #10 0x00007f788b916b0d in clone () from /lib64/libc.so.6 review the code, there's no need a rdlock inside TabletManager::get_cooldown_tablets
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.
Proposed changes
There's a recurse rdlock inside get_cooldown;when using libcxx,libcxx‘s shared_mutex dosen't support recursive lock, so causes hangs below:
#0 0x00007f788b101a35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00005636b8ff996f in std::__1::condition_variable::wait(std::__1::unique_lockstd::__1::mutex&) ()
#2 0x00005636b8ffad8b in std::__1::__shared_mutex_base::lock_shared() ()
#3 0x00005636addc524c in doris::Tablet::_has_data_to_cooldown() ()
#4 0x00005636addc353b in doris::Tablet::pick_cooldown_rowset() ()
#5 0x00005636addc56b9 in doris::Tablet::need_cooldown(long*, unsigned long*) ()
#6 0x00005636adde52f7 in doris::TabletManager::get_cooldown_tablets(std::__1::vector<std::__1::shared_ptrdoris::Tablet, std::__1::allocator<std::__1::shared_ptrdoris::Tablet > >, std::__1::vector<std::__1::shared_ptrdoris::Rowset, std::__1::allocator<std::__1::shared_ptrdoris::Rowset > >, std::__1::function<bool (std::__1::shared_ptrdoris::Tablet const&)>) ()
#7 0x00005636adb0ed81 in doris::StorageEngine::_cooldown_tasks_producer_callback() ()
#8 0x00005636ae17a253 in doris::Thread::supervise_thread(void*) ()
#9 0x00007f788b0fdea5 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f788b916b0d in clone () from /lib64/libc.so.6
review the code, there's no need a rdlock inside TabletManager::get_cooldown_tablets