Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
ab320733
O
oceanbase
项目概览
oceanbase
/
oceanbase
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
ab320733
编写于
8月 30, 2023
作者:
K
KyrielightWei
提交者:
ob-robot
8月 30, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
force alloc special op tablet set in switch_to_leader
上级
044fadf5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
6 deletion
+16
-6
src/storage/tx/ob_dup_table_tablets.cpp
src/storage/tx/ob_dup_table_tablets.cpp
+13
-5
src/storage/tx/ob_dup_table_tablets.h
src/storage/tx/ob_dup_table_tablets.h
+3
-1
未找到文件。
src/storage/tx/ob_dup_table_tablets.cpp
浏览文件 @
ab320733
...
...
@@ -2284,7 +2284,9 @@ int ObLSDupTabletsMgr::alloc_extra_free_tablet_set_()
return
ret
;
}
int
ObLSDupTabletsMgr
::
get_free_tablet_set
(
DupTabletChangeMap
*&
free_set
,
const
uint64_t
target_id
)
int
ObLSDupTabletsMgr
::
get_free_tablet_set
(
DupTabletChangeMap
*&
free_set
,
const
bool
force_alloc
,
const
uint64_t
target_id
)
{
int
ret
=
OB_SUCCESS
;
...
...
@@ -2312,7 +2314,8 @@ int ObLSDupTabletsMgr::get_free_tablet_set(DupTabletChangeMap *&free_set, const
if
(
last_no_free_set_time_
<
0
)
{
last_no_free_set_time_
=
ObTimeUtility
::
fast_current_time
();
}
if
(
extra_free_set_alloc_count_
<
MAX_FREE_SET_COUNT
-
RESERVED_FREE_SET_COUNT
if
(
force_alloc
||
extra_free_set_alloc_count_
<
MAX_FREE_SET_COUNT
-
RESERVED_FREE_SET_COUNT
||
ObTimeUtility
::
fast_current_time
()
-
last_no_free_set_time_
>=
3
*
1000
*
1000
)
{
if
(
OB_FAIL
(
alloc_extra_free_tablet_set_
()))
{
DUP_TABLE_LOG
(
WARN
,
"alloc extra free tablet set failed"
,
K
(
ret
));
...
...
@@ -2368,13 +2371,14 @@ int ObLSDupTabletsMgr::get_target_tablet_set_(const DupTabletSetCommonHeader &ta
{
int
ret
=
OB_SUCCESS
;
const
uint64_t
unique_id
=
target_common_header
.
get_unique_id
();
const
bool
force_alloc
=
!
target_common_header
.
no_specail_op
();
if
(
target_set
!=
nullptr
)
{
ret
=
OB_INVALID_ARGUMENT
;
DUP_TABLE_LOG
(
WARN
,
"invalid argument"
,
K
(
ret
),
K
(
target_common_header
),
KPC
(
target_set
));
}
else
if
(
unique_id
==
DupTabletSetCommonHeader
::
INVALID_UNIQUE_ID
)
{
if
(
target_common_header
.
is_free
())
{
if
(
OB_FAIL
(
get_free_tablet_set
(
target_set
,
unique_id
)))
{
if
(
OB_FAIL
(
get_free_tablet_set
(
target_set
,
force_alloc
,
unique_id
)))
{
DUP_TABLE_LOG
(
WARN
,
"get free tablet set failed"
,
K
(
ret
));
}
}
else
if
(
target_common_header
.
is_old_set
())
{
...
...
@@ -2388,7 +2392,7 @@ int ObLSDupTabletsMgr::get_target_tablet_set_(const DupTabletSetCommonHeader &ta
}
else
if
(
target_common_header
.
is_new_set
())
{
if
(
OB_ISNULL
(
changing_new_set_
))
{
if
(
OB_FAIL
(
get_free_tablet_set
(
changing_new_set_
)))
{
if
(
OB_FAIL
(
get_free_tablet_set
(
changing_new_set_
,
force_alloc
)))
{
DUP_TABLE_LOG
(
WARN
,
"get free tablet set failed"
,
K
(
ret
));
}
else
{
...
...
@@ -2458,7 +2462,8 @@ int ObLSDupTabletsMgr::get_target_tablet_set_(const DupTabletSetCommonHeader &ta
// K(target_common_header),K(target_common_header.is_new_set()),K(target_common_header.is_old_set()),K(target_common_header.is_readable_set()));
if
(
OB_SUCC
(
ret
)
&&
OB_ISNULL
(
target_set
))
{
if
(
construct_target_set
&&
!
target_common_header
.
is_old_set
())
{
if
(
OB_FAIL
(
get_free_tablet_set
(
target_set
,
target_common_header
.
get_unique_id
())))
{
if
(
OB_FAIL
(
get_free_tablet_set
(
target_set
,
force_alloc
,
target_common_header
.
get_unique_id
())))
{
DUP_TABLE_LOG
(
WARN
,
"get free tablet set failed"
,
K
(
ret
),
KPC
(
target_set
),
K
(
target_common_header
),
K
(
need_confirm_new_queue_
.
get_size
()),
K
(
readable_tablets_list_
.
get_size
()),
KPC
(
removing_old_set_
));
...
...
@@ -2667,6 +2672,7 @@ int ObLSDupTabletsMgr::construct_empty_block_confirm_task_(const int64_t trx_ref
DupTabletSetCommonHeader
empty_new_common_header
;
empty_new_common_header
.
set_invalid_unique_id
();
empty_new_common_header
.
set_op_of_block_confirming
();
empty_new_common_header
.
set_free
();
uint64_t
block_confirm_uid
=
DupTabletSetCommonHeader
::
INVALID_UNIQUE_ID
;
...
...
@@ -2726,6 +2732,7 @@ int ObLSDupTabletsMgr::construct_clean_confirming_set_task_()
DupTabletSetCommonHeader
clean_confirming_common_header
;
clean_confirming_common_header
.
set_invalid_unique_id
();
clean_confirming_common_header
.
set_op_of_clean_data_confirming_set
();
clean_confirming_common_header
.
set_free
();
uint64_t
clean_confirming_uid
=
DupTabletSetCommonHeader
::
INVALID_UNIQUE_ID
;
...
...
@@ -2784,6 +2791,7 @@ int ObLSDupTabletsMgr::construct_clean_all_readable_set_task_()
DupTabletSetCommonHeader
clean_readable_common_header
;
clean_readable_common_header
.
set_invalid_unique_id
();
clean_readable_common_header
.
set_op_of_clean_all_readable_set
();
clean_readable_common_header
.
set_free
();
uint64_t
clean_readable_uid
=
DupTabletSetCommonHeader
::
INVALID_UNIQUE_ID
;
...
...
src/storage/tx/ob_dup_table_tablets.h
浏览文件 @
ab320733
...
...
@@ -789,7 +789,9 @@ private:
// int get_changing_new_set_(DupTabletChangeMap *&changing_new_set);
// int get_old_tablet_set_(DupTabletChangeMap *&old_tablet_set);
int
alloc_extra_free_tablet_set_
();
int
get_free_tablet_set
(
DupTabletChangeMap
*&
free_set
,
const
uint64_t
target_id
=
0
);
int
get_free_tablet_set
(
DupTabletChangeMap
*&
free_set
,
const
bool
force_alloc
=
false
,
const
uint64_t
target_id
=
0
);
// If get a free tablet set, need set tablet set type and push into queue
int
get_target_tablet_set_
(
const
DupTabletSetCommonHeader
&
target_common_header
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录