Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion be/src/util/brpc_client_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ class BrpcClientCache {

std::shared_ptr<T> get_new_client_no_cache(const std::string& host_port,
const std::string& protocol = "baidu_std",
const std::string& connect_type = "") {
const std::string& connect_type = "",
const std::string& connection_group = "") {
brpc::ChannelOptions options;
if constexpr (std::is_same_v<T, PFunctionService_Stub>) {
options.protocol = config::function_service_protocol;
Expand All @@ -121,6 +122,9 @@ class BrpcClientCache {
if (connect_type != "") {
options.connection_type = connect_type;
}
if (connection_group != "") {
options.connection_group = connection_group;
}
options.connect_timeout_ms = 2000;
options.max_retry = 10;

Expand Down
6 changes: 3 additions & 3 deletions be/src/vec/sink/load_stream_stub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ Status LoadStreamStub::open(BrpcClientCache<PBackendService_Stub>* client_cache,
*request.add_tablets() = tablet;
}
POpenLoadStreamResponse response;
// use "pooled" connection to avoid conflicts between streaming rpc and regular rpc,
// see: https://github.com/apache/brpc/issues/392
const auto& stub = client_cache->get_new_client_no_cache(host_port, "baidu_std", "pooled");
// set connection_group "streaming" to distinguish with non-streaming connections
const auto& stub =
client_cache->get_new_client_no_cache(host_port, "baidu_std", "single", "streaming");
stub->open_load_stream(&cntl, &request, &response, nullptr);
for (const auto& resp : response.tablet_schemas()) {
auto tablet_schema = std::make_unique<TabletSchema>();
Expand Down