Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
soremi
oceanbase
提交
3a4eeb57
O
oceanbase
项目概览
soremi
/
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,发现更多精彩内容 >>
提交
3a4eeb57
编写于
6月 29, 2022
作者:
G
godyangfight
提交者:
wangzelin.wzl
6月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] Fix physical restore finish can not get latest data bug
上级
a8f57540
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
1 deletion
+58
-1
src/share/backup/ob_backup_info_mgr.cpp
src/share/backup/ob_backup_info_mgr.cpp
+28
-0
src/share/backup/ob_backup_info_mgr.h
src/share/backup/ob_backup_info_mgr.h
+1
-0
src/storage/ob_partition_migrator.cpp
src/storage/ob_partition_migrator.cpp
+29
-1
未找到文件。
src/share/backup/ob_backup_info_mgr.cpp
浏览文件 @
3a4eeb57
...
...
@@ -954,6 +954,34 @@ int ObBackupInfoMgr::get_base_data_restore_schema_version(const uint64_t tenant_
return
ret
;
}
int
ObBackupInfoMgr
::
get_restore_backup_snapshot_version
(
const
uint64_t
tenant_id
,
int64_t
&
snapshot_version
)
{
int
ret
=
OB_SUCCESS
;
ObSimplePhysicalRestoreJob
simple_job_info
;
snapshot_version
=
0
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
get_restore_info_from_cache
(
tenant_id
,
simple_job_info
)))
{
if
(
OB_ENTRY_NOT_EXIST
!=
ret
)
{
LOG_WARN
(
"failed to get_restore_info_from_cache"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
OB_FAIL
(
reload
()))
{
LOG_WARN
(
"failed to reload"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
get_restore_info_from_cache
(
tenant_id
,
simple_job_info
)))
{
LOG_WARN
(
"failed to get restore info from cache again"
,
K
(
ret
),
K
(
tenant_id
));
}
}
if
(
OB_SUCC
(
ret
))
{
snapshot_version
=
simple_job_info
.
snapshot_version_
;
if
(
REACH_TIME_INTERVAL
(
OB_DEFAULT_BACKUP_LOG_INTERVAL
))
{
FLOG_INFO
(
"get_restore_info"
,
K
(
ret
),
K
(
tenant_id
),
K
(
simple_job_info
));
}
}
return
ret
;
}
ObRestoreBackupInfoUtil
::
GetRestoreBackupInfoParam
::
GetRestoreBackupInfoParam
()
:
backup_dest_
(
nullptr
),
backup_cluster_name_
(
nullptr
),
...
...
src/share/backup/ob_backup_info_mgr.h
浏览文件 @
3a4eeb57
...
...
@@ -102,6 +102,7 @@ public:
static
int
fetch_sys_log_archive_backup_info_and_piece
(
common
::
ObMySQLProxy
&
sql_proxy
,
ObLogArchiveBackupInfo
&
new_backup_info
,
ObNonFrozenBackupPieceInfo
&
new_backup_piece
);
int64_t
get_log_archive_checkpoint_interval
()
const
;
int
get_restore_backup_snapshot_version
(
const
uint64_t
tenant_id
,
int64_t
&
snapshot_version
);
private:
static
const
int64_t
DEFAULT_UPDATE_INTERVAL_US
=
10
*
1000
*
1000
;
// 10s
...
...
src/storage/ob_partition_migrator.cpp
浏览文件 @
3a4eeb57
...
...
@@ -14180,10 +14180,38 @@ int ObRestoreTailoredFinishTask::process()
LOG_WARN("failed to get all saved info", K(ret));
} else {
ObDataStorageInfo &storage_info = save_info.get_data_info();
ObBaseStorageInfo &clog_info = save_info.get_clog_info();
const int64_t publish_version = std::min(storage_info.get_publish_version(), restore_snapshot_version);
storage_info.set_publish_version(publish_version);
storage_info.set_schema_version(schema_version_);
if (OB_FAIL(partition_group->set_storage_info(save_info))) {
int16_t restore_flag = REPLICA_NOT_RESTORE;
restore_flag = partition_group->get_pg_storage().get_restore_state();
const int64_t clog_info_log_id = clog_info.get_last_replay_log_id();
const int64_t data_info_log_id = storage_info.get_last_replay_log_id();
if (REPLICA_RESTORE_CUT_DATA == restore_flag) {
int64_t backup_snapshot_version = 0;
bool is_snapshot_restore = false;
if (OB_FAIL(ObBackupInfoMgr::get_instance().get_restore_backup_snapshot_version(
pg_key.get_tenant_id(), backup_snapshot_version))) {
LOG_WARN("failed to get backup snapshot version", K(ret));
} else if (OB_FAIL(ObRestoreBackupInfoUtil::check_is_snapshot_restore(backup_snapshot_version,
ctx_->replica_op_arg_.phy_restore_arg_.restore_info_.restore_snapshot_version_,
ctx_->replica_op_arg_.phy_restore_arg_.restore_info_.cluster_version_,
is_snapshot_restore))) {
LOG_WARN("failed to check is snapshot restore", K(ret), KPC(ctx_));
} else if (is_snapshot_restore && clog_info_log_id < data_info_log_id) {
clog_info.set_last_replay_log_id(data_info_log_id);
FLOG_INFO("push clog info log id",
"orginal clog info log id",
clog_info_log_id,
"data info log id",
data_info_log_id);
}
}
if (OB_FAIL(ret)) {
} else if (OB_FAIL(partition_group->set_storage_info(save_info))) {
LOG_WARN("failed to set storage info", K(ret), K(save_info));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录