Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
ab27c671
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
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 搜索 >>
提交
ab27c671
编写于
10月 28, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
10月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix copy after start scn all sstable checker bug
上级
a5ad9230
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
51 addition
and
24 deletion
+51
-24
src/storage/high_availability/ob_storage_ha_dag.cpp
src/storage/high_availability/ob_storage_ha_dag.cpp
+1
-24
src/storage/high_availability/ob_storage_ha_reader.cpp
src/storage/high_availability/ob_storage_ha_reader.cpp
+48
-0
src/storage/high_availability/ob_storage_ha_reader.h
src/storage/high_availability/ob_storage_ha_reader.h
+2
-0
未找到文件。
src/storage/high_availability/ob_storage_ha_dag.cpp
浏览文件 @
ab27c671
...
...
@@ -648,30 +648,7 @@ int ObStorageHATaskUtils::check_minor_sstable_need_copy_(
}
if
(
OB_SUCC
(
ret
)
&&
!
found
)
{
const
int64_t
start_log_ts
=
minor_sstables
.
at
(
0
)
->
get_start_log_ts
();
const
int64_t
end_log_ts
=
minor_sstables
.
at
(
minor_sstables
.
count
()
-
1
)
->
get_end_log_ts
();
if
(
param
.
table_key_
.
log_ts_range_
.
start_log_ts_
>=
start_log_ts
&&
param
.
table_key_
.
log_ts_range_
.
end_log_ts_
<=
end_log_ts
)
{
need_copy
=
false
;
}
else
{
need_copy
=
true
;
}
}
if
(
OB_SUCC
(
ret
)
&&
!
need_copy
)
{
const
ObSSTableArray
&
minor_sstable_array
=
tablet
->
get_table_store
().
get_minor_sstables
();
bool
has_remote_logical_sstable
=
false
;
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
minor_sstable_array
.
count
();
++
i
)
{
ObITable
*
table
=
minor_sstable_array
.
get_table
(
i
);
if
(
OB_ISNULL
(
table
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"table should not be NULL"
,
K
(
ret
),
KP
(
table
));
}
else
if
(
table
->
is_remote_logical_minor_sstable
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"tablet still has remote logical minor sstable, cannot reuse local sstable"
,
K
(
ret
),
KPC
(
tablet
),
K
(
param
));
}
}
need_copy
=
true
;
}
}
return
ret
;
...
...
src/storage/high_availability/ob_storage_ha_reader.cpp
浏览文件 @
ab27c671
...
...
@@ -1455,6 +1455,7 @@ int ObCopyTabletsSSTableInfoObProducer::get_next_tablet_sstable_info(
ObCopySSTableInfoObProducer
::
ObCopySSTableInfoObProducer
()
:
is_inited_
(
false
),
ls_id_
(),
tablet_sstable_info_
(),
tablet_handle_
(),
iter_
(),
...
...
@@ -1505,6 +1506,7 @@ int ObCopySSTableInfoObProducer::init(
if
(
OB_FAIL
(
ret
))
{
}
else
{
ls_id_
=
ls
->
get_ls_id
();
tablet_sstable_info_
=
tablet_sstable_info
;
is_inited_
=
true
;
}
...
...
@@ -1674,6 +1676,15 @@ int ObCopySSTableInfoObProducer::get_copy_tablet_sstable_header(
}
else
if
(
OB_FAIL
(
get_copy_sstable_count_
(
copy_header
.
sstable_count_
)))
{
LOG_WARN
(
"failed to get copy sstable count"
,
K
(
ret
),
K
(
tablet_sstable_info_
));
}
}
else
if
(
ObCopyTabletStatus
::
TABLET_NOT_EXIST
==
status_
)
{
if
(
OB_FAIL
(
fake_deleted_tablet_meta_
(
copy_header
.
tablet_meta_
)))
{
LOG_WARN
(
"failed to fake deleted tablet meta"
,
K
(
ret
),
K
(
copy_header
));
}
else
{
copy_header
.
sstable_count_
=
0
;
}
}
else
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"copy tablet status is unexpected"
,
K
(
ret
),
K
(
status_
),
K
(
tablet_sstable_info_
));
}
}
return
ret
;
...
...
@@ -1697,6 +1708,43 @@ int ObCopySSTableInfoObProducer::get_tablet_meta_(ObMigrationTabletParam &tablet
return
ret
;
}
int
ObCopySSTableInfoObProducer
::
fake_deleted_tablet_meta_
(
ObMigrationTabletParam
&
tablet_meta
)
{
int
ret
=
OB_SUCCESS
;
tablet_meta
.
reset
();
const
ObTabletRestoreStatus
::
STATUS
restore_status
=
ObTabletRestoreStatus
::
FULL
;
const
ObTabletDataStatus
::
STATUS
data_status
=
ObTabletDataStatus
::
COMPLETE
;
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"copy sstable info ob producer do not init"
,
K
(
ret
));
}
else
{
tablet_meta
.
ls_id_
=
ls_id_
;
tablet_meta
.
tablet_id_
=
tablet_sstable_info_
.
tablet_id_
;
tablet_meta
.
data_tablet_id_
=
tablet_sstable_info_
.
tablet_id_
;
tablet_meta
.
start_scn_
=
ObTabletMeta
::
INIT_CLOG_CHECKPOINT_TS
;
tablet_meta
.
clog_checkpoint_ts_
=
INT64_MAX
;
tablet_meta
.
compat_mode_
=
lib
::
Worker
::
get_compatibility_mode
();
tablet_meta
.
multi_version_start_
=
0
;
tablet_meta
.
snapshot_version_
=
0
;
tablet_meta
.
tx_data_
.
tablet_status_
=
ObTabletStatus
::
DELETED
;
if
(
OB_FAIL
(
tablet_meta
.
ha_status_
.
set_restore_status
(
restore_status
)))
{
LOG_WARN
(
"failed to set restore status"
,
K
(
ret
),
K
(
restore_status
));
}
else
if
(
OB_FAIL
(
tablet_meta
.
ha_status_
.
set_data_status
(
data_status
)))
{
LOG_WARN
(
"failed to set data status"
,
K
(
ret
),
K
(
data_status
));
}
else
if
(
OB_FAIL
(
ObMigrationTabletParam
::
construct_placeholder_storage_schema
(
tablet_meta
.
allocator_
,
tablet_meta
.
storage_schema_
)))
{
LOG_WARN
(
"failed to construct placeholder storage schema"
);
}
else
if
(
!
tablet_meta
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"create deleted tablet meta is invalid"
,
K
(
ret
),
K
(
tablet_meta
));
}
}
return
ret
;
}
ObCopySSTableMacroObReader
::
ObCopySSTableMacroObReader
()
:
is_inited_
(
false
),
...
...
src/storage/high_availability/ob_storage_ha_reader.h
浏览文件 @
ab27c671
...
...
@@ -415,9 +415,11 @@ private:
bool
&
need_copy_sstable
);
int
get_copy_sstable_count_
(
int64_t
&
sstable_count
);
int
get_tablet_meta_
(
ObMigrationTabletParam
&
tablet_meta
);
int
fake_deleted_tablet_meta_
(
ObMigrationTabletParam
&
tablet_meta
);
private:
bool
is_inited_
;
share
::
ObLSID
ls_id_
;
obrpc
::
ObCopyTabletSSTableInfoArg
tablet_sstable_info_
;
ObTabletHandle
tablet_handle_
;
ObTableStoreIterator
iter_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录