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
4 changes: 4 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,10 @@ namespace config {
// the load process will reject new incoming load job of this tablet.
// This is to avoid too many version num.
CONF_mInt32(max_tablet_version_num, "500");

// Frontend mainly use two thrift sever type: THREAD_POOL, THREADED. if fe use THREADED model for thrift server,
// the thrift_server_type_of_fe should be set THREADED to make be thrift client to fe constructed with TFramedTransport
CONF_String(thrift_server_type_of_fe, "THREAD_POOL");

} // namespace config

Expand Down
13 changes: 12 additions & 1 deletion be/src/runtime/client_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,22 @@ class ClientCache {

// Factory method to produce a new ThriftClient<T> for the wrapped cache
ThriftClientImpl* make_client(const TNetworkAddress& hostport, void** client_key) {
Client* client = new Client(hostport.hostname, hostport.port);
static ThriftServer::ServerType server_type = get_thrift_server_type();
Client* client = new Client(hostport.hostname, hostport.port, server_type);
*client_key = reinterpret_cast<void*>(client->iface());
return client;
}

// since service type is multiple, we should set thrift server type here for be thrift client
ThriftServer::ServerType get_thrift_server_type() {
auto &thrift_server_type = config::thrift_server_type_of_fe;
transform(thrift_server_type.begin(), thrift_server_type.end(), thrift_server_type.begin(), toupper);
if (strcmp(typeid(T).name(), "N5doris21FrontendServiceClientE") == 0 && thrift_server_type == "THREADED") {
return ThriftServer::ServerType::THREADED;
} else {
return ThriftServer::ServerType::THREAD_POOL;
}
}
};

// Doris backend client cache, used by a backend to send requests
Expand Down
7 changes: 1 addition & 6 deletions be/src/util/thrift_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,12 @@ ThriftClient<InterfaceType>::ThriftClient(
_iface(new InterfaceType(_protocol)) {
switch (server_type) {
case ThriftServer::NON_BLOCKING:
// The Nonblocking server is disabled at this time. There are
// issues with the framed protocol throwing negative frame size errors.
LOG(WARNING) << "Nonblocking server usage is experimental";
case ThriftServer::THREADED:
_transport.reset(new apache::thrift::transport::TFramedTransport(_socket));
break;

case ThriftServer::THREAD_POOL:
case ThriftServer::THREADED:
_transport.reset(new apache::thrift::transport::TBufferedTransport(_socket));
break;

default:
std::stringstream error_msg;
error_msg << "Unsupported server type: " << server_type;
Expand Down
8 changes: 8 additions & 0 deletions docs/en/administrator-guide/config/be_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,14 @@ If the system is found to be in a high-stress scenario and a large number of thr

### `thrift_rpc_timeout_ms`

### `thrift_server_type_of_fe`

This configuration indicates the service model used by FE's Thrift service. The type is string and is case-insensitive. This parameter needs to be consistent with the setting of fe's thrift_server_type parameter. Currently there are two values for this parameter, `THREADED` and `THREAD_POOL`.

If the parameter is `THREADED`, the model is a non-blocking I/O model,

If the parameter is `THREAD_POOL`, the model is a blocking I/O model.

### `trash_file_expire_time_sec`

### `txn_commit_rpc_timeout_ms`
Expand Down
8 changes: 8 additions & 0 deletions docs/zh-CN/administrator-guide/config/be_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,14 @@ Stream Load 一般适用于导入几个GB以内的数据,不适合导入过大

### `thrift_rpc_timeout_ms`

### `thrift_server_type_of_fe`

该配置表示FE的Thrift服务使用的服务模型, 类型为string, 大小写不敏感,该参数需要和fe的thrift_server_type参数的设置保持一致。目前该参数的取值有两个,`THREADED`和`THREAD_POOL`。

若该参数为`THREADED`, 该模型为非阻塞式I/O模型,

若该参数为`THREAD_POOL`, 该模型为阻塞式I/O模型。

### `trash_file_expire_time_sec`

### `txn_commit_rpc_timeout_ms`
Expand Down