Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
11e7b073
O
oceanbase
项目概览
大炮V587
/
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 搜索 >>
提交
11e7b073
编写于
3月 17, 2023
作者:
O
oceanoverflow
提交者:
ob-robot
3月 17, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add defend for backup to check against medium info
上级
e0293389
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
56 addition
and
14 deletion
+56
-14
src/storage/backup/ob_backup_utils.cpp
src/storage/backup/ob_backup_utils.cpp
+6
-1
src/storage/backup/ob_backup_utils.h
src/storage/backup/ob_backup_utils.h
+1
-1
src/storage/compaction/ob_partition_merge_policy.cpp
src/storage/compaction/ob_partition_merge_policy.cpp
+1
-1
src/storage/high_availability/ob_storage_ha_reader.cpp
src/storage/high_availability/ob_storage_ha_reader.cpp
+4
-10
src/storage/high_availability/ob_storage_ha_reader.h
src/storage/high_availability/ob_storage_ha_reader.h
+1
-1
src/storage/high_availability/ob_tablet_group_restore.cpp
src/storage/high_availability/ob_tablet_group_restore.cpp
+22
-0
src/storage/high_availability/ob_tablet_group_restore.h
src/storage/high_availability/ob_tablet_group_restore.h
+1
-0
src/storage/tablet/ob_tablet.cpp
src/storage/tablet/ob_tablet.cpp
+17
-0
src/storage/tablet/ob_tablet.h
src/storage/tablet/ob_tablet.h
+3
-0
未找到文件。
src/storage/backup/ob_backup_utils.cpp
浏览文件 @
11e7b073
...
...
@@ -107,6 +107,11 @@ int ObBackupUtils::get_sstables_by_data_type(const storage::ObTabletHandle &tabl
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"last major sstable should not be null"
,
K
(
ret
),
K
(
tablet_handle
));
}
}
else
if
(
tablet_handle
.
get_obj
()
->
get_medium_compaction_info_list
().
get_last_compaction_scn
()
>
0
&&
tablet_handle
.
get_obj
()
->
get_medium_compaction_info_list
().
get_last_compaction_scn
()
!=
last_major_sstable_ptr
->
get_snapshot_version
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"medium list is invalid for last major sstable"
,
K
(
ret
),
"medium_list"
,
tablet_handle
.
get_obj
()
->
get_medium_compaction_info_list
(),
KPC
(
last_major_sstable_ptr
),
K
(
tablet_handle
));
}
else
if
(
OB_FAIL
(
sstable_array
.
push_back
(
last_major_sstable_ptr
)))
{
LOG_WARN
(
"failed to push back"
,
K
(
ret
),
KPC
(
last_major_sstable_ptr
));
}
...
...
@@ -1864,7 +1869,7 @@ int ObBackupTabletProvider::hold_tablet_handle_(
}
int
ObBackupTabletProvider
::
fetch_tablet_sstable_array_
(
const
common
::
ObTabletID
&
tablet_id
,
storage
::
ObTabletHandle
&
tablet_handle
,
const
share
::
ObBackupDataType
&
backup_data_type
,
const
storage
::
ObTabletHandle
&
tablet_handle
,
const
share
::
ObBackupDataType
&
backup_data_type
,
common
::
ObIArray
<
storage
::
ObITable
*>
&
sstable_array
)
{
int
ret
=
OB_SUCCESS
;
...
...
src/storage/backup/ob_backup_utils.h
浏览文件 @
11e7b073
...
...
@@ -275,7 +275,7 @@ private:
const
common
::
ObTabletID
&
tablet_id
,
share
::
ObBackupSkippedType
&
skipped_type
);
int
report_tablet_skipped_
(
const
common
::
ObTabletID
&
tablet_id
,
const
share
::
ObBackupSkippedType
&
skipped_type
);
int
hold_tablet_handle_
(
const
common
::
ObTabletID
&
tablet_id
,
storage
::
ObTabletHandle
&
tablet_handle
);
int
fetch_tablet_sstable_array_
(
const
common
::
ObTabletID
&
tablet_id
,
storage
::
ObTabletHandle
&
tablet_handle
,
int
fetch_tablet_sstable_array_
(
const
common
::
ObTabletID
&
tablet_id
,
const
storage
::
ObTabletHandle
&
tablet_handle
,
const
share
::
ObBackupDataType
&
backup_data_type
,
common
::
ObIArray
<
storage
::
ObITable
*>
&
sstable_array
);
int
prepare_tablet_logic_id_reader_
(
const
common
::
ObTabletID
&
tablet_id
,
const
storage
::
ObTabletHandle
&
tablet_handle
,
const
storage
::
ObITable
::
TableKey
&
table_key
,
const
blocksstable
::
ObSSTable
&
sstable
,
...
...
src/storage/compaction/ob_partition_merge_policy.cpp
浏览文件 @
11e7b073
...
...
@@ -1344,7 +1344,7 @@ int ObAdaptiveMergePolicy::find_meta_major_tables(
}
#ifdef ERRSIM
if
(
OB_NO_NEED_MERGE
=
ret
)
{
if
(
OB_NO_NEED_MERGE
=
=
ret
)
{
ret
=
OB_E
(
EventTable
::
EN_SCHEDULE_MEDIUM_COMPACTION
)
ret
;
if
(
OB_FAIL
(
ret
)
&&
tablet
.
get_tablet_meta
().
tablet_id_
.
id
()
>
ObTabletID
::
MIN_USER_TABLET_ID
)
{
FLOG_INFO
(
"set schedule medium with errsim"
,
"tablet_id"
,
tablet
.
get_tablet_meta
().
tablet_id_
);
...
...
src/storage/high_availability/ob_storage_ha_reader.cpp
浏览文件 @
11e7b073
...
...
@@ -1420,13 +1420,13 @@ int ObCopySSTableInfoRestoreReader::get_tablet_meta_(
LOG_WARN
(
"tablet should not be NULL"
,
K
(
ret
),
KP
(
tablet
),
K
(
tablet_id
));
}
else
if
(
OB_FAIL
(
tablet
->
build_migration_tablet_param
(
tablet_meta
)))
{
LOG_WARN
(
"failed to build migration tablet param"
,
K
(
ret
),
K
(
tablet_id
));
}
else
if
(
OB_FAIL
(
may_update_tablet_meta
_
(
tablet_id
,
tablet_handle
,
tablet_meta
)))
{
}
else
if
(
OB_FAIL
(
update_tablet_meta_if_restore_major
_
(
tablet_id
,
tablet_handle
,
tablet_meta
)))
{
LOG_WARN
(
"may update tablet meta failed"
,
K
(
ret
),
K
(
tablet_id
));
}
return
ret
;
}
int
ObCopySSTableInfoRestoreReader
::
may_update_tablet_meta
_
(
int
ObCopySSTableInfoRestoreReader
::
update_tablet_meta_if_restore_major
_
(
const
common
::
ObTabletID
&
tablet_id
,
ObTabletHandle
&
tablet_handle
,
ObMigrationTabletParam
&
tablet_meta
)
...
...
@@ -1437,14 +1437,8 @@ int ObCopySSTableInfoRestoreReader::may_update_tablet_meta_(
backup
::
ObBackupTabletMeta
backup_tablet_meta
;
if
(
OB_FAIL
(
get_backup_major_tablet_meta_
(
tablet_id
,
backup_tablet_meta
)))
{
LOG_WARN
(
"failed to get major tablet storage schema"
,
K
(
ret
),
K
(
tablet_id
));
}
else
if
(
OB_FAIL
(
compare_storage_schema_
(
tablet_id
,
tablet_handle
,
backup_tablet_meta
,
need_update_storage_schema
)))
{
LOG_WARN
(
"failed to compare storage schema"
,
K
(
ret
),
K
(
tablet_id
));
}
else
if
(
need_update_storage_schema
)
{
tablet_meta
.
storage_schema_
.
reset
();
if
(
OB_FAIL
(
tablet_meta
.
storage_schema_
.
init
(
tablet_meta
.
allocator_
,
backup_tablet_meta
.
tablet_meta_
.
storage_schema_
)))
{
LOG_WARN
(
"failed to init storage schema"
,
K
(
ret
),
K
(
tablet_meta
),
K
(
backup_tablet_meta
));
}
}
else
if
(
OB_FAIL
(
tablet_meta
.
assign
(
backup_tablet_meta
.
tablet_meta_
)))
{
LOG_WARN
(
"failed to assign tablet meta"
,
K
(
ret
),
K
(
backup_tablet_meta
));
}
}
return
ret
;
...
...
src/storage/high_availability/ob_storage_ha_reader.h
浏览文件 @
11e7b073
...
...
@@ -363,7 +363,7 @@ private:
int
get_tablet_meta_
(
const
common
::
ObTabletID
&
tablet_id
,
ObMigrationTabletParam
&
tablet_meta
);
int
may_update_tablet_meta
_
(
int
update_tablet_meta_if_restore_major
_
(
const
common
::
ObTabletID
&
tablet_id
,
ObTabletHandle
&
tablet_handle
,
ObMigrationTabletParam
&
tablet_meta
);
...
...
src/storage/high_availability/ob_tablet_group_restore.cpp
浏览文件 @
11e7b073
...
...
@@ -2714,6 +2714,8 @@ int ObTabletFinishRestoreTask::process()
LOG_WARN
(
"failed to update data status"
,
K
(
ret
),
KPC
(
tablet_restore_ctx_
));
}
else
if
(
OB_FAIL
(
update_restore_status_
()))
{
LOG_WARN
(
"failed to update restore status"
,
K
(
ret
),
KPC
(
tablet_restore_ctx_
));
}
else
if
(
OB_FAIL
(
check_tablet_valid_
()))
{
LOG_WARN
(
"failed to check tablet valid"
,
K
(
ret
),
KPC
(
tablet_restore_ctx_
));
}
if
(
OB_SUCCESS
!=
(
tmp_ret
=
record_server_event_
()))
{
...
...
@@ -2795,6 +2797,26 @@ int ObTabletFinishRestoreTask::update_restore_status_()
return
ret
;
}
int
ObTabletFinishRestoreTask
::
check_tablet_valid_
()
{
int
ret
=
OB_SUCCESS
;
ObTabletHandle
tablet_handle
;
ObTablet
*
tablet
=
nullptr
;
const
int64_t
timeout_us
=
ObTabletCommon
::
NO_CHECK_GET_TABLET_TIMEOUT_US
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"tablet finish restore task do not init"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ls_
->
get_tablet
(
tablet_restore_ctx_
->
tablet_id_
,
tablet_handle
,
timeout_us
)))
{
LOG_WARN
(
"failed to get tablet"
,
K
(
ret
),
KPC
(
tablet_restore_ctx_
),
K
(
timeout_us
));
}
else
if
(
OB_ISNULL
(
tablet
=
tablet_handle
.
get_obj
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"tablet should not be NULL"
,
K
(
ret
),
KP
(
tablet
),
KPC
(
tablet_restore_ctx_
));
}
else
if
(
OB_FAIL
(
tablet
->
check_valid
()))
{
LOG_WARN
(
"failed to check valid"
,
K
(
ret
),
KPC
(
tablet
));
}
return
ret
;
}
int
ObTabletFinishRestoreTask
::
record_server_event_
()
{
int
ret
=
OB_SUCCESS
;
...
...
src/storage/high_availability/ob_tablet_group_restore.h
浏览文件 @
11e7b073
...
...
@@ -457,6 +457,7 @@ public:
private:
int
update_data_status_
();
int
update_restore_status_
();
int
check_tablet_valid_
();
int
record_server_event_
();
private:
...
...
src/storage/tablet/ob_tablet.cpp
浏览文件 @
11e7b073
...
...
@@ -3369,5 +3369,22 @@ int ObTablet::remove_memtables_from_data_checkpoint()
return
ret
;
}
int
ObTablet
::
check_valid
()
const
{
int
ret
=
OB_SUCCESS
;
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not inited"
,
K
(
ret
),
K_
(
is_inited
));
}
else
if
(
OB_FAIL
(
check_max_sync_schema_version
()))
{
LOG_WARN
(
"fialed to check max sync schema version"
,
K
(
ret
),
KPC
(
this
));
}
else
if
(
OB_FAIL
(
check_medium_list
()))
{
LOG_WARN
(
"failed to check medium list"
,
K
(
ret
),
KPC
(
this
));
}
else
if
(
OB_FAIL
(
check_sstable_column_checksum
()))
{
LOG_WARN
(
"failed to check sstable column checksum"
,
K
(
ret
),
KPC
(
this
));
}
return
ret
;
}
}
// namespace storage
}
// namespace oceanbase
src/storage/tablet/ob_tablet.h
浏览文件 @
11e7b073
...
...
@@ -389,6 +389,9 @@ public:
const
ObMigrationTabletParam
*
tablet_meta
);
int
clear_memtables_on_table_store
();
// be careful to call this func, will destroy memtables array on table_store
int
remove_memtables_from_data_checkpoint
();
// different from the is_valid() function
// typically used for check valid for migration or restore
int
check_valid
()
const
;
TO_STRING_KV
(
KP
(
this
),
K_
(
wash_score
),
K_
(
ref_cnt
),
K_
(
tablet_meta
),
K_
(
table_store
),
K_
(
storage_schema
),
K_
(
medium_info_list
));
private:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录