Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
723d5dd8
O
oceanbase
项目概览
Metz
/
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看板
提交
723d5dd8
编写于
5月 23, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
5月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] [BUGFIX] Use backuped frozen status to restore system tables
上级
2305711c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
4 deletion
+17
-4
src/rootserver/ob_ddl_service.cpp
src/rootserver/ob_ddl_service.cpp
+8
-1
src/rootserver/restore/ob_restore_scheduler.cpp
src/rootserver/restore/ob_restore_scheduler.cpp
+2
-0
src/share/ob_rpc_struct.cpp
src/share/ob_rpc_struct.cpp
+4
-2
src/share/ob_rpc_struct.h
src/share/ob_rpc_struct.h
+3
-1
未找到文件。
src/rootserver/ob_ddl_service.cpp
浏览文件 @
723d5dd8
...
@@ -13967,6 +13967,7 @@ int ObDDLService::do_create_tenant_partitions(const ObCreateTenantArg &arg,
...
@@ -13967,6 +13967,7 @@ int ObDDLService::do_create_tenant_partitions(const ObCreateTenantArg &arg,
int64_t non_paxos_replica_num = 0;
int64_t non_paxos_replica_num = 0;
int64_t restore = REPLICA_NOT_RESTORE;
int64_t restore = REPLICA_NOT_RESTORE;
int64_t table_id = copy.get_table_id();
int64_t table_id = copy.get_table_id();
share::ObSimpleFrozenStatus new_frozen_status = frozen_status;
if (OB_FAIL(ret)) {
if (OB_FAIL(ret)) {
} else if (is_restore) { // physical restore
} else if (is_restore) { // physical restore
create_mode = OB_CREATE_TABLE_MODE_PHYSICAL_RESTORE;
create_mode = OB_CREATE_TABLE_MODE_PHYSICAL_RESTORE;
...
@@ -13977,6 +13978,12 @@ int ObDDLService::do_create_tenant_partitions(const ObCreateTenantArg &arg,
...
@@ -13977,6 +13978,12 @@ int ObDDLService::do_create_tenant_partitions(const ObCreateTenantArg &arg,
int hash_ret = restore_partition_map.get_refactored(extract_pure_id(table_id), status);
int hash_ret = restore_partition_map.get_refactored(extract_pure_id(table_id), status);
if (OB_SUCCESS == hash_ret) {
if (OB_SUCCESS == hash_ret) {
restore = status;
restore = status;
// For system tables in physical restore:
// 1. REPLICA_RESTORE_DATA: frozen_status will be overwrite by storage, so it's unuseful.
// 2. REPLICA_RESTORE_ARCHIVE_DATA: frozen_version will be overwrite so it's unuseful, but
// frozen_timestamp should come from backup info to filter clog.
// 3. REPLICA_NOT_RESTORE: frozen_status should come from restore cluster.
new_frozen_status = arg.restore_frozen_status_;
} else if (OB_HASH_NOT_EXIST == hash_ret) {
} else if (OB_HASH_NOT_EXIST == hash_ret) {
// create sys table in tenant space which were not backuped in lower version.
// create sys table in tenant space which were not backuped in lower version.
restore = REPLICA_NOT_RESTORE;
restore = REPLICA_NOT_RESTORE;
...
@@ -14008,7 +14015,7 @@ int ObDDLService::do_create_tenant_partitions(const ObCreateTenantArg &arg,
...
@@ -14008,7 +14015,7 @@ int ObDDLService::do_create_tenant_partitions(const ObCreateTenantArg &arg,
is_standby,
is_standby,
create_mode,
create_mode,
restore,
restore,
frozen_status))) {
new_
frozen_status))) {
LOG_WARN("fail to create partitions", K(ret));
LOG_WARN("fail to create partitions", K(ret));
} else {
} else {
} // no more to do
} // no more to do
src/rootserver/restore/ob_restore_scheduler.cpp
浏览文件 @
723d5dd8
...
@@ -380,6 +380,8 @@ int ObRestoreScheduler::fill_create_tenant_arg(const ObPhysicalRestoreJob &job,
...
@@ -380,6 +380,8 @@ int ObRestoreScheduler::fill_create_tenant_arg(const ObPhysicalRestoreJob &job,
arg
.
tenant_schema_
.
set_compatibility_mode
(
mode
);
arg
.
tenant_schema_
.
set_compatibility_mode
(
mode
);
arg
.
if_not_exist_
=
false
;
arg
.
if_not_exist_
=
false
;
arg
.
is_restore_
=
true
;
arg
.
is_restore_
=
true
;
arg
.
restore_frozen_status_
.
frozen_version_
=
job
.
restore_data_version_
;
arg
.
restore_frozen_status_
.
frozen_timestamp_
=
job
.
frozen_snapshot_version_
;
if
(
OB_FAIL
(
assign_pool_list
(
job
.
pool_list_
,
arg
.
pool_list_
)))
{
if
(
OB_FAIL
(
assign_pool_list
(
job
.
pool_list_
,
arg
.
pool_list_
)))
{
LOG_WARN
(
"fail to get pool list"
,
K
(
ret
),
K
(
job
));
LOG_WARN
(
"fail to get pool list"
,
K
(
ret
),
K
(
job
));
}
}
...
...
src/share/ob_rpc_struct.cpp
浏览文件 @
723d5dd8
...
@@ -481,6 +481,7 @@ int ObCreateTenantArg::assign(const ObCreateTenantArg& other)
...
@@ -481,6 +481,7 @@ int ObCreateTenantArg::assign(const ObCreateTenantArg& other)
if_not_exist_
=
other
.
if_not_exist_
;
if_not_exist_
=
other
.
if_not_exist_
;
name_case_mode_
=
other
.
name_case_mode_
;
name_case_mode_
=
other
.
name_case_mode_
;
is_restore_
=
other
.
is_restore_
;
is_restore_
=
other
.
is_restore_
;
restore_frozen_status_
=
other
.
restore_frozen_status_
;
}
}
return
ret
;
return
ret
;
}
}
...
@@ -495,12 +496,13 @@ DEF_TO_STRING(ObCreateTenantArg)
...
@@ -495,12 +496,13 @@ DEF_TO_STRING(ObCreateTenantArg)
K_
(
name_case_mode
),
K_
(
name_case_mode
),
K_
(
is_restore
),
K_
(
is_restore
),
K_
(
restore_pkeys
),
K_
(
restore_pkeys
),
K_
(
restore_log_pkeys
));
K_
(
restore_log_pkeys
),
K_
(
restore_frozen_status
));
return
pos
;
return
pos
;
}
}
OB_SERIALIZE_MEMBER
((
ObCreateTenantArg
,
ObDDLArg
),
tenant_schema_
,
pool_list_
,
if_not_exist_
,
sys_var_list_
,
OB_SERIALIZE_MEMBER
((
ObCreateTenantArg
,
ObDDLArg
),
tenant_schema_
,
pool_list_
,
if_not_exist_
,
sys_var_list_
,
name_case_mode_
,
is_restore_
,
restore_pkeys_
,
restore_log_pkeys_
);
name_case_mode_
,
is_restore_
,
restore_pkeys_
,
restore_log_pkeys_
,
restore_frozen_status_
);
bool
ObCreateTenantEndArg
::
is_valid
()
const
bool
ObCreateTenantEndArg
::
is_valid
()
const
{
{
...
...
src/share/ob_rpc_struct.h
浏览文件 @
723d5dd8
...
@@ -526,7 +526,8 @@ public:
...
@@ -526,7 +526,8 @@ public:
if_not_exist_
(
false
),
if_not_exist_
(
false
),
sys_var_list_
(),
sys_var_list_
(),
name_case_mode_
(
common
::
OB_NAME_CASE_INVALID
),
name_case_mode_
(
common
::
OB_NAME_CASE_INVALID
),
is_restore_
(
false
)
is_restore_
(
false
),
restore_frozen_status_
()
{}
{}
virtual
~
ObCreateTenantArg
(){};
virtual
~
ObCreateTenantArg
(){};
bool
is_valid
()
const
;
bool
is_valid
()
const
;
...
@@ -544,6 +545,7 @@ public:
...
@@ -544,6 +545,7 @@ public:
// is_restore = REPLICA_RESTORE_DATA
// is_restore = REPLICA_RESTORE_DATA
common
::
ObSArray
<
ObPartitionKey
>
restore_log_pkeys_
;
// For physical restore, partitions that should be created with
common
::
ObSArray
<
ObPartitionKey
>
restore_log_pkeys_
;
// For physical restore, partitions that should be created with
// is_restore = REPLICA_RESTORE_ARCHIVE_DATA
// is_restore = REPLICA_RESTORE_ARCHIVE_DATA
share
::
ObSimpleFrozenStatus
restore_frozen_status_
;
};
};
struct
ObCreateTenantEndArg
:
public
ObDDLArg
{
struct
ObCreateTenantEndArg
:
public
ObDDLArg
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录