Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
2032dc84
O
oceanbase
项目概览
clmforever
/
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 搜索 >>
提交
2032dc84
编写于
11月 25, 2022
作者:
G
godyangfight
提交者:
wangzelin.wzl
11月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix rebuild offline and online failed cannnot do backfill tx bug
上级
18e8a1e6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
7 deletion
+26
-7
src/storage/high_availability/ob_ls_migration.cpp
src/storage/high_availability/ob_ls_migration.cpp
+4
-1
src/storage/high_availability/ob_ls_prepare_migration.cpp
src/storage/high_availability/ob_ls_prepare_migration.cpp
+9
-0
src/storage/high_availability/ob_ls_rebuild_cb_impl.cpp
src/storage/high_availability/ob_ls_rebuild_cb_impl.cpp
+13
-6
未找到文件。
src/storage/high_availability/ob_ls_migration.cpp
浏览文件 @
2032dc84
...
...
@@ -1215,9 +1215,12 @@ int ObStartMigrationTask::update_ls_()
LOG_WARN
(
"failed to advance base lsn for migration"
,
K
(
ret
),
KPC
(
ctx_
));
}
else
{
ctx_
->
local_clog_checkpoint_ts_
=
ctx_
->
src_ls_meta_package_
.
ls_meta_
.
get_clog_checkpoint_ts
();
}
if
(
OB_SUCC
(
ret
))
{
ctx_
->
local_rebuild_seq_
=
ctx_
->
src_ls_meta_package_
.
ls_meta_
.
get_rebuild_seq
();
LOG_INFO
(
"update rebuild seq"
,
"old_ls_rebuld_seq"
,
ctx_
->
local_rebuild_seq_
,
"new_ls_rebuild_seq"
,
ctx_
->
src_ls_meta_package_
.
ls_meta_
.
get_rebuild_seq
(),
K
(
lbt
()));
ctx_
->
local_rebuild_seq_
=
ctx_
->
src_ls_meta_package_
.
ls_meta_
.
get_rebuild_seq
();
}
}
return
ret
;
...
...
src/storage/high_availability/ob_ls_prepare_migration.cpp
浏览文件 @
2032dc84
...
...
@@ -927,10 +927,19 @@ int ObStartPrepareMigrationTask::generate_prepare_migration_dags_()
ObBackfillTXCtx
*
backfill_tx_ctx
=
nullptr
;
ObTabletID
tablet_id
;
ObStartPrepareMigrationDag
*
start_prepare_migration_dag
=
nullptr
;
ObLSHandle
ls_handle
;
ObLS
*
ls
=
nullptr
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"start prepare migration task do not init"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObStorageHADagUtils
::
get_ls
(
ctx_
->
arg_
.
ls_id_
,
ls_handle
)))
{
LOG_WARN
(
"failed to get ls"
,
K
(
ret
),
KPC
(
ctx_
));
}
else
if
(
OB_ISNULL
(
ls
=
ls_handle
.
get_ls
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"ls should not be NULL"
,
K
(
ret
),
KP
(
ls
));
}
else
if
(
ls
->
is_offline
())
{
LOG_INFO
(
"ls is in offline status, no need generate backfill dag"
,
KPC
(
ls
));
}
else
if
(
OB_ISNULL
(
start_prepare_migration_dag
=
static_cast
<
ObStartPrepareMigrationDag
*>
(
this
->
get_dag
())))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"start prepare migration dag should not be NULL"
,
K
(
ret
),
KP
(
start_prepare_migration_dag
));
...
...
src/storage/high_availability/ob_ls_rebuild_cb_impl.cpp
浏览文件 @
2032dc84
...
...
@@ -15,6 +15,7 @@
#include "ob_storage_ha_service.h"
#include "share/ls/ob_ls_table_operator.h"
#include "observer/ob_server_event_history_table_operator.h"
#include "logservice/ob_log_service.h"
namespace
oceanbase
{
...
...
@@ -121,7 +122,6 @@ int ObLSRebuildCbImpl::check_need_rebuild_(
{
int
ret
=
OB_SUCCESS
;
ObLSInfo
ls_info
;
share
::
ObLSTableOperator
*
lst_operator
=
GCTX
.
lst_operator_
;
int64_t
cluster_id
=
GCONF
.
cluster_id
;
uint64_t
tenant_id
=
MTL_ID
();
ObAddr
leader_addr
;
...
...
@@ -131,21 +131,28 @@ int ObLSRebuildCbImpl::check_need_rebuild_(
obrpc
::
ObFetchLSMemberListInfo
member_info
;
const
bool
force_renew
=
true
;
src_info
.
cluster_id_
=
cluster_id
;
ObRole
role
;
int64_t
proposal_id
=
0
;
logservice
::
ObLogService
*
log_service
=
nullptr
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ls rebuild cb impl do not init"
,
K
(
ret
));
}
else
if
(
nullptr
==
lst_operator
)
{
}
else
if
(
OB_ISNULL
(
log_service
=
MTL
(
logservice
::
ObLogService
*
))
)
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"lst_operator ptr is null"
,
K
(
ret
));
LOG_WARN
(
"log service should not be NULL"
,
K
(
ret
),
KP
(
log_service
));
}
else
if
(
OB_FAIL
(
log_service
->
get_palf_role
(
ls_
->
get_ls_id
(),
role
,
proposal_id
)))
{
LOG_WARN
(
"failed to get role"
,
K
(
ret
),
KPC
(
ls_
));
}
else
if
(
is_strong_leader
(
role
))
{
need_rebuild
=
false
;
LOG_INFO
(
"replica is leader, can not rebuild"
,
KPC
(
ls_
));
}
else
if
(
OB_ISNULL
(
location_service
=
GCTX
.
location_service_
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"location service should not be NULL"
,
K
(
ret
),
KP
(
location_service
));
}
else
if
(
OB_FAIL
(
location_service
->
get_leader
(
src_info
.
cluster_id_
,
tenant_id
,
ls_
->
get_ls_id
(),
force_renew
,
src_info
.
src_addr_
)))
{
LOG_WARN
(
"fail to get ls leader server"
,
K
(
ret
),
K
(
tenant_id
),
KPC
(
ls_
));
}
else
if
(
src_info
.
src_addr_
==
GCONF
.
self_addr_
)
{
need_rebuild
=
false
;
LOG_INFO
(
"replica is leader, can not rebuild"
,
KPC
(
ls_
));
//for rebuild without leader exist
ret
=
OB_SUCCESS
;
}
else
if
(
OB_FAIL
(
storage_rpc_
->
post_ls_member_list_request
(
tenant_id
,
src_info
,
ls_
->
get_ls_id
(),
member_info
)))
{
LOG_WARN
(
"failed to get ls member info"
,
K
(
ret
),
KPC
(
ls_
));
}
else
if
(
!
member_info
.
member_list_
.
contains
(
GCONF
.
self_addr_
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录