Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天地威能
oceanbase
提交
dc28e0e5
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,体验更适合开发者的 AI 搜索 >>
提交
dc28e0e5
编写于
12月 02, 2022
作者:
J
JiahuaChen
提交者:
OB-robot
12月 02, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Stop tablet service before wait ha dag
上级
0c582ecb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
2 deletion
+44
-2
src/storage/ls/ob_ls.cpp
src/storage/ls/ob_ls.cpp
+1
-0
src/storage/ls/ob_ls_tablet_service.cpp
src/storage/ls/ob_ls_tablet_service.cpp
+41
-2
src/storage/ls/ob_ls_tablet_service.h
src/storage/ls/ob_ls_tablet_service.h
+2
-0
未找到文件。
src/storage/ls/ob_ls.cpp
浏览文件 @
dc28e0e5
...
...
@@ -442,6 +442,7 @@ int ObLS::stop_()
LOG_WARN
(
"stop log handler failed"
,
K
(
ret
),
KPC
(
this
));
}
ls_migration_handler_
.
stop
();
ls_tablet_svr_
.
stop
();
is_stopped_
=
true
;
if
(
OB_SUCC
(
ret
))
{
...
...
src/storage/ls/ob_ls_tablet_service.cpp
浏览文件 @
dc28e0e5
...
...
@@ -82,7 +82,8 @@ ObLSTabletService::ObLSTabletService()
bucket_lock_
(),
rs_reporter_
(
nullptr
),
allow_to_read_mgr_
(),
is_inited_
(
false
)
is_inited_
(
false
),
is_stopped_
(
false
)
{
}
...
...
@@ -111,6 +112,7 @@ int ObLSTabletService::init(
}
else
{
ls_
=
ls
;
rs_reporter_
=
rs_reporter
;
is_stopped_
=
false
;
is_inited_
=
true
;
}
...
...
@@ -131,9 +133,22 @@ void ObLSTabletService::destroy()
bucket_lock_
.
destroy
();
rs_reporter_
=
nullptr
;
ls_
=
nullptr
;
is_stopped_
=
false
;
is_inited_
=
false
;
}
int
ObLSTabletService
::
stop
()
{
int
ret
=
OB_SUCCESS
;
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
{
is_stopped_
=
true
;
}
return
ret
;
}
int
ObLSTabletService
::
offline
()
{
int
ret
=
OB_SUCCESS
;
...
...
@@ -1281,6 +1296,9 @@ int ObLSTabletService::update_tablet_ha_data_status(
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
is_stopped_
))
{
ret
=
OB_NOT_RUNNING
;
LOG_WARN
(
"tablet service stopped"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
!
tablet_id
.
is_valid
())
||
OB_UNLIKELY
(
!
ObTabletDataStatus
::
is_valid
(
data_status
)))
{
ret
=
OB_INVALID_ARGUMENT
;
...
...
@@ -1332,6 +1350,9 @@ int ObLSTabletService::update_tablet_ha_expected_status(
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
is_stopped_
))
{
ret
=
OB_NOT_RUNNING
;
LOG_WARN
(
"tablet service stopped"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
!
tablet_id
.
is_valid
())
||
OB_UNLIKELY
(
!
ObTabletExpectedStatus
::
is_valid
(
expected_status
)))
{
ret
=
OB_INVALID_ARGUMENT
;
...
...
@@ -2770,7 +2791,13 @@ int ObLSTabletService::trim_rebuild_tablet(
{
int
ret
=
OB_SUCCESS
;
ObBucketHashWLockGuard
lock_guard
(
bucket_lock_
,
tablet_id
.
hash
());
if
(
OB_UNLIKELY
(
!
tablet_id
.
is_valid
()))
{
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
is_stopped_
))
{
ret
=
OB_NOT_RUNNING
;
LOG_WARN
(
"tablet service stopped"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
!
tablet_id
.
is_valid
()))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
tablet_id
));
}
else
if
(
is_rollback
&&
OB_FAIL
(
rollback_rebuild_tablet
(
tablet_id
)))
{
...
...
@@ -2797,6 +2824,9 @@ int ObLSTabletService::create_or_update_migration_tablet(
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
is_stopped_
))
{
ret
=
OB_NOT_RUNNING
;
LOG_WARN
(
"tablet service stopped"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
!
mig_tablet_param
.
is_valid
())
||
OB_UNLIKELY
(
ls_id
!=
ls_
->
get_ls_id
()))
{
ret
=
OB_INVALID_ARGUMENT
;
...
...
@@ -2829,6 +2859,9 @@ int ObLSTabletService::rebuild_create_tablet(
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
is_stopped_
))
{
ret
=
OB_NOT_RUNNING
;
LOG_WARN
(
"tablet service stopped"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
!
mig_tablet_param
.
is_valid
())
||
OB_UNLIKELY
(
ls_id
!=
ls_
->
get_ls_id
()))
{
ret
=
OB_INVALID_ARGUMENT
;
...
...
@@ -2907,6 +2940,9 @@ int ObLSTabletService::finish_copy_migration_sstable(
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
is_stopped_
))
{
ret
=
OB_NOT_RUNNING
;
LOG_WARN
(
"tablet service stopped"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
!
tablet_id
.
is_valid
()
||
!
sstable_key
.
is_valid
()))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
tablet_id
),
K
(
sstable_key
));
...
...
@@ -2947,6 +2983,9 @@ int ObLSTabletService::build_ha_tablet_new_table_store(
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_UNLIKELY
(
is_stopped_
))
{
ret
=
OB_NOT_RUNNING
;
LOG_WARN
(
"tablet service stopped"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
!
tablet_id
.
is_valid
()
||
!
param
.
is_valid
()))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid args"
,
K
(
ret
),
K
(
tablet_id
),
K
(
param
));
...
...
src/storage/ls/ob_ls_tablet_service.h
浏览文件 @
dc28e0e5
...
...
@@ -104,6 +104,7 @@ public:
virtual
~
ObLSTabletService
();
public:
int
init
(
ObLS
*
ls
,
observer
::
ObIMetaReport
*
rs_reporter
);
int
stop
();
void
destroy
();
int
offline
();
int
online
();
...
...
@@ -780,6 +781,7 @@ private:
observer
::
ObIMetaReport
*
rs_reporter_
;
AllowToReadMgr
allow_to_read_mgr_
;
bool
is_inited_
;
bool
is_stopped_
;
};
inline
int64_t
ObLSTabletService
::
get_tablet_count
()
const
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录