Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
e3a4db0a
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看板
提交
e3a4db0a
编写于
7月 15, 2021
作者:
O
obdev
提交者:
wangzelin.wzl
7月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 3.1 upgrade issue in old pg create/remove slog replay
上级
b9291f96
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
17 deletion
+37
-17
src/storage/ob_partition_meta_redo_module.cpp
src/storage/ob_partition_meta_redo_module.cpp
+37
-17
未找到文件。
src/storage/ob_partition_meta_redo_module.cpp
浏览文件 @
e3a4db0a
...
...
@@ -215,7 +215,7 @@ int ObPartitionMetaRedoModule::replay(const ObRedoModuleReplayParam& param)
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_REDO_LOG_PARTITION
!=
main_type
)
{
...
...
@@ -766,8 +766,22 @@ int ObPartitionMetaRedoModule::inner_del_partition_for_replay(const ObPartitionK
}
else
{
LOG_WARN
(
"fail to get partition"
,
K
(
ret
),
K
(
pkey
));
}
}
else
if
(
OB_ISNULL
(
guard
.
get_partition_group
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"partition group is null"
,
K
(
ret
),
K
(
pkey
));
}
else
if
(
OB_FAIL
(
inner_del_partition_impl
(
pkey
,
OB_INVALID_DATA_FILE_ID
==
file_id
?
nullptr
:
&
file_id
)))
{
LOG_WARN
(
"fail to inner del partition"
,
K
(
ret
));
}
else
if
(
OB_INVALID_DATA_FILE_ID
==
file_id
)
{
// replay slog before 3.1, need to remove pg from file mgr explicitly
const
ObIPartitionGroup
&
pg
=
*
guard
.
get_partition_group
();
const
ObStorageFile
*
file
=
pg
.
get_storage_file
();
if
(
OB_ISNULL
(
file
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"partition group has null file"
,
K
(
ret
),
K
(
pkey
));
}
else
if
(
OB_FAIL
(
file_mgr_
->
remove_pg
(
ObTenantFileKey
(
file
->
get_tenant_id
(),
file
->
get_file_id
()),
pkey
)))
{
LOG_WARN
(
"remove pg key from file fail"
,
K
(
ret
),
K
(
pkey
));
}
}
return
ret
;
}
...
...
@@ -821,7 +835,7 @@ int ObPartitionMetaRedoModule::replay_add_partition_slog(const ObRedoModuleRepla
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -938,7 +952,7 @@ int ObPartitionMetaRedoModule::replay_create_partition_group(const ObRedoModuleR
if
(
IS_NOT_INIT
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not inited"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -970,10 +984,16 @@ int ObPartitionMetaRedoModule::replay_create_partition_group(const ObRedoModuleR
LOG_WARN
(
"fail to open file"
,
K
(
ret
));
}
}
else
{
// replay a slog entry before 3.1, need to add pg_key to map
const
bool
sys_table
=
is_sys_table
(
log_entry
.
meta_
.
pg_key_
.
get_table_id
());
if
(
OB_FAIL
(
file_mgr_
->
alloc_file
(
log_entry
.
meta_
.
pg_key_
.
get_tenant_id
(),
sys_table
,
file_handle
,
false
/*write slog*/
)))
{
LOG_WARN
(
"fail to open pg file"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
file_mgr_
->
add_pg
(
ObTenantFileKey
(
file_handle
.
get_storage_file
()
->
get_tenant_id
(),
file_handle
.
get_storage_file
()
->
get_file_id
()),
log_entry
.
meta_
.
pg_key_
)))
{
LOG_WARN
(
"fail to add pg to tenant file"
,
K
(
ret
),
K
(
log_entry
),
"file"
,
*
file_handle
.
get_storage_file
());
}
}
if
(
OB_FAIL
(
ret
))
{
...
...
@@ -1007,7 +1027,7 @@ int ObPartitionMetaRedoModule::replay_remove_partition(const ObRedoModuleReplayP
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1063,7 +1083,7 @@ int ObPartitionMetaRedoModule::replay_replica_type(const ObRedoModuleReplayParam
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1110,7 +1130,7 @@ int ObPartitionMetaRedoModule::replay_set_split_state(const ObRedoModuleReplayPa
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1162,7 +1182,7 @@ int ObPartitionMetaRedoModule::replay_set_split_info(const ObRedoModuleReplayPar
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1271,7 +1291,7 @@ int ObPartitionMetaRedoModule::replay_drop_index_of_store(const ObRedoModuleRepl
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1325,7 +1345,7 @@ int ObPartitionMetaRedoModule::replay_update_partition_group_meta(const ObRedoMo
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1366,7 +1386,7 @@ int ObPartitionMetaRedoModule::replay_create_pg_partition_store(const ObRedoModu
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1404,7 +1424,7 @@ int ObPartitionMetaRedoModule::replay_update_pg_partition_meta(const ObRedoModul
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"partition service is not initialized"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1458,7 +1478,7 @@ int ObPartitionMetaRedoModule::replay_add_sstable(const ObRedoModuleReplayParam&
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObPartitionMetaRedoModule has not been inited"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1498,7 +1518,7 @@ int ObPartitionMetaRedoModule::replay_remove_sstable(const ObRedoModuleReplayPar
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObPartitionMetaRedoModule has not been inited"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
LOG_WARN
(
"fail to deserialize log entry"
,
K
(
ret
));
...
...
@@ -1534,7 +1554,7 @@ int ObPartitionMetaRedoModule::replay_macro_meta(const ObRedoModuleReplayParam&
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObPartitionMetaRedoModule has not been inited"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1594,7 +1614,7 @@ int ObPartitionMetaRedoModule::replay_update_tenant_file_info(const ObRedoModule
if
(
OB_ISNULL
(
file_mgr_
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"file mgr is null"
,
K
(
ret
),
KP
(
file_mgr_
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1635,7 +1655,7 @@ int ObPartitionMetaRedoModule::replay_add_recovery_point_data(const ObRedoModule
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObPartitionMetaRedoModule has not been inited"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
@@ -1672,7 +1692,7 @@ int ObPartitionMetaRedoModule::replay_remove_recovery_point_data(const ObRedoMod
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObPartitionMetaRedoModule has not been inited"
,
K
(
ret
));
}
else
if
(
!
param
.
is_valid
(
))
{
}
else
if
(
OB_UNLIKELY
(
!
param
.
is_valid
()
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
param
));
}
else
if
(
OB_FAIL
(
log_entry
.
deserialize
(
buf
,
buf_len
,
pos
)))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录