Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
f0c194c3
O
oceanbase
项目概览
clmforever
/
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,发现更多精彩内容 >>
提交
f0c194c3
编写于
3月 02, 2023
作者:
O
obdev
提交者:
ob-robot
3月 02, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug of obj_leak_checker
上级
2c2c26c3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
26 deletion
+23
-26
deps/oblib/src/lib/lock/ob_latch.h
deps/oblib/src/lib/lock/ob_latch.h
+0
-1
src/share/leak_checker/obj_leak_checker.h
src/share/leak_checker/obj_leak_checker.h
+23
-20
src/storage/ob_i_table.cpp
src/storage/ob_i_table.cpp
+0
-3
src/storage/ob_i_table.h
src/storage/ob_i_table.h
+0
-2
未找到文件。
deps/oblib/src/lib/lock/ob_latch.h
浏览文件 @
f0c194c3
...
...
@@ -337,7 +337,6 @@ public:
ObLDHandle
&
operator
=
(
ObLDHandle
&&
other
)
{
node_
=
other
.
node_
;
other
.
node_
;
return
*
this
;
}
ObLDHandleNode
*
node_
;
...
...
src/share/leak_checker/obj_leak_checker.h
浏览文件 @
f0c194c3
...
...
@@ -28,7 +28,6 @@ enum ObLeakCheckObjType
{
LEAK_CHECK_OBJ_TABLET_HANDLE
,
LEAK_CHECK_OBJ_LS_HANDLE
,
LEAK_CHECK_OBJ_TABLE_HANDLE
,
LEAK_CHECK_OBJ_MAX_NUM
};
...
...
@@ -81,7 +80,27 @@ public:
ob_assert
(
it
!=
obj_map
.
end
());
obj_map
.
erase
(
it
);
}
ObLeakCheckAllMap
&
get_map
()
{
return
map_
;
}
void
print_obj_leak
(
const
uint64_t
tenant_id
,
const
ObLeakCheckObjType
obj_type
)
{
common
::
ObSpinLockGuard
guard
(
lock_
);
auto
it
=
map_
.
find
(
tenant_id
);
if
(
it
!=
map_
.
end
())
{
if
(
LEAK_CHECK_OBJ_MAX_NUM
==
obj_type
)
{
for
(
int64_t
i
=
0
;
i
<
LEAK_CHECK_OBJ_MAX_NUM
;
i
++
)
{
auto
&
obj_map
=
it
->
second
.
at
(
i
);
for
(
auto
&
pair
:
obj_map
)
{
SHARE_LOG
(
INFO
,
"dump leak obj"
,
K
(
pair
.
first
),
K
(
pair
.
second
.
c_str
()));
}
}
}
else
{
auto
&
obj_map
=
it
->
second
.
at
(
obj_type
);
for
(
auto
&
pair
:
obj_map
)
{
SHARE_LOG
(
INFO
,
"dump leak obj"
,
K
(
pair
.
first
),
K
(
pair
.
second
.
c_str
()));
}
}
}
}
private:
ObSpinLock
lock_
;
...
...
@@ -143,24 +162,8 @@ public:
// if obj_type == LEAK_CHECK_OBJ_MAX_NUM, dump all type obj
#define PRINT_OBJ_LEAK(tenant_id, obj_type) \
{ \
auto &leak_map = OBJ_LEAK_CHECKER.get_map(); \
auto it = leak_map.find(tenant_id); \
if (it != leak_map.end()) { \
if (LEAK_CHECK_OBJ_MAX_NUM == obj_type) { \
for (int64_t i = 0; i < LEAK_CHECK_OBJ_MAX_NUM; i++) { \
auto &obj_map = it->second.at(i); \
for (auto &pair : obj_map) { \
LOG_INFO("dump leak obj", K(pair.first), K(pair.second.c_str())); \
} \
} \
} else { \
auto &obj_map = it->second.at(obj_type); \
for (auto &pair : obj_map) { \
LOG_INFO("dump leak obj", K(pair.first), K(pair.second.c_str())); \
} \
} \
} \
}
OBJ_LEAK_CHECKER.print_obj_leak(tenant_id, obj_type); \
}
#else
#define DEFINE_OBJ_LEAK_DEBUG_NODE(node)
...
...
src/storage/ob_i_table.cpp
浏览文件 @
f0c194c3
...
...
@@ -169,14 +169,12 @@ int64_t ObITable::to_string(char *buf, const int64_t buf_len) const
ObTableHandleV2
::
ObTableHandleV2
()
:
table_
(
nullptr
),
t3m_
(
nullptr
),
allocator_
(
nullptr
),
table_type_
(
ObITable
::
TableType
::
MAX_TABLE_TYPE
)
{
INIT_OBJ_LEAK_DEBUG_NODE
(
node_
,
this
,
share
::
LEAK_CHECK_OBJ_TABLE_HANDLE
,
MTL_ID
());
}
ObTableHandleV2
::
ObTableHandleV2
(
ObITable
*
table
,
ObTenantMetaMemMgr
*
t3m
,
ObITable
::
TableType
type
)
:
table_
(
nullptr
),
t3m_
(
nullptr
),
allocator_
(
nullptr
),
table_type_
(
type
)
{
abort_unless
(
OB_SUCCESS
==
set_table
(
table
,
t3m
,
table_type_
));
INIT_OBJ_LEAK_DEBUG_NODE
(
node_
,
this
,
share
::
LEAK_CHECK_OBJ_TABLE_HANDLE
,
MTL_ID
());
}
ObTableHandleV2
::~
ObTableHandleV2
()
...
...
@@ -422,7 +420,6 @@ int ObTableHandleV2::get_lock_memtable(const ObLockMemtable *&memtable) const
ObTableHandleV2
::
ObTableHandleV2
(
const
ObTableHandleV2
&
other
)
:
table_
(
nullptr
),
t3m_
(
nullptr
)
{
INIT_OBJ_LEAK_DEBUG_NODE
(
node_
,
this
,
share
::
LEAK_CHECK_OBJ_TABLE_HANDLE
,
MTL_ID
());
*
this
=
other
;
}
...
...
src/storage/ob_i_table.h
浏览文件 @
f0c194c3
...
...
@@ -24,7 +24,6 @@
#include "storage/ob_i_store.h"
#include "storage/access/ob_table_read_info.h"
#include "storage/meta_mem/ob_tenant_meta_obj_pool.h"
#include "share/leak_checker/obj_leak_checker.h"
#include "share/ob_table_range.h"
#include "share/scn.h"
...
...
@@ -403,7 +402,6 @@ private:
ObTenantMetaMemMgr
*
t3m_
;
common
::
ObIAllocator
*
allocator_
;
ObITable
::
TableType
table_type_
;
DEFINE_OBJ_LEAK_DEBUG_NODE
(
node_
);
};
class
ObTablesHandleArray
final
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录