Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
45a79bc8
O
oceanbase
项目概览
oceanbase
/
oceanbase
10 个月 前同步成功
通知
261
Star
6084
Fork
1301
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
提交
45a79bc8
编写于
7月 26, 2023
作者:
M
Minionyh
提交者:
ob-robot
7月 26, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
split memory to tenant
上级
0cabd547
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
8 deletion
+13
-8
src/storage/tx/ob_dup_table_tablets.cpp
src/storage/tx/ob_dup_table_tablets.cpp
+12
-7
src/storage/tx/ob_dup_table_tablets.h
src/storage/tx/ob_dup_table_tablets.h
+1
-1
未找到文件。
src/storage/tx/ob_dup_table_tablets.cpp
浏览文件 @
45a79bc8
...
...
@@ -154,14 +154,17 @@ int ObLSDupTabletsMgr::CollectTabletsHandler::operator()(
//****** DupTabletSet & DupTabletLog
//**********************************************************************
int
DupTabletChangeMap
::
create
(
int64_t
bucket_num
)
int
DupTabletChangeMap
::
create
(
const
uint64_t
tenant_id
,
const
int64_t
bucket_num
)
{
int
ret
=
OB_SUCCESS
;
if
(
!
dup_set_attr_
.
common_header_
.
is_valid
())
{
ObMemAttr
attr
(
tenant_id
,
"DupTabletHash"
);
if
(
!
dup_set_attr_
.
common_header_
.
is_valid
()
||
tenant_id
<=
OB_INVALID_TENANT_ID
)
{
ret
=
OB_ERR_UNEXPECTED
;
DUP_TABLE_LOG
(
WARN
,
"invalid unique_id"
,
K
(
ret
),
K
(
dup_set_attr_
));
}
else
if
(
OB_FAIL
(
DupTabletIdMap
::
create
(
bucket_num
,
"DupTabletHash"
)))
{
DUP_TABLE_LOG
(
WARN
,
"create dup tablet id map failed"
,
K
(
ret
),
K
(
dup_set_attr_
),
K
(
bucket_num
));
DUP_TABLE_LOG
(
WARN
,
"invalid unique_id or tenant_id"
,
K
(
ret
),
K
(
dup_set_attr_
),
K
(
tenant_id
));
}
else
if
(
OB_FAIL
(
DupTabletIdMap
::
create
(
bucket_num
,
attr
)))
{
DUP_TABLE_LOG
(
WARN
,
"create dup tablet id map failed"
,
K
(
ret
),
K
(
dup_set_attr_
),
K
(
bucket_num
),
K
(
tenant_id
));
}
return
ret
;
...
...
@@ -344,6 +347,7 @@ int ObLSDupTabletsMgr::init_free_tablet_pool_()
int
ret
=
OB_SUCCESS
;
destroy_free_tablet_pool_
();
const
uint64_t
tenant_id
=
MTL_ID
();
for
(
int
i
=
0
;
i
<
RESERVED_FREE_SET_COUNT
&&
OB_SUCC
(
ret
);
i
++
)
{
DupTabletChangeMap
*
tmp_map_ptr
=
nullptr
;
...
...
@@ -352,7 +356,7 @@ int ObLSDupTabletsMgr::init_free_tablet_pool_()
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
// } else if (OB_FALSE_IT(extra_free_set_alloc_count_++)) {
}
else
if
(
OB_FALSE_IT
(
new
(
tmp_map_ptr
)
DupTabletChangeMap
(
i
+
1
)))
{
}
else
if
(
OB_FAIL
(
tmp_map_ptr
->
create
(
1024
)))
{
}
else
if
(
OB_FAIL
(
tmp_map_ptr
->
create
(
tenant_id
,
1024
)))
{
DUP_TABLE_LOG
(
WARN
,
"create dup_tablet hash map"
,
K
(
ret
));
}
else
if
(
false
==
(
free_set_pool_
.
add_last
(
tmp_map_ptr
)))
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
@@ -1922,13 +1926,14 @@ int ObLSDupTabletsMgr::alloc_extra_free_tablet_set_()
int
ret
=
OB_SUCCESS
;
DupTabletChangeMap
*
tmp_map_ptr
=
nullptr
;
const
uint64_t
tenant_id
=
MTL_ID
();
if
(
OB_ISNULL
(
tmp_map_ptr
=
static_cast
<
DupTabletChangeMap
*>
(
share
::
mtl_malloc
(
sizeof
(
DupTabletChangeMap
),
"DupTabletMap"
))))
{
ret
=
OB_ALLOCATE_MEMORY_FAILED
;
}
else
if
(
OB_FALSE_IT
(
extra_free_set_alloc_count_
++
))
{
}
else
if
(
OB_FALSE_IT
(
new
(
tmp_map_ptr
)
DupTabletChangeMap
(
RESERVED_FREE_SET_COUNT
+
extra_free_set_alloc_count_
)))
{
}
else
if
(
OB_FAIL
(
tmp_map_ptr
->
create
(
1024
)))
{
}
else
if
(
OB_FAIL
(
tmp_map_ptr
->
create
(
tenant_id
,
1024
)))
{
DUP_TABLE_LOG
(
WARN
,
"create dup_tablet hash map"
,
K
(
ret
));
}
else
if
(
false
==
(
free_set_pool_
.
add_last
(
tmp_map_ptr
)))
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
src/storage/tx/ob_dup_table_tablets.h
浏览文件 @
45a79bc8
...
...
@@ -361,7 +361,7 @@ public:
DupTabletIdMap
::
destroy
();
}
int
create
(
int64_t
bucket_num
);
int
create
(
const
uint64_t
tenant_id
,
const
int64_t
bucket_num
);
DupTabletSetChangeStatus
*
get_change_status
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录