Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lihongda1002
oceanbase
提交
f61b55b3
O
oceanbase
项目概览
lihongda1002
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f61b55b3
编写于
11月 07, 2022
作者:
T
Tyshawn
提交者:
wangzelin.wzl
11月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[BUG.FIX] Reduce lock conflicts
上级
55f77695
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
4 deletion
+8
-4
src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp
src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp
+7
-2
src/storage/meta_mem/ob_tenant_meta_mem_mgr.h
src/storage/meta_mem/ob_tenant_meta_mem_mgr.h
+0
-1
unittest/storage/test_meta_pointer_map.cpp
unittest/storage/test_meta_pointer_map.cpp
+1
-1
未找到文件。
src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp
浏览文件 @
f61b55b3
...
...
@@ -130,15 +130,20 @@ int ObTenantMetaMemMgr::init()
{
int
ret
=
OB_SUCCESS
;
lib
::
ObMemAttr
mem_attr
(
tenant_id_
,
"MetaAllocator"
,
ObCtxIds
::
META_OBJ_CTX_ID
);
const
int64_t
mem_limit
=
get_tenant_memory_limit
(
tenant_id_
);
const
int64_t
min_bkt_cnt
=
DEFAULT_BUCKET_NUM
;
const
int64_t
max_bkt_cnt
=
10000000L
;
const
int64_t
tablet_bucket_num
=
std
::
min
(
std
::
max
((
mem_limit
/
(
1024
*
1024
*
1024
))
*
50000
,
min_bkt_cnt
),
max_bkt_cnt
);
const
int64_t
bucket_num
=
common
::
hash
::
cal_next_prime
(
tablet_bucket_num
);
if
(
OB_UNLIKELY
(
is_inited_
))
{
ret
=
OB_INIT_TWICE
;
LOG_WARN
(
"ObTenantMetaMemMgr has been initialized"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
bucket_lock_
.
init
(
DEFAULT_LOCK_BUCKET_COUNT
,
ObLatchIds
::
BLOCK_MANAGER_LOCK
)))
{
}
else
if
(
OB_FAIL
(
bucket_lock_
.
init
(
bucket_num
,
ObLatchIds
::
BLOCK_MANAGER_LOCK
)))
{
LOG_WARN
(
"fail to init bucket lock"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
allocator_
.
init
(
lib
::
ObMallocAllocator
::
get_instance
(),
OB_MALLOC_NORMAL_BLOCK_SIZE
,
mem_attr
)))
{
LOG_WARN
(
"fail to init tenant fifo allocator"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tablet_map_
.
init
(
DEFAULT_BUCKET_NUM
,
"TabletMap"
,
TOTAL_LIMIT
,
HOLD_LIMIT
,
}
else
if
(
OB_FAIL
(
tablet_map_
.
init
(
bucket_num
,
"TabletMap"
,
TOTAL_LIMIT
,
HOLD_LIMIT
,
common
::
OB_MALLOC_NORMAL_BLOCK_SIZE
)))
{
LOG_WARN
(
"fail to initialize tablet map"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
last_min_minor_sstable_set_
.
create
(
DEFAULT_MINOR_SSTABLE_SET_COUNT
)))
{
...
...
src/storage/meta_mem/ob_tenant_meta_mem_mgr.h
浏览文件 @
f61b55b3
...
...
@@ -90,7 +90,6 @@ private:
static
const
int64_t
MAX_TABLET_CNT_IN_OBJ_POOL
=
50000
;
static
const
int64_t
MAX_SSTABLE_CNT_IN_OBJ_POOL
=
5
*
MAX_TABLET_CNT_IN_OBJ_POOL
;
static
const
int64_t
MAX_MEMTABLE_CNT_IN_OBJ_POOL
=
2
*
MAX_TABLET_CNT_IN_OBJ_POOL
;
static
const
int64_t
DEFAULT_LOCK_BUCKET_COUNT
=
2048
;
static
const
int64_t
MAX_TX_DATA_MEMTABLE_CNT_IN_OBJ_POOL
=
MAX_MEMSTORE_CNT
*
OB_MINI_MODE_MAX_LS_NUM_PER_TENANT_PER_SERVER
;
static
const
int64_t
MAX_TX_CTX_MEMTABLE_CNT_IN_OBJ_POOL
=
OB_MINI_MODE_MAX_LS_NUM_PER_TENANT_PER_SERVER
;
static
const
int64_t
MAX_LOCK_MEMTABLE_CNT_IN_OBJ_POOL
=
OB_MINI_MODE_MAX_LS_NUM_PER_TENANT_PER_SERVER
;
...
...
unittest/storage/test_meta_pointer_map.cpp
浏览文件 @
f61b55b3
...
...
@@ -66,7 +66,7 @@ TestMetaPointerMap::TestMetaPointerMap()
void
TestMetaPointerMap
::
SetUp
()
{
int
ret
=
tablet_map_
.
init
(
10
243
L
,
"TabletMap"
,
15
*
1024L
*
1024L
*
1024L
,
8
*
1024L
*
1024L
,
int
ret
=
tablet_map_
.
init
(
10
0000000
L
,
"TabletMap"
,
15
*
1024L
*
1024L
*
1024L
,
8
*
1024L
*
1024L
,
common
::
OB_MALLOC_NORMAL_BLOCK_SIZE
);
ASSERT_EQ
(
common
::
OB_SUCCESS
,
ret
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录