提交 c1d41ada 编写于 作者: O obdev 提交者: ob-robot

[BUGFIX] fix lob remote query memory usage

上级 8309758e
......@@ -3687,6 +3687,9 @@ int ObLobQueryRemoteReader::open(ObLobAccessParam& param, common::ObDataBuffer &
int ret = OB_SUCCESS;
char *buf = NULL;
int64_t buf_len = ObLobQueryArg::OB_LOB_QUERY_BUFFER_LEN;
if (GET_MIN_CLUSTER_VERSION() < CLUSTER_VERSION_4_3_0_0) {
buf_len *= ObLobQueryArg::OB_LOB_QUERY_OLD_LEN_REFACTOR; // compat with old vesion
}
if (NULL == (buf = reinterpret_cast<char*>(param.allocator_->alloc(buf_len)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to alloc buf", K(ret));
......@@ -3694,6 +3697,7 @@ int ObLobQueryRemoteReader::open(ObLobAccessParam& param, common::ObDataBuffer &
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to set rpc buffer", K(ret));
} else if (NULL == (buf = reinterpret_cast<char*>(param.allocator_->alloc(buf_len)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to alloc buf", K(ret));
} else {
data_buffer_.assign_buffer(buf, buf_len);
......
......@@ -53,7 +53,8 @@ public:
~ObLobQueryArg();
TO_STRING_KV(K_(tenant_id), K_(offset), K_(len), K_(cs_type), K_(qtype), K_(scan_backward), K_(lob_locator));
public:
static const int64_t OB_LOB_QUERY_BUFFER_LEN = 2*1024L*1024L;
static const int64_t OB_LOB_QUERY_BUFFER_LEN = 256*1024L;
static const int64_t OB_LOB_QUERY_OLD_LEN_REFACTOR = 8;
uint64_t tenant_id_;
uint64_t offset_; // char offset
uint64_t len_; // char len
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册