-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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] Move delta write open out of brpc worker #56517
base: main
Are you sure you want to change the base?
Conversation
@@ -679,11 +679,59 @@ Status LocalTabletsChannel::_open_all_writers(const PTabletWriterOpenRequest& pa | |||
} | |||
|
|||
_is_replicated_storage = params.is_replicated_storage(); | |||
std::shared_ptr<DeltaWriterOpenContext> context = std::make_shared<DeltaWriterOpenContext>(); |
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.
we can move the execution to thread pool in the brpc entrypoint in backend_service.cpp
or internal_service.cpp
just like other brpc interface, e.g. exec_plan_fragment ...
Signed-off-by: PengFei Li <[email protected]>
Signed-off-by: PengFei Li <[email protected]>
@@ -205,6 +205,7 @@ class StarRocksMetrics { | |||
METRIC_DEFINE_INT_COUNTER(load_bytes_total, MetricUnit::BYTES); | |||
|
|||
// Metrics for LoadChannel | |||
METRICS_DEFINE_THREAD_POOL(load_channel_mgr); |
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.
load_channel_pool? a little confused a thread pool is named as *_mgr
@@ -71,6 +71,14 @@ namespace lake { | |||
class TabletManager; | |||
} | |||
|
|||
struct LoadChannelOpenRequest { |
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.
this is also the same as the RPC's controller, maybe name it LoadChannelOpenController
or LoadChannelOpenContext
return; | ||
} | ||
auto task = [=]() { this->_open(open_request); }; | ||
Status status = _async_rpc_pool->submit_func(std::move(task)); |
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.
the task can be submit successful but not executed at all when doing pool shutdown, hence lead the done
never get called and resulting the brpc server exit hanging.
Signed-off-by: PengFei Li <[email protected]>
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
Why I'm doing:
tablet_writer_open
brpc request needs to initialize DeltaWriter (DeltaWriter::_init). The initialization can be heavy because it needs to hold many pthread locks, such asWaiting lock can block brpc worker and make the whole brpc service unavailable. We need move the initialization out of brpc worker so that it won't affect the brpc service.
What I'm doing:
when receiving the
tablet_writer_open
rpc request, submit it to a separate thread pool to process itFixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: