-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[fix](gc tablet) fix get shutdown tablet cost a lot time #27693
[fix](gc tablet) fix get shutdown tablet cost a lot time #27693
Conversation
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
48b82ea
to
3a45836
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
be/src/olap/tablet_manager.cpp
Outdated
std::lock_guard<std::shared_mutex> wrlock(_shutdown_deleting_tablets_lock); | ||
auto it = _shutdown_deleting_tablets.begin(); | ||
while (it != _shutdown_deleting_tablets.end()) { | ||
auto it = _shutdown_tablets.begin(); |
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.
is _shutdown_tablets thread safe to iterate?
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.
update
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
(From new machine)TeamCity pipeline, clickbench performance test result: |
cc74117
to
83e4574
Compare
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
361e56e
to
03159f5
Compare
run buildall |
clang-tidy review says "All clean, LGTM! 👍" |
std::lock_guard<std::shared_mutex> wrdlock(_shutdown_tablets_lock); | ||
while (last_it != _shutdown_tablets.end() && batch_tablets.size() < limit) { | ||
// it means current tablet is referenced by other thread | ||
if (last_it->use_count() > 1) { |
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.
what if tablet is referenced during _move_tablet_to_trash
, will the query being correct?
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.
如果tablet被其他线程拿住,不会回收这个tablet;
如果tablet正在执行_move_tablet_to_trash,其他线程不会拿到这个tablet(因为其他线程拿tablet需要获得shutdown_tablets_lock 的读锁)
TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
(From new machine)TeamCity pipeline, clickbench performance test result: |
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.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
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.
LGTM
If gc shutdown tablets take a lot time, it will make TabletManager getting a tablet wait a lot time.
pr #26151 had fix get a running tablet wait a lot time. Also it fix drop a tablet hold a tablet meta lock too long.
But it hadn't fix get a deleted tablet wait a log time. So this pr fix this.
Proposed changes
Issue Number: close #xxx
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...