Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
soremi
oceanbase
提交
edb1623a
O
oceanbase
项目概览
soremi
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
edb1623a
编写于
3月 23, 2022
作者:
L
lz0
提交者:
LINGuanRen
3月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix core that dtl free dtl buffer from rpc wrongly
上级
346a6fb7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
26 deletion
+41
-26
src/sql/dtl/ob_dtl_local_channel.cpp
src/sql/dtl/ob_dtl_local_channel.cpp
+0
-1
src/sql/dtl/ob_dtl_local_first_buffer_manager.cpp
src/sql/dtl/ob_dtl_local_first_buffer_manager.cpp
+36
-22
src/sql/dtl/ob_dtl_local_first_buffer_manager.h
src/sql/dtl/ob_dtl_local_first_buffer_manager.h
+3
-0
src/sql/dtl/ob_dtl_rpc_channel.cpp
src/sql/dtl/ob_dtl_rpc_channel.cpp
+1
-1
src/sql/dtl/ob_dtl_rpc_processor.cpp
src/sql/dtl/ob_dtl_rpc_processor.cpp
+0
-1
src/sql/dtl/ob_dtl_tenant_mem_manager.cpp
src/sql/dtl/ob_dtl_tenant_mem_manager.cpp
+1
-1
未找到文件。
src/sql/dtl/ob_dtl_local_channel.cpp
浏览文件 @
edb1623a
...
...
@@ -96,7 +96,6 @@ int ObDtlLocalChannel::send_shared_message(ObDtlLinkedBuffer*& buf)
KP
(
buf
));
bool
is_eof
=
buf
->
is_eof
();
if
(
OB_FAIL
(
DTL
.
get_dfc_server
().
cache
(
/*buf->tenant_id(), */
peer_id_
,
buf
,
true
)))
{
ret
=
tmp_ret
;
LOG_WARN
(
"get DTL channel fail"
,
KP
(
peer_id_
),
"peer"
,
get_peer
(),
K
(
ret
),
K
(
tmp_ret
));
}
else
{
// return block after cache first msg
...
...
src/sql/dtl/ob_dtl_local_first_buffer_manager.cpp
浏览文件 @
edb1623a
...
...
@@ -38,7 +38,9 @@ int ObDtlLocalFirstBufferCache::ObDtlBufferClean::operator()(sql::dtl::ObDtlCach
int
ret
=
OB_SUCCESS
;
ObDtlLinkedBuffer
*
linked_buffer
=
buffer_info
->
buffer
();
buffer_info
->
set_buffer
(
nullptr
);
tenant_mem_mgr_
->
free
(
linked_buffer
);
if
(
nullptr
!=
linked_buffer
)
{
tenant_mem_mgr_
->
free
(
linked_buffer
);
}
buffer_info
->
reset
();
buffer_info_mgr_
->
free_buffer_info
(
buffer_info
);
return
ret
;
...
...
@@ -113,23 +115,27 @@ int ObDtlLocalFirstBufferCache::cache_buffer(ObDtlCacheBufferInfo*& buffer)
int
ret
=
OB_SUCCESS
;
if
(
OB_NOT_NULL
(
buffer
))
{
uint64_t
chan_id
=
buffer
->
chid
();
if
(
OB_FAIL
(
buffer_map_
.
set_refactored
(
chan_id
,
buffer
)))
{
#ifdef ERRSIM
// -17 enable failed set refactored
ret
=
E
(
EventTable
::
EN_DTL_ONE_ROW_ONE_BUFFER
)
ret
;
#endif
int64_t
tmp_ret
=
ret
;
if
(
TP_ENABLE_FAILED_SET_HT
==
ret
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"failed to set refactor"
,
K
(
ret
),
K
(
tmp_ret
));
}
else
if
(
OB_FAIL
(
buffer_map_
.
set_refactored
(
chan_id
,
buffer
)))
{
LOG_WARN
(
"failed to insert buffer map"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
set_first_buffer
(
chan_id
)))
{
int
tmp_ret
=
OB_SUCCESS
;
ObDtlCacheBufferInfo
*
tmp_buffer
=
nullptr
;
if
(
tmp_ret
!=
buffer_map_
.
erase_refactored
(
chan_id
,
tmp_buffer
))
{
LOG_WARN
(
"failed to insert buffer map"
,
K
(
ret
),
K
(
tmp_ret
));
}
else
if
(
nullptr
==
tmp_buffer
)
{
}
else
{
buffer
=
nullptr
;
if
(
TP_ENABLE_FAILED_SET_FIRST_BUFFER
==
tmp_ret
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"buffer is null"
,
K
(
ret
),
K
(
tmp_ret
));
LOG_WARN
(
"failed to set first buffer"
,
K
(
ret
),
K
(
tmp_ret
));
}
else
if
(
OB_FAIL
(
set_first_buffer
(
chan_id
)))
{
LOG_WARN
(
"failed to set first buffer"
,
K
(
ret
),
K
(
chan_id
),
KP
(
chan_id
));
}
else
{
buffer
=
tmp_buffer
;
inc_first_buffer_cnt
();
LOG_DEBUG
(
"trace cache buffer"
,
KP
(
chan_id
),
KP
(
this
),
K
(
dfo_key_
));
}
LOG_WARN
(
"failed to set first buffer"
,
K
(
ret
),
K
(
chan_id
),
KP
(
chan_id
));
}
else
{
inc_first_buffer_cnt
();
LOG_DEBUG
(
"trace cache buffer"
,
KP
(
chan_id
),
KP
(
this
),
K
(
dfo_key_
));
}
}
return
ret
;
...
...
@@ -421,7 +427,18 @@ int ObDtlLocalFirstBufferCacheManager::cache_buffer(int64_t chid, ObDtlLinkedBuf
buf_info
->
set_buffer
(
data_buffer
);
data_buffer
=
nullptr
;
}
else
{
ObDtlLinkedBuffer
*
buffer
=
tenant_mem_mgr_
->
alloc
(
chid
,
data_buffer
->
size
());
ObDtlLinkedBuffer
*
buffer
=
nullptr
;
#ifdef ERRSIM
// -16 enable failed to alloc memory
ret
=
E
(
EventTable
::
EN_DTL_ONE_ROW_ONE_BUFFER
)
ret
;
#endif
if
(
OB_SUCC
(
ret
)
||
TP_ENABLE_FAILED_ALLOC_MEM
!=
ret
)
{
ret
=
OB_SUCCESS
;
buffer
=
tenant_mem_mgr_
->
alloc
(
chid
,
data_buffer
->
size
());
}
else
{
ret
=
OB_SUCCESS
;
buffer
=
nullptr
;
}
if
(
nullptr
!=
buffer
)
{
ObDtlLinkedBuffer
::
assign
(
*
data_buffer
,
buffer
);
buf_info
->
set_buffer
(
buffer
);
...
...
@@ -442,13 +459,10 @@ int ObDtlLocalFirstBufferCacheManager::cache_buffer(int64_t chid, ObDtlLinkedBuf
if
(
OB_FAIL
(
ret
))
{
int
tmp_ret
=
OB_SUCCESS
;
if
(
nullptr
!=
buf_info
)
{
if
(
nullptr
==
data_buffer
)
{
// if cache buffer failed, should still send it. Can't just free it
data_buffer
=
buf_info
->
buffer
();
buf_info
->
set_buffer
(
nullptr
);
}
if
(
!
attach
&&
OB_NOT_NULL
(
data_buffer
))
{
tenant_mem_mgr_
->
free
(
data_buffer
);
ObDtlLinkedBuffer
*
buffer
=
buf_info
->
buffer
();
buf_info
->
set_buffer
(
nullptr
);
if
(
nullptr
!=
buffer
)
{
tenant_mem_mgr_
->
free
(
buffer
);
}
if
(
OB_SUCCESS
!=
(
tmp_ret
=
buffer_info_mgr_
.
free_buffer_info
(
buf_info
)))
{
LOG_WARN
(
"failed to free buffer info"
,
K
(
ret
),
K
(
tmp_ret
));
...
...
src/sql/dtl/ob_dtl_local_first_buffer_manager.h
浏览文件 @
edb1623a
...
...
@@ -566,6 +566,8 @@ private:
static
const
int64_t
CONCURRENT_CNT
=
2048
;
static
const
int64_t
CHANNEL_HASH_BUCKET_NUM
=
64
*
1024
;
static
const
int64_t
MAX_BITSET_CNT
=
1024
*
1024
;
// 1024 * 1024
static
const
int64_t
TP_ENABLE_FAILED_SET_HT
=
-
17
;
static
const
int64_t
TP_ENABLE_FAILED_SET_FIRST_BUFFER
=
-
18
;
int64_t
pins_
;
ObDtlDfoKey
dfo_key_
;
ObDtlFirstBufferHashTable
<
uint64_t
,
ObDtlCacheBufferInfo
>
buffer_map_
;
...
...
@@ -603,6 +605,7 @@ public:
private:
static
const
int64_t
CONCURRENT_CNT
=
1024
;
static
const
int64_t
BUCKET_NUM
=
64
*
1024
;
static
const
int64_t
TP_ENABLE_FAILED_ALLOC_MEM
=
-
16
;
uint64_t
tenant_id_
;
common
::
ObFIFOAllocator
allocator_
;
ObDtlTenantMemManager
*
tenant_mem_mgr_
;
...
...
src/sql/dtl/ob_dtl_rpc_channel.cpp
浏览文件 @
edb1623a
...
...
@@ -188,7 +188,7 @@ int ObDtlRpcChannel::feedup(ObDtlLinkedBuffer*& buffer)
LOG_WARN
(
"control channel can't drain msg"
,
K
(
ret
));
}
}
else
if
(
OB_ISNULL
(
linked_buffer
=
alloc_buf
(
buffer
->
size
())))
{
ret
=
OB_
REACH_MEMORY_LIMIT
;
ret
=
OB_
ALLOCATE_MEMORY_FAILED
;
LOG_WARN
(
"failed to allocate buffer"
,
K
(
ret
));
}
else
{
LOG_TRACE
(
"DTL feedup a new msg to msg loop"
,
K
(
buffer
->
size
()),
KP
(
id_
),
K
(
peer_
));
...
...
src/sql/dtl/ob_dtl_rpc_processor.cpp
浏览文件 @
edb1623a
...
...
@@ -63,7 +63,6 @@ int ObDtlSendMessageP::process_msg(ObDtlRpcDataResponse& response, ObDtlSendArgs
}
else
if
(
arg
.
buffer_
.
is_data_msg
()
&&
1
==
arg
.
buffer_
.
seq_no
())
{
ObDtlLinkedBuffer
*
buf
=
&
arg
.
buffer_
;
if
(
OB_FAIL
(
DTL
.
get_dfc_server
().
cache
(
arg
.
buffer_
.
tenant_id
(),
arg
.
chid_
,
buf
)))
{
ret
=
tmp_ret
;
LOG_WARN
(
"get DTL channel fail"
,
KP
(
arg
.
chid_
),
K
(
ret
),
...
...
src/sql/dtl/ob_dtl_tenant_mem_manager.cpp
浏览文件 @
edb1623a
...
...
@@ -136,7 +136,7 @@ ObDtlLinkedBuffer* ObDtlTenantMemManager::alloc(int64_t chid, int64_t size)
++
n_times
;
buf
=
mem_mgr
->
alloc
(
chid
,
size
);
if
(
nullptr
==
buf
)
{
ret
=
OB_
REACH_MEMORY_LIMIT
;
ret
=
OB_
ALLOCATE_MEMORY_FAILED
;
LOG_WARN
(
"failed to allocate dtl buffer memory"
,
K
(
ret
));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录