Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
dd5c1dd7
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,发现更多精彩内容 >>
提交
dd5c1dd7
编写于
6月 15, 2023
作者:
M
Minionyh
提交者:
ob-robot
6月 15, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
when tablet set exist, do loop handler to submit log
上级
1b9298bf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
93 addition
and
5 deletion
+93
-5
src/storage/tx/ob_dup_table_lease.cpp
src/storage/tx/ob_dup_table_lease.cpp
+3
-3
src/storage/tx/ob_dup_table_tablets.cpp
src/storage/tx/ob_dup_table_tablets.cpp
+48
-0
src/storage/tx/ob_dup_table_tablets.h
src/storage/tx/ob_dup_table_tablets.h
+3
-0
src/storage/tx/ob_dup_table_util.cpp
src/storage/tx/ob_dup_table_util.cpp
+38
-2
src/storage/tx/ob_dup_table_util.h
src/storage/tx/ob_dup_table_util.h
+1
-0
未找到文件。
src/storage/tx/ob_dup_table_lease.cpp
浏览文件 @
dd5c1dd7
...
...
@@ -952,9 +952,9 @@ int ObDupTableLSLeaseMgr::LeaderLeaseMgrStatFunctor::operator()(
}
// update cnt_ for next read
cnt_
++
;
DUP_TABLE_LOG
(
DEBUG
,
"insert one row in svr list"
,
K
(
ret
),
K
(
tmp_stat
),
K
(
cnt_
),
K
(
hash_pair
.
second
.
confirmed_lease_info_
),
K
(
collect_arr_
));
// for debug
DUP_TABLE_LOG
(
INFO
,
"insert one row in svr list"
,
K
(
ret
),
K
(
tmp_stat
),
K
(
cnt_
),
K
(
hash_pair
.
second
),
K
(
collect_arr_
));
}
return
ret
;
...
...
src/storage/tx/ob_dup_table_tablets.cpp
浏览文件 @
dd5c1dd7
...
...
@@ -1237,6 +1237,16 @@ int64_t ObLSDupTabletsMgr::get_readable_tablet_set_count()
return
cnt
;
}
int64_t
ObLSDupTabletsMgr
::
get_need_confirm_tablet_set_count
()
{
int64_t
cnt
=
0
;
SpinRLockGuard
guard
(
dup_tablets_lock_
);
cnt
=
need_confirm_new_queue_
.
get_size
();
return
cnt
;
}
int64_t
ObLSDupTabletsMgr
::
get_all_tablet_set_count
()
{
int64_t
cnt
=
0
;
...
...
@@ -1256,6 +1266,44 @@ int64_t ObLSDupTabletsMgr::get_all_tablet_set_count()
return
cnt
;
}
// check exist tablet or is logging
bool
ObLSDupTabletsMgr
::
check_removing_tablet_exist
()
{
bool
bool_ret
=
false
;
SpinRLockGuard
guard
(
dup_tablets_lock_
);
if
(
OB_ISNULL
(
removing_old_set_
))
{
bool_ret
=
false
;
}
else
if
(
removing_old_set_
->
size
()
>
0
)
{
bool_ret
=
true
;
}
else
if
(
removing_old_set_
->
get_change_status
()
->
is_modifiable
()){
bool_ret
=
true
;
}
else
{
bool_ret
=
false
;
}
return
bool_ret
;
}
// check exist tablet or is logging
bool
ObLSDupTabletsMgr
::
check_changing_new_tablet_exist
()
{
bool
bool_ret
=
false
;
SpinRLockGuard
guard
(
dup_tablets_lock_
);
if
(
OB_ISNULL
(
changing_new_set_
))
{
bool_ret
=
false
;
}
else
if
(
changing_new_set_
->
size
()
>
0
)
{
bool_ret
=
true
;
}
else
if
(
changing_new_set_
->
get_change_status
()
->
is_modifiable
())
{
bool_ret
=
true
;
}
else
{
bool_ret
=
false
;
}
return
bool_ret
;
}
int
ObLSDupTabletsMgr
::
leader_takeover
(
const
bool
is_resume
,
const
bool
recover_all_readable_from_ckpt
)
{
...
...
src/storage/tx/ob_dup_table_tablets.h
浏览文件 @
dd5c1dd7
...
...
@@ -550,6 +550,9 @@ public:
int64_t
get_dup_tablet_count
();
bool
has_dup_tablet
();
int64_t
get_readable_tablet_set_count
();
int64_t
get_need_confirm_tablet_set_count
();
bool
check_removing_tablet_exist
();
bool
check_changing_new_tablet_exist
();
int64_t
get_all_tablet_set_count
();
int
leader_takeover
(
const
bool
is_resume
,
const
bool
recover_all_readable_from_ckpt
);
...
...
src/storage/tx/ob_dup_table_util.cpp
浏览文件 @
dd5c1dd7
...
...
@@ -657,6 +657,7 @@ int ObDupTableLSHandler::ls_loop_handle()
{
int
ret
=
OB_SUCCESS
;
int
tmp_ret
=
OB_SUCCESS
;
// TODO check stopped
if
(
!
is_inited
()
||
OB_ISNULL
(
lease_mgr_ptr_
)
||
OB_ISNULL
(
tablets_mgr_ptr_
)
||
OB_ISNULL
(
ts_sync_mgr_ptr_
))
{
ret
=
OB_NOT_INIT
;
...
...
@@ -664,9 +665,13 @@ int ObDupTableLSHandler::ls_loop_handle()
}
else
if
(
!
ls_state_helper_
.
is_active_ls
())
{
ret
=
OB_LS_OFFLINE
;
DUP_TABLE_LOG
(
WARN
,
"the ls is not active"
,
K
(
ret
),
KPC
(
this
));
}
else
if
(
!
has_dup_tablet
())
{
}
else
if
(
!
check_tablet_set_exist
())
{
// if tablet set not exist,
// return OB_NO_TABLET and remove ls id form map
// else do ls loop handle
ret
=
OB_NO_TABLET
;
DUP_TABLE_LOG
(
INFO
,
"no dup tablet, no need to do loop worker"
,
K
(
ret
),
KPC
(
tablets_mgr_ptr_
));
DUP_TABLE_LOG
(
INFO
,
"no dup tablet, no need to do loop worker"
,
K
(
ret
),
KPC
(
tablets_mgr_ptr_
));
}
else
{
if
(
ls_state_helper_
.
is_leader
())
{
if
(
OB_ISNULL
(
log_operator_
)
||
!
log_operator_
->
is_busy
())
{
...
...
@@ -1104,6 +1109,37 @@ bool ObDupTableLSHandler::has_dup_tablet()
return
has_dup
;
}
// if return false, there are no tablets and tablet set need log
bool
ObDupTableLSHandler
::
check_tablet_set_exist
()
{
bool
bool_ret
=
false
;
if
(
OB_ISNULL
(
tablets_mgr_ptr_
))
{
bool_ret
=
false
;
}
else
{
int64_t
readable_and_need_confirm_set_count
=
tablets_mgr_ptr_
->
get_readable_tablet_set_count
()
+
tablets_mgr_ptr_
->
get_need_confirm_tablet_set_count
();
// if readable and need confirm set count > 0, return true
if
(
readable_and_need_confirm_set_count
>
0
)
{
bool_ret
=
true
;
}
else
{
// if changing new and removing set exist return true
bool
chaning_and_removing_tablet_exist
=
tablets_mgr_ptr_
->
check_changing_new_tablet_exist
()
||
tablets_mgr_ptr_
->
check_removing_tablet_exist
();
if
(
chaning_and_removing_tablet_exist
)
{
bool_ret
=
true
;
}
else
{
bool_ret
=
false
;
}
}
}
return
bool_ret
;
}
int
ObDupTableLSHandler
::
get_local_ts_info
(
DupTableTsInfo
&
ts_info
)
{
int
ret
=
OB_SUCCESS
;
...
...
src/storage/tx/ob_dup_table_util.h
浏览文件 @
dd5c1dd7
...
...
@@ -179,6 +179,7 @@ public:
public:
int64_t
get_dup_tablet_count
();
bool
check_tablet_set_exist
();
bool
has_dup_tablet
();
int
gc_dup_tablets
(
const
int64_t
gc_ts
,
const
int64_t
max_task_interval
);
int
get_local_ts_info
(
DupTableTsInfo
&
ts_info
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录