Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天地威能
oceanbase
提交
145a4a87
O
oceanbase
项目概览
天地威能
/
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,发现更多精彩内容 >>
提交
145a4a87
编写于
11月 24, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
11月 24, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] print MEMORY LOG when tenant deleted but memory not freed
上级
97b7209e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
1 deletion
+31
-1
src/observer/omt/ob_multi_tenant.cpp
src/observer/omt/ob_multi_tenant.cpp
+8
-1
src/storage/tx_storage/ob_tenant_memory_printer.cpp
src/storage/tx_storage/ob_tenant_memory_printer.cpp
+23
-0
未找到文件。
src/observer/omt/ob_multi_tenant.cpp
浏览文件 @
145a4a87
...
...
@@ -569,12 +569,19 @@ int ObMultiTenant::create_tenant_without_unit(const uint64_t tenant_id,
static
const
int64_t
VIRTUAL_TENANT_MEMORY_LIMTI
=
1L
<<
30
;
mem_limit
=
VIRTUAL_TENANT_MEMORY_LIMTI
;
}
if
(
OB_FAIL
(
construct_meta_for_virtual_tenant
(
tenant_id
,
min_cpu
,
max_cpu
,
mem_limit
,
meta
)))
{
LOG_WARN
(
"fail to construct_meta_for_virtual_tenant"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
OB_FAIL
(
create_tenant
(
meta
,
false
)))
{
LOG_WARN
(
"fail to create virtual tenant"
,
K
(
ret
),
K
(
tenant_id
));
}
if
(
OB_SUCC
(
ret
)
&&
is_virtual_tenant_id
(
tenant_id
))
{
ObVirtualTenantManager
&
omti
=
ObVirtualTenantManager
::
get_instance
();
if
(
OB_FAIL
(
omti
.
add_tenant
(
tenant_id
)))
{
LOG_ERROR
(
"Fail to add virtual tenant to tenant manager, "
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
omti
.
set_tenant_mem_limit
(
tenant_id
,
0
,
mem_limit
)))
{
LOG_ERROR
(
"Fail to set virtual tenant mem limit, "
,
K
(
ret
));
}
}
return
ret
;
}
...
...
src/storage/tx_storage/ob_tenant_memory_printer.cpp
浏览文件 @
145a4a87
...
...
@@ -13,6 +13,7 @@
#define USING_LOG_PREFIX STORAGE
#include "lib/utility/ob_print_utils.h"
#include "lib/alloc/memory_dump.h"
#include "observer/omt/ob_multi_tenant.h" // ObMultiTenant
#include "share/ob_tenant_mgr.h" // get_virtual_memory_used
#include "share/allocator/ob_memstore_allocator_mgr.h" // ObMemstoreAllocatorMgr
...
...
@@ -90,6 +91,28 @@ int ObTenantMemoryPrinter::print_tenant_usage()
LOG_WARN
(
"print mtl tenant usage failed"
,
K
(
tmp_ret
),
K
(
tenant_id
));
}
}
static
int64_t
last_print_ts
=
0
;
const
int64_t
now
=
ObTimeUtility
::
current_time
();
const
int64_t
INTERVAL
=
10
*
60
*
1000000L
;
if
(
now
-
last_print_ts
>=
INTERVAL
)
{
omt
::
TenantIdList
current_ids
(
nullptr
,
ObModIds
::
OMT
);
omt
->
get_tenant_ids
(
current_ids
);
int
tenant_cnt
=
0
;
static
uint64_t
all_tenant_ids
[
OB_MAX_SERVER_TENANT_CNT
]
=
{
0
};
common
::
get_tenant_ids
(
all_tenant_ids
,
OB_MAX_SERVER_TENANT_CNT
,
tenant_cnt
);
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
tenant_cnt
;
++
i
)
{
uint64_t
id
=
all_tenant_ids
[
i
];
if
(
OB_SERVER_TENANT_ID
!=
id
&&
current_ids
.
find
(
id
)
==
current_ids
.
end
())
{
// id is deleted tenant
lib
::
ObMallocAllocator
*
mallocator
=
lib
::
ObMallocAllocator
::
get_instance
();
if
(
OB_NOT_NULL
(
mallocator
))
{
mallocator
->
print_tenant_memory_usage
(
id
);
mallocator
->
print_tenant_ctx_memory_usage
(
id
);
}
}
}
last_print_ts
=
now
;
}
}
if
(
OB_SIZE_OVERFLOW
==
ret
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录