Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
9cdc3091
O
oceanbase
项目概览
oceanbase
/
oceanbase
2 年多 前同步成功
通知
262
Star
6084
Fork
1301
代码
文件
提交
分支
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看板
提交
9cdc3091
编写于
11月 12, 2025
作者:
Y
yeqiyi
提交者:
ob-robot
11月 12, 2025
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[chore] 将剩余的transfer_seq(or transfer_epoch)更名为private_transfer_epoch
上级
2c5f4dc3
变更
75
展开全部
隐藏空白更改
内联
并排
Showing
75 changed file
with
501 addition
and
501 deletion
+501
-501
mittest/mtlenv/storage/test_tablet_block_id_list.cpp
mittest/mtlenv/storage/test_tablet_block_id_list.cpp
+9
-9
mittest/shared_storage/simple_server/test_macro_cache_evict.cpp
...t/shared_storage/simple_server/test_macro_cache_evict.cpp
+6
-6
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_calibrate.cpp
..._storage/ss_macro_cache/test_ss_macro_cache_calibrate.cpp
+9
-9
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_evict_task.cpp
...storage/ss_macro_cache/test_ss_macro_cache_evict_task.cpp
+2
-2
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_meta_expired.cpp
...orage/ss_macro_cache/test_ss_macro_cache_meta_expired.cpp
+1
-1
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_mgr.cpp
...shared_storage/ss_macro_cache/test_ss_macro_cache_mgr.cpp
+9
-9
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_preread_map_clear.cpp
.../ss_macro_cache/test_ss_macro_cache_preread_map_clear.cpp
+6
-6
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_replay.cpp
...red_storage/ss_macro_cache/test_ss_macro_cache_replay.cpp
+3
-3
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_stat.cpp
...hared_storage/ss_macro_cache/test_ss_macro_cache_stat.cpp
+2
-2
mittest/shared_storage/ss_macro_cache/test_ss_write_cache_ctrl_task.cpp
..._storage/ss_macro_cache/test_ss_write_cache_ctrl_task.cpp
+2
-2
mittest/shared_storage/ss_micro_cache/test_ss_micro_cache.cpp
...est/shared_storage/ss_micro_cache/test_ss_micro_cache.cpp
+2
-2
mittest/shared_storage/test_file_manager.cpp
mittest/shared_storage/test_file_manager.cpp
+24
-24
mittest/shared_storage/test_open_close.cpp
mittest/shared_storage/test_open_close.cpp
+4
-4
mittest/shared_storage/test_ss_fd_cache_perf.cpp
mittest/shared_storage/test_ss_fd_cache_perf.cpp
+3
-3
mittest/shared_storage/test_ss_la_micro_key_manager.cpp
mittest/shared_storage/test_ss_la_micro_key_manager.cpp
+1
-1
mittest/shared_storage/test_ss_object_access_util.cpp
mittest/shared_storage/test_ss_object_access_util.cpp
+2
-2
mittest/shared_storage/test_ss_reader_writer.cpp
mittest/shared_storage/test_ss_reader_writer.cpp
+17
-17
src/storage/backup/ob_backup_index_block_builder_mgr.cpp
src/storage/backup/ob_backup_index_block_builder_mgr.cpp
+5
-5
src/storage/blocksstable/index_block/ob_index_block_builder.cpp
...orage/blocksstable/index_block/ob_index_block_builder.cpp
+2
-2
src/storage/blocksstable/index_block/ob_index_block_builder.h
...storage/blocksstable/index_block/ob_index_block_builder.h
+1
-1
src/storage/blocksstable/ob_macro_block_id.cpp
src/storage/blocksstable/ob_macro_block_id.cpp
+2
-2
src/storage/blocksstable/ob_macro_block_id.h
src/storage/blocksstable/ob_macro_block_id.h
+8
-8
src/storage/blocksstable/ob_macro_block_id_register.h
src/storage/blocksstable/ob_macro_block_id_register.h
+23
-23
src/storage/blocksstable/ob_object_manager.h
src/storage/blocksstable/ob_object_manager.h
+3
-3
src/storage/blocksstable/ob_shared_macro_block_manager.cpp
src/storage/blocksstable/ob_shared_macro_block_manager.cpp
+5
-5
src/storage/blocksstable/ob_storage_object_type.cpp
src/storage/blocksstable/ob_storage_object_type.cpp
+52
-52
src/storage/blocksstable/ob_storage_object_type_def.py
src/storage/blocksstable/ob_storage_object_type_def.py
+52
-52
src/storage/column_store/ob_co_merge_dag.cpp
src/storage/column_store/ob_co_merge_dag.cpp
+3
-3
src/storage/compaction/ob_basic_tablet_merge_ctx.cpp
src/storage/compaction/ob_basic_tablet_merge_ctx.cpp
+9
-9
src/storage/compaction/ob_basic_tablet_merge_ctx.h
src/storage/compaction/ob_basic_tablet_merge_ctx.h
+1
-1
src/storage/compaction/ob_partition_merge_policy.cpp
src/storage/compaction/ob_partition_merge_policy.cpp
+7
-7
src/storage/compaction/ob_schedule_dag_func.cpp
src/storage/compaction/ob_schedule_dag_func.cpp
+4
-4
src/storage/compaction/ob_tablet_merge_task.cpp
src/storage/compaction/ob_tablet_merge_task.cpp
+6
-6
src/storage/compaction/ob_tablet_merge_task.h
src/storage/compaction/ob_tablet_merge_task.h
+3
-3
src/storage/compaction/ob_tenant_tablet_scheduler.cpp
src/storage/compaction/ob_tenant_tablet_scheduler.cpp
+6
-6
src/storage/ddl/ob_ddl_merge_task.cpp
src/storage/ddl/ob_ddl_merge_task.cpp
+8
-8
src/storage/ddl/ob_ddl_replay_executor.cpp
src/storage/ddl/ob_ddl_replay_executor.cpp
+8
-8
src/storage/ddl/ob_direct_insert_sstable_ctx_new.cpp
src/storage/ddl/ob_direct_insert_sstable_ctx_new.cpp
+1
-1
src/storage/ddl/ob_direct_load_struct.h
src/storage/ddl/ob_direct_load_struct.h
+2
-2
src/storage/ddl/ob_tablet_lob_split_task.cpp
src/storage/ddl/ob_tablet_lob_split_task.cpp
+4
-4
src/storage/ddl/ob_tablet_split_task.cpp
src/storage/ddl/ob_tablet_split_task.cpp
+8
-8
src/storage/ddl/ob_tablet_split_util.cpp
src/storage/ddl/ob_tablet_split_util.cpp
+5
-5
src/storage/high_availability/ob_sstable_copy_finish_task.cpp
...storage/high_availability/ob_sstable_copy_finish_task.cpp
+4
-4
src/storage/high_availability/ob_storage_ha_macro_block_writer.cpp
...ge/high_availability/ob_storage_ha_macro_block_writer.cpp
+4
-4
src/storage/high_availability/ob_tablet_backfill_tx.cpp
src/storage/high_availability/ob_tablet_backfill_tx.cpp
+2
-2
src/storage/high_availability/ob_tablet_transfer_info.cpp
src/storage/high_availability/ob_tablet_transfer_info.cpp
+7
-7
src/storage/high_availability/ob_tablet_transfer_info.h
src/storage/high_availability/ob_tablet_transfer_info.h
+3
-3
src/storage/ls/ob_ls_tablet_service.cpp
src/storage/ls/ob_ls_tablet_service.cpp
+13
-13
src/storage/meta_mem/ob_tablet_handle.cpp
src/storage/meta_mem/ob_tablet_handle.cpp
+5
-5
src/storage/meta_mem/ob_tablet_map_key.cpp
src/storage/meta_mem/ob_tablet_map_key.cpp
+7
-7
src/storage/meta_mem/ob_tablet_map_key.h
src/storage/meta_mem/ob_tablet_map_key.h
+7
-7
src/storage/meta_mem/ob_tablet_pointer.cpp
src/storage/meta_mem/ob_tablet_pointer.cpp
+4
-4
src/storage/meta_mem/ob_tablet_pointer_map.cpp
src/storage/meta_mem/ob_tablet_pointer_map.cpp
+8
-8
src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp
src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp
+22
-22
src/storage/meta_mem/ob_tenant_meta_mem_mgr.h
src/storage/meta_mem/ob_tenant_meta_mem_mgr.h
+4
-4
src/storage/meta_store/ob_storage_meta_io_util.cpp
src/storage/meta_store/ob_storage_meta_io_util.cpp
+6
-6
src/storage/meta_store/ob_storage_meta_io_util.h
src/storage/meta_store/ob_storage_meta_io_util.h
+1
-1
src/storage/meta_store/ob_tenant_storage_meta_service.cpp
src/storage/meta_store/ob_tenant_storage_meta_service.cpp
+11
-11
src/storage/meta_store/ob_tenant_storage_meta_service.h
src/storage/meta_store/ob_tenant_storage_meta_service.h
+1
-1
src/storage/multi_data_source/ob_mds_table_merge_task.cpp
src/storage/multi_data_source/ob_mds_table_merge_task.cpp
+1
-1
src/storage/multi_data_source/ob_tablet_mds_merge_ctx.cpp
src/storage/multi_data_source/ob_tablet_mds_merge_ctx.cpp
+1
-1
src/storage/ob_super_block_struct.cpp
src/storage/ob_super_block_struct.cpp
+1
-1
src/storage/ob_super_block_struct.h
src/storage/ob_super_block_struct.h
+8
-8
src/storage/slog/ob_storage_log.cpp
src/storage/slog/ob_storage_log.cpp
+17
-17
src/storage/slog/ob_storage_log.h
src/storage/slog/ob_storage_log.h
+4
-4
src/storage/slog_ckpt/ob_linked_macro_block_struct.cpp
src/storage/slog_ckpt/ob_linked_macro_block_struct.cpp
+3
-3
src/storage/slog_ckpt/ob_linked_macro_block_struct.h
src/storage/slog_ckpt/ob_linked_macro_block_struct.h
+3
-3
src/storage/slog_ckpt/ob_linked_macro_block_writer.cpp
src/storage/slog_ckpt/ob_linked_macro_block_writer.cpp
+1
-1
src/storage/slog_ckpt/ob_tenant_slog_checkpoint_util.cpp
src/storage/slog_ckpt/ob_tenant_slog_checkpoint_util.cpp
+1
-1
src/storage/slog_ckpt/ob_tenant_storage_snapshot_writer.cpp
src/storage/slog_ckpt/ob_tenant_storage_snapshot_writer.cpp
+1
-1
src/storage/tablet/ob_tablet.cpp
src/storage/tablet/ob_tablet.cpp
+11
-11
src/storage/tablet/ob_tablet.h
src/storage/tablet/ob_tablet.h
+2
-2
src/storage/tablet/ob_tablet_mds_table_mini_merger.cpp
src/storage/tablet/ob_tablet_mds_table_mini_merger.cpp
+1
-1
unittest/storage/blocksstable/test_macro_block_id.cpp
unittest/storage/blocksstable/test_macro_block_id.cpp
+4
-4
unittest/storage/blocksstable/test_sstable_meta.cpp
unittest/storage/blocksstable/test_sstable_meta.cpp
+3
-3
未找到文件。
mittest/mtlenv/storage/test_tablet_block_id_list.cpp
浏览文件 @
9cdc3091
...
...
@@ -76,7 +76,7 @@ TEST_F(TestBlockIdList, test_id_list)
ObLinkedMacroInfoWriteParam
write_param
;
write_param
.
type_
=
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
;
write_param
.
tablet_id_
=
ObTabletID
(
1001
);
write_param
.
tablet_transfer_epoch_
=
1
;
write_param
.
tablet_
private_
transfer_epoch_
=
1
;
write_param
.
start_macro_seq_
=
1
;
// empty set
ASSERT_EQ
(
OB_SUCCESS
,
info_set
.
init
());
...
...
@@ -131,7 +131,7 @@ TEST_F(TestBlockIdList, test_serialize_deep_copy)
ObLinkedMacroInfoWriteParam
write_param
;
write_param
.
type_
=
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
;
write_param
.
tablet_id_
=
ObTabletID
(
1001
);
write_param
.
tablet_transfer_epoch_
=
1
;
write_param
.
tablet_
private_
transfer_epoch_
=
1
;
write_param
.
start_macro_seq_
=
1
;
ASSERT_EQ
(
OB_SUCCESS
,
info_set
.
init
());
ASSERT_EQ
(
OB_SUCCESS
,
linked_writer
.
init_for_macro_info
(
write_param
));
...
...
@@ -234,10 +234,10 @@ TEST_F(TestBlockIdList, test_meta_macro_ref_cnt)
// persist 4k tablet
const
uint64_t
data_version
=
DATA_CURRENT_VERSION
;
int32_t
transfer_epoch
=
-
1
;
ASSERT_EQ
(
OB_SUCCESS
,
tablet
->
get_private_transfer_epoch
(
transfer_epoch
));
int32_t
private_
transfer_epoch
=
-
1
;
ASSERT_EQ
(
OB_SUCCESS
,
tablet
->
get_private_transfer_epoch
(
private_
transfer_epoch
));
const
int64_t
tablet_meta_version
=
0
;
const
ObTabletPersisterParam
param
(
data_version
,
ls_id
,
ls_handle
.
get_ls
()
->
get_ls_epoch
(),
tablet_id
,
transfer_epoch
,
tablet_meta_version
);
const
ObTabletPersisterParam
param
(
data_version
,
ls_id
,
ls_handle
.
get_ls
()
->
get_ls_epoch
(),
tablet_id
,
private_
transfer_epoch
,
tablet_meta_version
);
ObTenantStorageMetaService
*
meta_service
=
MTL
(
ObTenantStorageMetaService
*
);
ASSERT_EQ
(
OB_SUCCESS
,
meta_service
->
get_shared_object_reader_writer
().
switch_object
(
object_handle
,
default_opt
));
ASSERT_EQ
(
OB_SUCCESS
,
ObTabletPersister
::
persist_and_transform_tablet
(
param
,
*
tablet
,
new_tablet_handle
));
...
...
@@ -276,7 +276,7 @@ TEST_F(TestBlockIdList, test_info_iterator)
ObLinkedMacroInfoWriteParam
write_param
;
write_param
.
type_
=
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
;
write_param
.
tablet_id_
=
ObTabletID
(
1001
);
write_param
.
tablet_transfer_epoch_
=
1
;
write_param
.
tablet_
private_
transfer_epoch_
=
1
;
write_param
.
start_macro_seq_
=
1
;
// linked macro info
...
...
@@ -436,10 +436,10 @@ TEST_F(TestBlockIdList, test_empty_shell_macro_ref_cnt)
ObBlockManager
::
BlockInfo
block_info
;
int64_t
ref_cnt
=
0
;
ObTabletHandle
new_tablet_handle
;
int32_t
transfer_epoch
=
-
1
;
ASSERT_EQ
(
OB_SUCCESS
,
tablet
->
get_private_transfer_epoch
(
transfer_epoch
));
int32_t
private_
transfer_epoch
=
-
1
;
ASSERT_EQ
(
OB_SUCCESS
,
tablet
->
get_private_transfer_epoch
(
private_
transfer_epoch
));
const
int64_t
tablet_meta_version
=
0
;
const
ObTabletPersisterParam
param
(
data_version
,
ls_id
,
ls_handle
.
get_ls
()
->
get_ls_epoch
(),
tablet_id
,
transfer_epoch
,
tablet_meta_version
);
const
ObTabletPersisterParam
param
(
data_version
,
ls_id
,
ls_handle
.
get_ls
()
->
get_ls_epoch
(),
tablet_id
,
private_
transfer_epoch
,
tablet_meta_version
);
ASSERT_EQ
(
OB_SUCCESS
,
ObTabletPersister
::
persist_and_transform_tablet
(
param
,
*
tablet
,
new_tablet_handle
));
ObTablet
*
new_tablet
=
new_tablet_handle
.
get_obj
();
ASSERT_EQ
(
OB_SUCCESS
,
new_tablet
->
tablet_addr_
.
get_block_addr
(
macro_id
,
offset
,
size
));
...
...
mittest/shared_storage/simple_server/test_macro_cache_evict.cpp
浏览文件 @
9cdc3091
...
...
@@ -397,7 +397,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
MACRO_BLOCK_TABLET_ID
);
// tablet_id
macro_id
.
set_third_id
(
MACRO_BLOCK_SERVER_ID
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
write_info_
.
set_effective_tablet_id
(
MACRO_BLOCK_TABLET_ID
);
// effective_tablet_id
break
;
...
...
@@ -406,7 +406,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
META_FILE_LS_ID
);
// ls_id
macro_id
.
set_third_id
(
META_FILE_TABLET_ID
);
// tablet_id
macro_id
.
set_meta_transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_
private_
transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_version_id
(
i
);
// meta_version_id
write_info_
.
set_ls_epoch_id
(
META_FILE_LS_EPOCH_ID
);
// ls_epoch_id
break
;
...
...
@@ -425,7 +425,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
HOT_TABLET_TABLET_ID
);
macro_id
.
set_third_id
(
HOT_TABLET_SERVER_ID
);
macro_id
.
set_macro_transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
write_info_
.
set_effective_tablet_id
(
HOT_TABLET_TABLET_ID
);
// effective_tablet_id
break
;
...
...
@@ -463,7 +463,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
MACRO_BLOCK_TABLET_ID
);
// tablet_id
macro_id
.
set_third_id
(
MACRO_BLOCK_SERVER_ID
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
j
);
// tenant_seq
break
;
case
ObSSMacroCacheType
::
META_FILE
:
...
...
@@ -471,7 +471,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
META_FILE_LS_ID
);
// ls_id
macro_id
.
set_third_id
(
META_FILE_TABLET_ID
);
// tablet_id
macro_id
.
set_meta_transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_
private_
transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_version_id
(
j
);
// meta_version_id
ls_epoch_id
=
META_FILE_LS_EPOCH_ID
;
break
;
...
...
@@ -486,7 +486,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
HOT_TABLET_TABLET_ID
);
macro_id
.
set_third_id
(
HOT_TABLET_SERVER_ID
);
macro_id
.
set_macro_transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
j
);
// tenant_seq
break
;
default:
...
...
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_calibrate.cpp
浏览文件 @
9cdc3091
...
...
@@ -114,7 +114,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
MACRO_BLOCK_TABLET_ID
);
//tablet_id
macro_id
.
set_third_id
(
MACRO_BLOCK_SERVER_ID
);
//server_id
macro_id
.
set_macro_transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
case
ObSSMacroCacheType
::
META_FILE
:
...
...
@@ -122,7 +122,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
META_FILE_LS_ID
);
// ls_id
macro_id
.
set_third_id
(
META_FILE_TABLET_ID
);
// tablet_id
macro_id
.
set_meta_transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_
private_
transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_version_id
(
i
);
// meta_version_id
break
;
case
ObSSMacroCacheType
::
TMP_FILE
:
...
...
@@ -136,7 +136,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
HOT_TABLET_TABLET_ID
);
macro_id
.
set_third_id
(
HOT_TABLET_SERVER_ID
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
default:
...
...
@@ -159,7 +159,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
MACRO_BLOCK_TABLET_ID
);
macro_id
.
set_third_id
(
MACRO_BLOCK_SERVER_ID
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
j
);
// tenant_seq
break
;
case
ObSSMacroCacheType
::
META_FILE
:
...
...
@@ -167,7 +167,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
META_FILE_LS_ID
);
// ls_id
macro_id
.
set_third_id
(
META_FILE_TABLET_ID
);
// tablet_id
macro_id
.
set_meta_transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_
private_
transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_version_id
(
j
);
// meta_version_id
ls_epoch_id
=
META_FILE_LS_EPOCH_ID
;
break
;
...
...
@@ -182,7 +182,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
HOT_TABLET_TABLET_ID
);
macro_id
.
set_third_id
(
HOT_TABLET_SERVER_ID
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
j
);
// tenant_seq
break
;
default:
...
...
@@ -211,7 +211,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
//tablet_id
macro_id
.
set_third_id
(
MACRO_BLOCK_SERVER_ID
);
//server_id
macro_id
.
set_macro_transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
case
ObSSMacroCacheType
::
META_FILE
:
...
...
@@ -220,7 +220,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
META_FILE_LS_ID
);
// ls_id
macro_id
.
set_third_id
(
tablet_id
);
// tablet_id
macro_id
.
set_meta_transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_
private_
transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_version_id
(
i
);
// meta_version_id
write_info_
.
set_ls_epoch_id
(
META_FILE_LS_EPOCH_ID
);
// ls_epoch_id
break
;
...
...
@@ -240,7 +240,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
HOT_TABLET_SERVER_ID
);
//server_id
macro_id
.
set_macro_transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
default:
...
...
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_evict_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -280,7 +280,7 @@ TEST_F(TestSSMacroCacheEvictTask, evict_other_write_cache)
uint64_t
tablet_id
=
100
;
uint64_t
server_id
=
1
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
// 1. write PRIVATE_DATA_MACRO to local cache
MacroBlockId
macro_id
;
...
...
@@ -288,7 +288,7 @@ TEST_F(TestSSMacroCacheEvictTask, evict_other_write_cache)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
100
);
// seq_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
server_id
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_meta_expired.cpp
浏览文件 @
9cdc3091
...
...
@@ -99,7 +99,7 @@ void ObMetaMacroExpirationTest::write_data_meta_macro(ObMacroType macro_type, Ma
}
macro_id
.
set_second_id
(
TABLET_ID
);
// tablet_id
macro_id
.
set_third_id
(
SERVER_ID
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
0
);
// tenant_seq
write_info_
.
set_effective_tablet_id
(
TABLET_ID
);
// effective_tablet_id
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_mgr.cpp
浏览文件 @
9cdc3091
...
...
@@ -115,7 +115,7 @@ TEST_F(TestSSMacroCacheMgr, put_update_erase)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
@@ -163,7 +163,7 @@ TEST_F(TestSSMacroCacheMgr, put_or_update_and_batch_update)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
@@ -190,7 +190,7 @@ TEST_F(TestSSMacroCacheMgr, put_or_update_and_batch_update)
macro_id_2
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id_2
.
set_second_id
(
tablet_id
);
macro_id_2
.
set_third_id
(
server_id
);
macro_id_2
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id_2
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id_2
.
set_tenant_seq
(
101
);
// tenant_seq
ASSERT_TRUE
(
macro_id_2
.
is_valid
());
...
...
@@ -246,7 +246,7 @@ TEST_F(TestSSMacroCacheMgr, update_effective_tablet_id_by_get)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
@@ -306,7 +306,7 @@ TEST_F(TestSSMacroCacheMgr, shift_lru_list)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
@@ -388,7 +388,7 @@ TEST_F(TestSSMacroCacheMgr, update_lru_list)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
@@ -397,7 +397,7 @@ TEST_F(TestSSMacroCacheMgr, update_lru_list)
macro_id_2
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id_2
.
set_second_id
(
tablet_id
);
macro_id_2
.
set_third_id
(
server_id
);
macro_id_2
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id_2
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id_2
.
set_tenant_seq
(
101
);
// tenant_seq
ASSERT_TRUE
(
macro_id_2
.
is_valid
());
...
...
@@ -470,7 +470,7 @@ TEST_F(TestSSMacroCacheMgr, force_evict_by_macro_id_write_cache)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
@@ -510,7 +510,7 @@ TEST_F(TestSSMacroCacheMgr, clear_macro_cache)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_preread_map_clear.cpp
浏览文件 @
9cdc3091
...
...
@@ -75,7 +75,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
MACRO_BLOCK_TABLET_ID
);
//tablet_id
macro_id
.
set_third_id
(
MACRO_BLOCK_SERVER_ID
);
//server_id
macro_id
.
set_macro_transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
case
ObSSMacroCacheType
::
META_FILE
:
...
...
@@ -83,7 +83,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
META_FILE_LS_ID
);
// ls_id
macro_id
.
set_third_id
(
META_FILE_TABLET_ID
);
// tablet_id
macro_id
.
set_meta_transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_
private_
transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_version_id
(
i
);
// meta_version_id
break
;
case
ObSSMacroCacheType
::
TMP_FILE
:
...
...
@@ -97,7 +97,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
HOT_TABLET_TABLET_ID
);
macro_id
.
set_third_id
(
HOT_TABLET_SERVER_ID
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
default:
...
...
@@ -122,7 +122,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
//tablet_id
macro_id
.
set_third_id
(
MACRO_BLOCK_SERVER_ID
);
//server_id
macro_id
.
set_macro_transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
MACRO_BLOCK_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
case
ObSSMacroCacheType
::
META_FILE
:
...
...
@@ -131,7 +131,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
META_FILE_LS_ID
);
// ls_id
macro_id
.
set_third_id
(
tablet_id
);
// tablet_id
macro_id
.
set_meta_transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_
private_
transfer_epoch
(
META_FILE_TRANSFER_SEQ
);
//transfer_seq
macro_id
.
set_meta_version_id
(
i
);
// meta_version_id
break
;
case
ObSSMacroCacheType
::
TMP_FILE
:
...
...
@@ -146,7 +146,7 @@ public:
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
HOT_TABLET_SERVER_ID
);
//server_id
macro_id
.
set_macro_transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
HOT_TABLET_TRANSFER_SEQ
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
// tenant_seq
break
;
default:
...
...
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_replay.cpp
浏览文件 @
9cdc3091
...
...
@@ -179,7 +179,7 @@ TEST_F(TestSSMacroCacheReplay, replay_in_background)
local_private_macro_macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
local_private_macro_macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
local_private_macro_macro_id
.
set_third_id
(
1
);
// server_id
local_private_macro_macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
local_private_macro_macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
local_private_macro_macro_id
.
set_tenant_seq
(
100
);
//tenant_seq
ASSERT_TRUE
(
local_private_macro_macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
@@ -245,7 +245,7 @@ TEST_F(TestSSMacroCacheReplay, replay_in_background)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
1
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
200
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ASSERT_EQ
(
OB_SUCCESS
,
write_object_handle
.
set_macro_block_id
(
macro_id
));
...
...
@@ -289,7 +289,7 @@ TEST_F(TestSSMacroCacheReplay, replay_in_background)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
1
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
300
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ASSERT_EQ
(
OB_SUCCESS
,
write_object_handle
.
set_macro_block_id
(
macro_id
));
...
...
mittest/shared_storage/ss_macro_cache/test_ss_macro_cache_stat.cpp
浏览文件 @
9cdc3091
...
...
@@ -94,7 +94,7 @@ TEST_F(TestSSMacroCacheStat, test_tablet_stat)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
@@ -187,7 +187,7 @@ TEST_F(TestSSMacroCacheStat, test_tablet_stat_after_evict)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
macro_id
.
set_third_id
(
server_id
);
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
100
);
// tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
...
...
mittest/shared_storage/ss_macro_cache/test_ss_write_cache_ctrl_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -124,7 +124,7 @@ TEST_F(TestSSWriteCacheCtrlTask, write_cache_threshold)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
server_id
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
transfer_seq
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
transfer_seq
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
last_private_macro
=
macro_id
;
...
...
@@ -159,7 +159,7 @@ TEST_F(TestSSWriteCacheCtrlTask, write_cache_threshold)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
server_id
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
transfer_seq
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
transfer_seq
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObSSMacroCacheMetaHandle
meta_handle
;
...
...
mittest/shared_storage/ss_micro_cache/test_ss_micro_cache.cpp
浏览文件 @
9cdc3091
...
...
@@ -1368,7 +1368,7 @@ TEST_F(TestSSMicroCache, test_private_macro_cache_miss_cnt)
uint64_t
tablet_id
=
200001
;
uint64_t
server_id
=
1
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*transfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*transfer_seq*/
));
// 1. write
MacroBlockId
macro_id
;
...
...
@@ -1376,7 +1376,7 @@ TEST_F(TestSSMicroCache, test_private_macro_cache_miss_cnt)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
100
);
// seq_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// tablet_transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// tablet_transfer_seq
macro_id
.
set_tenant_seq
(
server_id
);
// macro_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
mittest/shared_storage/test_file_manager.cpp
浏览文件 @
9cdc3091
...
...
@@ -340,7 +340,7 @@ TEST_F(TestFileManager, test_path_convert)
file_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_DATA_MACRO
));
file_id
.
set_second_id
(
3
);
file_id
.
set_third_id
(
2
);
file_id
.
set_macro_transfer_epoch
(
0
);
file_id
.
set_macro_
private_
transfer_epoch
(
0
);
file_id
.
set_tenant_seq
(
5
);
char
*
object_storage_root_dir
=
nullptr
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
get_object_storage_root_dir
(
object_storage_root_dir
));
...
...
@@ -591,7 +591,7 @@ TEST_F(TestFileManager, test_remote_path_to_macro_id)
file_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_DATA_MACRO
));
file_id
.
set_second_id
(
3
);
file_id
.
set_third_id
(
2
);
file_id
.
set_macro_transfer_epoch
(
0
);
file_id
.
set_macro_
private_
transfer_epoch
(
0
);
file_id
.
set_tenant_seq
(
5
);
char
*
object_storage_root_dir
=
nullptr
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
get_object_storage_root_dir
(
object_storage_root_dir
));
...
...
@@ -671,7 +671,7 @@ TEST_F(TestFileManager, test_remote_path_to_macro_id)
// cluster_id/server_id/tenant_id_epoch_id/tmp_data/tmp_file_id/segment_id
file_id
.
set_fourth_id
(
0
);
check_path_to_macro_id
(
false
/*is_local_cache*/
,
ObStorageObjectType
::
TMP_FILE
,
file_id
);
file_id
.
set_macro_transfer_epoch
(
0
);
file_id
.
set_macro_
private_
transfer_epoch
(
0
);
file_id
.
set_tenant_seq
(
5
);
// 10.PRIVATE_TABLET_META
// tenant_id_epoch_id/ls/ls_id_epoch_id/tablet_meta/tablet_id/tablet_meta_version_transfer_seq
...
...
@@ -717,7 +717,7 @@ TEST_F(TestFileManager, test_remote_path_to_macro_id)
file_id
.
set_fourth_id
(
0
);
check_path_to_macro_id
(
false
/*is_local_cache*/
,
ObStorageObjectType
::
IS_SHARED_TENANT_DELETED
,
file_id
);
file_id
.
set_third_id
(
2
);
file_id
.
set_macro_transfer_epoch
(
0
);
file_id
.
set_macro_
private_
transfer_epoch
(
0
);
file_id
.
set_tenant_seq
(
5
);
// 21. UNSEALED_REMOTE_SEG_FILE
...
...
@@ -796,7 +796,7 @@ TEST_F(TestFileManager, test_get_file_parent_dir)
file_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_DATA_MACRO
));
file_id
.
set_second_id
(
3
);
file_id
.
set_third_id
(
2
);
file_id
.
set_macro_transfer_epoch
(
0
);
file_id
.
set_macro_
private_
transfer_epoch
(
0
);
file_id
.
set_tenant_seq
(
5
);
// each object type and print out the parent dir path log
...
...
@@ -852,12 +852,12 @@ TEST_F(TestFileManager, test_private_macro_file_operator)
file_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_DATA_MACRO
));
file_id
.
set_second_id
(
3
);
//tablet_id
file_id
.
set_third_id
(
2
);
//seq_id
file_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
file_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
file_id
.
set_tenant_seq
(
5
);
//tenant_seq
// step 1: create dir
int64_t
tablet_id
=
3
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*transfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*transfer_seq*/
));
// step 2: test write private_macro_file
ObStorageObjectHandle
write_object_handle
;
...
...
@@ -918,7 +918,7 @@ TEST_F(TestFileManager, test_private_macro_file_operator)
ASSERT_EQ
(
OB_SUCCESS
,
ObIODeviceLocalFileOp
::
stat
(
dir_path
,
statbuf
));
expected_disk_size
+=
statbuf
.
size_
;
dir_path
[
0
]
=
'\0'
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
get_tablet_data_tablet_id_
transfer_seq
_dir
(
dir_path
,
sizeof
(
dir_path
),
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
get_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
dir_path
,
sizeof
(
dir_path
),
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*transfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
ObIODeviceLocalFileOp
::
stat
(
dir_path
,
statbuf
));
expected_disk_size
+=
statbuf
.
size_
;
...
...
@@ -962,7 +962,7 @@ TEST_F(TestFileManager, test_private_macro_file_operator)
ASSERT_EQ
(
OB_SUCCESS
,
tenant_file_mgr
->
delete_file
(
file_id
));
// step 10: test delete dir
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
delete_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*transfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
delete_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*transfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
delete_tablet_data_tablet_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
));
// step 11: test calc_private_macro_disk_space after delete file
ob_usleep
(
2000
*
1000
);
...
...
@@ -1089,13 +1089,13 @@ TEST_F(TestFileManager, test_meta_file_operator)
const
int64_t
ls_id
=
7
;
const
int64_t
ls_epoch_id
=
0
;
const
int64_t
tablet_id
=
8
;
const
int64_t
meta_transfer_epoch
=
0
;
const
int64_t
meta_
private_
transfer_epoch
=
0
;
const
int64_t
meta_version_id
=
9
;
file_id
.
set_id_mode
(
static_cast
<
uint64_t
>
(
ObMacroBlockIdMode
::
ID_MODE_SHARE
));
file_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_TABLET_META
));
file_id
.
set_second_id
(
ls_id
);
file_id
.
set_third_id
(
tablet_id
);
file_id
.
set_meta_
transfer_epoch
(
meta
_transfer_epoch
);
file_id
.
set_meta_
private_transfer_epoch
(
meta_private
_transfer_epoch
);
file_id
.
set_meta_version_id
(
meta_version_id
);
// step 2: test write private_tablet_meta
...
...
@@ -1155,8 +1155,8 @@ TEST_F(TestFileManager, test_meta_file_operator)
int64_t
expected_disk_size
=
write_io_size
;
char
dir_path
[
ObBaseFileManager
::
OB_MAX_FILE_PATH_LENGTH
]
=
{
0
};
ObIODFileStat
statbuf
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
get_tablet_meta_tablet_id_
transfer_seq
_dir
(
dir_path
,
sizeof
(
dir_path
),
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
meta_transfer_epoch
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
get_tablet_meta_tablet_id_
private_transfer_epoch
_dir
(
dir_path
,
sizeof
(
dir_path
),
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
meta_
private_
transfer_epoch
));
ASSERT_EQ
(
OB_SUCCESS
,
ObIODeviceLocalFileOp
::
stat
(
dir_path
,
statbuf
));
expected_disk_size
+=
statbuf
.
size_
;
dir_path
[
0
]
=
'\0'
;
...
...
@@ -1181,7 +1181,7 @@ TEST_F(TestFileManager, test_meta_file_operator)
ASSERT_EQ
(
OB_SUCCESS
,
tenant_file_mgr
->
is_exist_file
(
file_id
,
ls_epoch_id
,
is_exist
));
ASSERT_FALSE
(
is_exist
);
// step 10: test delete dir
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
delete_tablet_meta_tablet_id_
transfer_seq_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
meta
_transfer_epoch
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
delete_tablet_meta_tablet_id_
private_transfer_epoch_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
meta_private
_transfer_epoch
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
delete_tablet_meta_tablet_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
));
ob_usleep
(
2000
*
1000
);
start_calc_size_time_s
=
ObTimeUtility
::
current_time_s
();
...
...
@@ -1210,7 +1210,7 @@ TEST_F(TestFileManager, test_list_private_tablet_meta)
meta_file_1
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_TABLET_META
));
meta_file_1
.
set_second_id
(
ls_id
);
meta_file_1
.
set_third_id
(
tablet_id
);
meta_file_1
.
set_meta_transfer_epoch
(
meta_transfer_seq
);
meta_file_1
.
set_meta_
private_
transfer_epoch
(
meta_transfer_seq
);
meta_file_1
.
set_meta_version_id
(
meta_version_id_1
);
MacroBlockId
meta_file_2
;
...
...
@@ -1219,7 +1219,7 @@ TEST_F(TestFileManager, test_list_private_tablet_meta)
meta_file_2
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_TABLET_META
));
meta_file_2
.
set_second_id
(
ls_id
);
meta_file_2
.
set_third_id
(
tablet_id
);
meta_file_2
.
set_meta_transfer_epoch
(
meta_transfer_seq
);
meta_file_2
.
set_meta_
private_
transfer_epoch
(
meta_transfer_seq
);
meta_file_2
.
set_meta_version_id
(
meta_version_id_2
);
ObStorageObjectHandle
write_object_handle_1
;
...
...
@@ -1477,7 +1477,7 @@ TEST_F(TestFileManager, test_list_and_delete_dir_operator)
tablet_data_macro
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_DATA_MACRO
));
tablet_data_macro
.
set_second_id
(
tablet_id
);
tablet_data_macro
.
set_third_id
(
server_id
);
tablet_data_macro
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
tablet_data_macro
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
tablet_data_macro
.
set_tenant_seq
(
seq_id
);
//tenant_seq
write_object_handle
.
reset
();
ASSERT_EQ
(
OB_SUCCESS
,
write_object_handle
.
set_macro_block_id
(
tablet_data_macro
));
...
...
@@ -1492,7 +1492,7 @@ TEST_F(TestFileManager, test_list_and_delete_dir_operator)
ASSERT_EQ
(
tablet_data_macro
.
second_id
(),
tablet_data_macros
.
at
(
0
).
second_id
());
ASSERT_EQ
(
tablet_data_macro
.
third_id
(),
tablet_data_macros
.
at
(
0
).
third_id
());
ASSERT_EQ
(
tablet_data_macro
.
tenant_seq
(),
tablet_data_macros
.
at
(
0
).
tenant_seq
());
ASSERT_EQ
(
tablet_data_macro
.
macro_
transfer_epoch
(),
tablet_data_macros
.
at
(
0
).
macro
_transfer_epoch
());
ASSERT_EQ
(
tablet_data_macro
.
macro_
private_transfer_epoch
(),
tablet_data_macros
.
at
(
0
).
macro_private
_transfer_epoch
());
// test3: list private meta macro
MacroBlockId
tablet_meta_macro
;
...
...
@@ -1503,7 +1503,7 @@ TEST_F(TestFileManager, test_list_and_delete_dir_operator)
tablet_meta_macro
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_META_MACRO
));
tablet_meta_macro
.
set_second_id
(
tablet_id
);
tablet_meta_macro
.
set_third_id
(
server_id
);
tablet_meta_macro
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
tablet_meta_macro
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
tablet_meta_macro
.
set_tenant_seq
(
seq_id
);
//tenant_seq
write_object_handle
.
reset
();
ASSERT_EQ
(
OB_SUCCESS
,
write_object_handle
.
set_macro_block_id
(
tablet_meta_macro
));
...
...
@@ -1518,11 +1518,11 @@ TEST_F(TestFileManager, test_list_and_delete_dir_operator)
ASSERT_EQ
(
tablet_meta_macro
.
second_id
(),
tablet_meta_macros
.
at
(
1
).
second_id
());
ASSERT_EQ
(
tablet_meta_macro
.
third_id
(),
tablet_meta_macros
.
at
(
1
).
third_id
());
ASSERT_EQ
(
tablet_meta_macro
.
tenant_seq
(),
tablet_meta_macros
.
at
(
1
).
tenant_seq
());
ASSERT_EQ
(
tablet_meta_macro
.
macro_
transfer_epoch
(),
tablet_meta_macros
.
at
(
1
).
macro
_transfer_epoch
());
ASSERT_EQ
(
tablet_meta_macro
.
macro_
private_transfer_epoch
(),
tablet_meta_macros
.
at
(
1
).
macro_private
_transfer_epoch
());
ASSERT_EQ
(
tablet_data_macro
.
second_id
(),
tablet_meta_macros
.
at
(
0
).
second_id
());
ASSERT_EQ
(
tablet_data_macro
.
third_id
(),
tablet_meta_macros
.
at
(
0
).
third_id
());
ASSERT_EQ
(
tablet_data_macro
.
tenant_seq
(),
tablet_meta_macros
.
at
(
0
).
tenant_seq
());
ASSERT_EQ
(
tablet_data_macro
.
macro_
transfer_epoch
(),
tablet_meta_macros
.
at
(
0
).
macro
_transfer_epoch
());
ASSERT_EQ
(
tablet_data_macro
.
macro_
private_transfer_epoch
(),
tablet_meta_macros
.
at
(
0
).
macro_private
_transfer_epoch
());
// test4: list private tablet meta version
int64_t
ls_id
=
8
;
...
...
@@ -1533,7 +1533,7 @@ TEST_F(TestFileManager, test_list_and_delete_dir_operator)
tablet_meta_version
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_TABLET_META
));
tablet_meta_version
.
set_second_id
(
ls_id
);
tablet_meta_version
.
set_third_id
(
tablet_id
);
tablet_data_macro
.
set_meta_
transfer_epoch
(
0
);
//
transfer_epoch
tablet_data_macro
.
set_meta_
private_transfer_epoch
(
0
);
// private_
transfer_epoch
tablet_data_macro
.
set_meta_version_id
(
meta_version_id
);
//tenant_seq
write_object_handle
.
reset
();
ASSERT_EQ
(
OB_SUCCESS
,
write_object_handle
.
set_macro_block_id
(
tablet_meta_version
));
...
...
@@ -1646,7 +1646,7 @@ TEST_F(TestFileManager, test_list_local_files_rec)
tablet_data_macro
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_DATA_MACRO
));
tablet_data_macro
.
set_second_id
(
tablet_id
);
tablet_data_macro
.
set_third_id
(
server_id
);
tablet_data_macro
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
tablet_data_macro
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
tablet_data_macro
.
set_tenant_seq
(
seq_id
);
//tenant_seq
write_object_handle
.
reset
();
ASSERT_EQ
(
OB_SUCCESS
,
write_object_handle
.
set_macro_block_id
(
tablet_data_macro
));
...
...
@@ -1659,7 +1659,7 @@ TEST_F(TestFileManager, test_list_local_files_rec)
tablet_meta_macro
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_META_MACRO
));
tablet_meta_macro
.
set_second_id
(
tablet_id
);
tablet_meta_macro
.
set_third_id
(
server_id
);
tablet_meta_macro
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
tablet_meta_macro
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
tablet_meta_macro
.
set_tenant_seq
(
seq_id
);
//tenant_seq
write_object_handle
.
reset
();
ASSERT_EQ
(
OB_SUCCESS
,
write_object_handle
.
set_macro_block_id
(
tablet_meta_macro
));
...
...
mittest/shared_storage/test_open_close.cpp
浏览文件 @
9cdc3091
...
...
@@ -66,7 +66,7 @@ public:
macro_id
.
set_second_id
(
tablet_id_
);
// tablet_id
macro_id
.
set_third_id
(
server_id_
);
//tenant_seq
for
(
int64_t
i
=
0
;
i
<
read_times_
;
++
i
)
{
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
idx
*
file_num_per_thread_
+
1
+
(
i
%
file_num_per_thread_
));
//seq_id
get_read_device_and_fd
(
get_fd_from_cache_
,
fd_cache_
,
macro_id
,
io_info
);
ObIOHandle
io_handle
;
...
...
@@ -142,13 +142,13 @@ void TestOpenClose::prepare()
write_info
.
mtl_tenant_id_
=
MTL_ID
();
for
(
int64_t
i
=
0
;
i
<
file_num_
;
++
i
)
{
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id_
,
0
/*transfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id_
,
0
/*transfer_seq*/
));
MacroBlockId
macro_id
;
macro_id
.
set_id_mode
((
uint64_t
)
ObMacroBlockIdMode
::
ID_MODE_SHARE
);
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id_
);
// tablet_id
macro_id
.
set_third_id
(
server_id_
);
// server_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
+
1
);
//seq_id
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
@@ -173,7 +173,7 @@ void TestOpenClose::prepare_fd_cache()
macro_id
.
set_second_id
(
tablet_id_
);
// tablet_id
macro_id
.
set_third_id
(
server_id_
);
// server_id
for
(
int64_t
i
=
0
;
i
<
file_num_
;
++
i
)
{
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
i
+
1
);
//seq_id
int
fd
=
INVALID_FD
;
ObPathContext
ctx
;
...
...
mittest/shared_storage/test_ss_fd_cache_perf.cpp
浏览文件 @
9cdc3091
...
...
@@ -65,7 +65,7 @@ public:
macro_id
.
set_id_mode
((
uint64_t
)
ObMacroBlockIdMode
::
ID_MODE_SHARE
);
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id_
);
// tablet_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
server_id_
);
// server_id
for
(
int64_t
i
=
0
;
i
<
read_times_
;
++
i
)
{
...
...
@@ -142,13 +142,13 @@ void TestSSFdCache::prepare()
write_info
.
mtl_tenant_id_
=
MTL_ID
();
for
(
int64_t
i
=
0
;
i
<
file_num_
;
++
i
)
{
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id_
,
0
/*transfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id_
,
0
/*transfer_seq*/
));
MacroBlockId
macro_id
;
macro_id
.
set_id_mode
((
uint64_t
)
ObMacroBlockIdMode
::
ID_MODE_SHARE
);
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id_
);
// tablet_id
macro_id
.
set_third_id
(
i
+
1
);
// seq_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
server_id_
);
// server_id
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
mittest/shared_storage/test_ss_la_micro_key_manager.cpp
浏览文件 @
9cdc3091
...
...
@@ -68,7 +68,7 @@ TEST_F(TestLAMicroKeyManager, test_push_micro_key_to_hashset)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
PRIVATE_DATA_MACRO
));
macro_id
.
set_second_id
(
100
);
//tablet_id
macro_id
.
set_third_id
(
101
);
//seq_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
102
);
//tenant_seq
ObSSMicroBlockCacheKey
micro_key
;
ObSSMicroPrewarmMeta
micro_meta
;
...
...
mittest/shared_storage/test_ss_object_access_util.cpp
浏览文件 @
9cdc3091
...
...
@@ -123,7 +123,7 @@ TEST_F(TestSSObjectAccessUtil, test_macro_block)
uint64_t
tablet_id
=
100
;
uint64_t
server_id
=
1
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
// 1. record current macro cache used of MACRO_BLOCK
int64_t
used_size_before_write
=
0
;
...
...
@@ -135,7 +135,7 @@ TEST_F(TestSSObjectAccessUtil, test_macro_block)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
100
);
// seq_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
server_id
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
mittest/shared_storage/test_ss_reader_writer.cpp
浏览文件 @
9cdc3091
...
...
@@ -318,7 +318,7 @@ TEST_F(TestSSReaderWriter, local_cache_reader_writer)
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_ls_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
transfer_seq
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
transfer_seq
));
// 1. write
MacroBlockId
macro_id
;
...
...
@@ -416,7 +416,7 @@ TEST_F(TestSSReaderWriter, private_macro_reader_writer)
int64_t
access_cnt
=
0
;
int64_t
hit_size
=
0
;
int64_t
hit_cnt
=
0
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
// 1. write
MacroBlockId
macro_id
;
...
...
@@ -424,7 +424,7 @@ TEST_F(TestSSReaderWriter, private_macro_reader_writer)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
100
);
// seq_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
server_id
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
@@ -983,11 +983,11 @@ TEST_F(TestSSReaderWriter, private_tablet_meta_reader_writer)
uint64_t
ls_id
=
1001
;
uint64_t
ls_epoch_id
=
1
;
uint64_t
tablet_id
=
200001
;
int64_t
transfer_epoch
=
0
;
int64_t
private_
transfer_epoch
=
0
;
int64_t
version_id
=
1
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_ls_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
transfer_seq_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
transfer_epoch
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
private_transfer_epoch_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
private_
transfer_epoch
));
// 1. write to local cache
MacroBlockId
macro_id
;
...
...
@@ -995,7 +995,7 @@ TEST_F(TestSSReaderWriter, private_tablet_meta_reader_writer)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
macro_id
.
set_second_id
(
ls_id
);
macro_id
.
set_third_id
(
tablet_id
);
macro_id
.
set_meta_
transfer_epoch
(
transfer_epoch
);
macro_id
.
set_meta_
private_transfer_epoch
(
private_
transfer_epoch
);
macro_id
.
set_meta_version_id
(
version_id
);
// meta_version_id
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
@@ -1072,7 +1072,7 @@ TEST_F(TestSSReaderWriter, private_macro_write_less_read_more)
uint64_t
tablet_id
=
900
;
uint64_t
server_id
=
1
;
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
tablet_id
,
0
/*trasfer_seq*/
));
// 1. write 4KB
MacroBlockId
macro_id
;
...
...
@@ -1080,7 +1080,7 @@ TEST_F(TestSSReaderWriter, private_macro_write_less_read_more)
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
macro_id
.
set_second_id
(
tablet_id
);
// tablet_id
macro_id
.
set_third_id
(
900
);
// seq_id
macro_id
.
set_macro_transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
// transfer_seq
macro_id
.
set_tenant_seq
(
server_id
);
//tenant_seq
ASSERT_TRUE
(
macro_id
.
is_valid
());
ObStorageObjectHandle
write_object_handle
;
...
...
@@ -1116,7 +1116,7 @@ TEST_F(TestSSReaderWriter, local_overwrite)
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_ls_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
transfer_seq
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
transfer_seq
));
ASSERT_EQ
(
OB_SUCCESS
,
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
private_transfer_epoch
_dir
(
MTL_ID
(),
MTL_EPOCH_ID
(),
ls_id
,
ls_epoch_id
,
tablet_id
,
transfer_seq
));
// 1. write
MacroBlockId
macro_id
;
...
...
@@ -1662,7 +1662,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1000
);
macro_id
.
set_third_id
(
1000
+
i
);
// unique segment id for each iteration
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
// Write sealed segment (will use write_through because disk is exhausted)
...
...
@@ -1698,7 +1698,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1001
);
macro_id
.
set_third_id
(
2000
+
i
);
// unique segment id for each iteration
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
// Write sealed segment (will use write_dual and write to local cache)
...
...
@@ -1733,7 +1733,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1002
);
macro_id
.
set_third_id
(
3000
+
i
);
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
write_tmp_file_data
(
macro_id
,
0
/*offset*/
,
segment_size
,
segment_size
/*valid_length*/
,
true
/*is_sealed*/
,
write_buf_
);
...
...
@@ -1756,7 +1756,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1002
);
macro_id
.
set_third_id
(
3000
+
i
);
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
write_tmp_file_data
(
macro_id
,
0
/*offset*/
,
segment_size
,
segment_size
/*valid_length*/
,
true
/*is_sealed*/
,
write_buf_
);
...
...
@@ -1793,7 +1793,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1003
);
macro_id
.
set_third_id
(
4000
+
i
);
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
write_tmp_file_data
(
macro_id
,
0
/*offset*/
,
segment_size
,
segment_size
/*valid_length*/
,
true
/*is_sealed*/
,
write_buf_
);
...
...
@@ -1816,7 +1816,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1003
);
macro_id
.
set_third_id
(
4000
+
i
);
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
write_tmp_file_data
(
macro_id
,
0
/*offset*/
,
segment_size
,
segment_size
/*valid_length*/
,
true
/*is_sealed*/
,
write_buf_
);
...
...
@@ -1853,7 +1853,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1004
);
macro_id
.
set_third_id
(
5000
+
i
);
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
write_tmp_file_data
(
macro_id
,
0
/*offset*/
,
segment_size
,
segment_size
/*valid_length*/
,
true
/*is_sealed*/
,
write_buf_
);
...
...
@@ -1876,7 +1876,7 @@ TEST_F(TestSSReaderWriter, performance_comparison_write_through_vs_write_dual)
macro_id
.
set_storage_object_type
(
static_cast
<
uint64_t
>
(
ObStorageObjectType
::
TMP_FILE
));
macro_id
.
set_second_id
(
1004
);
macro_id
.
set_third_id
(
5000
+
i
);
macro_id
.
set_macro_transfer_epoch
(
0
);
macro_id
.
set_macro_
private_
transfer_epoch
(
0
);
macro_id
.
set_tenant_seq
(
0
);
write_tmp_file_data
(
macro_id
,
0
/*offset*/
,
segment_size
,
segment_size
/*valid_length*/
,
true
/*is_sealed*/
,
write_buf_
);
...
...
src/storage/backup/ob_backup_index_block_builder_mgr.cpp
浏览文件 @
9cdc3091
...
...
@@ -904,7 +904,7 @@ int ObBackupTabletSSTableIndexBuilderMgr::prepare_data_store_desc_(const share::
data_store_desc
.
reset
();
compaction
::
ObMergeType
merge_type
;
ObTablet
*
tablet
=
NULL
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
!
ls_id
.
is_valid
()
||
!
tablet_handle
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"get invalid args"
,
K
(
ret
),
K
(
ls_id
),
K
(
tablet_handle
));
...
...
@@ -913,8 +913,8 @@ int ObBackupTabletSSTableIndexBuilderMgr::prepare_data_store_desc_(const share::
}
else
if
(
OB_ISNULL
(
tablet
=
tablet_handle
.
get_obj
()))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"tablet should not be NULL"
,
K
(
ret
),
K
(
tablet_handle
));
}
else
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
{
if
(
is_mds_merge
(
merge_type
))
{
const
ObStorageSchema
*
storage_schema
=
ObMdsSchemaHelper
::
get_instance
().
get_storage_schema
();
...
...
@@ -932,7 +932,7 @@ int ObBackupTabletSSTableIndexBuilderMgr::prepare_data_store_desc_(const share::
tablet
->
get_snapshot_version
(),
0
/*cluster_version*/
,
false
/*micro_index_clustered*/
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
tablet
->
get_reorganization_scn
(),
table_key
.
get_end_scn
())))
{
...
...
@@ -965,7 +965,7 @@ int ObBackupTabletSSTableIndexBuilderMgr::prepare_data_store_desc_(const share::
tablet
->
get_snapshot_version
(),
0
/*cluster_version*/
,
false
/*micro_index_clustered*/
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
tablet
->
get_reorganization_scn
(),
table_key
.
get_end_scn
(),
...
...
src/storage/blocksstable/index_block/ob_index_block_builder.cpp
浏览文件 @
9cdc3091
...
...
@@ -4168,7 +4168,7 @@ bool ObIndexBlockRebuilder::use_absolute_offset(const ObITable::TableKey &table_
return
table_key
.
is_ddl_merge_sstable
();
}
int
ObIndexBlockRebuilder
::
get_tablet_
transfer_epoch
(
int32_t
&
tablet
_transfer_epoch
)
const
int
ObIndexBlockRebuilder
::
get_tablet_
private_transfer_epoch
(
int32_t
&
tablet_private
_transfer_epoch
)
const
{
int
ret
=
OB_SUCCESS
;
if
(
!
is_inited_
)
{
...
...
@@ -4178,7 +4178,7 @@ int ObIndexBlockRebuilder::get_tablet_transfer_epoch(int32_t &tablet_transfer_ep
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"sstable_builder_ shoulde not be nullptr"
,
K
(
ret
),
KP
(
sstable_builder_
));
}
else
{
tablet_transfer_epoch
=
sstable_builder_
->
get_private_transfer_epoch
();
tablet_
private_
transfer_epoch
=
sstable_builder_
->
get_private_transfer_epoch
();
}
return
ret
;
}
...
...
src/storage/blocksstable/index_block/ob_index_block_builder.h
浏览文件 @
9cdc3091
...
...
@@ -529,7 +529,7 @@ public:
const
MacroBlockId
&
macro_id
,
common
::
ObIAllocator
&
allocator
,
ObDataMacroBlockMeta
*&
macro_meta
);
int
get_tablet_
transfer_epoch
(
int32_t
&
tablet_transfer_seq
)
const
;
int
get_tablet_
private_transfer_epoch
(
int32_t
&
tablet_private_transfer_epoch
)
const
;
private:
int
inner_init
(
...
...
src/storage/blocksstable/ob_macro_block_id.cpp
浏览文件 @
9cdc3091
...
...
@@ -97,7 +97,7 @@ bool MacroBlockId::is_valid() const
}
else
if
(
is_valid
&&
id_mode_
==
(
uint64_t
)
ObMacroBlockIdMode
::
ID_MODE_SHARE
)
{
is_valid
&=
MACRO_BLOCK_ID_VERSION_V2
==
version_
&&
id_mode_
<
(
uint64_t
)
ObMacroBlockIdMode
::
ID_MODE_MAX
;
if
(
is_private_data_or_meta
())
{
is_valid
&=
meta_transfer_epoch
()
!=
-
1
&&
meta_version_id
()
!=
ObStorageObjectOpt
::
INVALID_TABLET_VERSION
;
is_valid
&=
meta_
private_
transfer_epoch
()
!=
-
1
&&
meta_version_id
()
!=
ObStorageObjectOpt
::
INVALID_TABLET_VERSION
;
// -1 : INVLAID_TABLET_TRANSFER_SEQ;
// ObStorageObjectOpt::INVALID_TABLET_VERSION : macro_seq / tablet_meta_version
}
else
if
(
is_shared_data_or_meta
())
{
...
...
@@ -128,7 +128,7 @@ int64_t MacroBlockId::to_string(char *buf, const int64_t buf_len) const
"[4th=(trans_epoch=%lu,sec_id=%lu)]}"
,
(
uint64_t
)
second_id_
,
(
uint64_t
)
third_id_
,
(
int64_t
)
macro_transfer_epoch_
,
(
int64_t
)
macro_
private_
transfer_epoch_
,
(
uint64_t
)
tenant_seq_
);
}
else
if
(
is_shared_data_or_meta
())
{
databuff_printf
(
buf
,
buf_len
,
pos
,
...
...
src/storage/blocksstable/ob_macro_block_id.h
浏览文件 @
9cdc3091
...
...
@@ -118,12 +118,12 @@ public:
void
set_incarnation_id
(
const
uint64_t
incarnation_id
)
{
incarnation_id_
=
incarnation_id
;
}
int64_t
column_group_id
()
const
{
return
column_group_id_
;
}
void
set_column_group_id
(
const
uint64_t
column_group_id
)
{
column_group_id_
=
column_group_id
;
}
int64_t
macro_
transfer_epoch
()
const
{
return
macro
_transfer_epoch_
;
}
void
set_macro_
transfer_epoch
(
const
int64_t
macro_transfer_epoch
)
{
macro_transfer_epoch_
=
macro
_transfer_epoch
;
}
int64_t
macro_
private_transfer_epoch
()
const
{
return
macro_private
_transfer_epoch_
;
}
void
set_macro_
private_transfer_epoch
(
const
int64_t
macro_private_transfer_epoch
)
{
macro_private_transfer_epoch_
=
macro_private
_transfer_epoch
;
}
uint64_t
tenant_seq
()
const
{
return
tenant_seq_
;
}
void
set_tenant_seq
(
const
uint64_t
tenant_seq
)
{
tenant_seq_
=
tenant_seq
;
}
int64_t
meta_
transfer_epoch
()
const
{
return
meta
_transfer_epoch_
;
}
void
set_meta_
transfer_epoch
(
const
int64_t
meta_transfer_epoch
)
{
meta_transfer_epoch_
=
meta
_transfer_epoch
;
}
int64_t
meta_
private_transfer_epoch
()
const
{
return
meta_private
_transfer_epoch_
;
}
void
set_meta_
private_transfer_epoch
(
const
int64_t
meta_private_transfer_epoch
)
{
meta_private_transfer_epoch_
=
meta_private
_transfer_epoch
;
}
uint64_t
meta_version_id
()
const
{
return
meta_version_id_
;
}
void
set_meta_version_id
(
const
uint64_t
meta_version_id
)
{
meta_version_id_
=
meta_version_id
;
}
bool
meta_is_inner_tablet
()
const
;
...
...
@@ -185,10 +185,10 @@ public:
static
const
uint64_t
SF_BIT_RESERVED
=
4
;
static
const
uint64_t
SF_BIT_ID_MODE
=
8
;
static
const
uint64_t
SF_BIT_VERSION
=
4
;
static
const
uint64_t
SF_BIT_
TRANSFER_SEQ
=
20
;
static
const
uint64_t
SF_BIT_
PRIVATE_TRANSFER_EPOCH
=
20
;
static
const
uint64_t
SF_BIT_TENANT_SEQ
=
44
;
static
constexpr
uint64_t
SF_BIT_META_VERSION_ID
=
44
;
static
const
uint64_t
MAX_TRANSFER_SEQ
=
(
0x1UL
<<
MacroBlockId
::
SF_BIT_
TRANSFER_SEQ
)
-
1
;
static
const
uint64_t
MAX_TRANSFER_SEQ
=
(
0x1UL
<<
MacroBlockId
::
SF_BIT_
PRIVATE_TRANSFER_EPOCH
)
-
1
;
static
const
uint64_t
MAX_WRITE_SEQ
=
(
0x1UL
<<
MacroBlockId
::
SF_BIT_WRITE_SEQ
)
-
1
;
private:
...
...
@@ -228,12 +228,12 @@ private:
int64_t
fourth_id_
;
// for PRIVATE_DATA_MACRO and PRIVATE_META_MACRO
struct
{
int64_t
macro_
transfer_epoch_
:
SF_BIT_TRANSFER_SEQ
;
// FARM COMPAT WHITELIST FOR macro_transfer_seq_: renamed
int64_t
macro_
private_transfer_epoch_
:
SF_BIT_PRIVATE_TRANSFER_EPOCH
;
// FARM COMPAT WHITELIST FOR macro_transfer_seq_: renamed
uint64_t
tenant_seq_
:
SF_BIT_TENANT_SEQ
;
};
// for PRIVATE_TABLET_META and PRIVATE_TABLET_CURRENT_VERSION
struct
{
int64_t
meta_
transfer_epoch_
:
SF_BIT_TRANSFER_SEQ
;
// FARM COMPAT WHITELIST FOR meta_transfer_seq_: renamed
int64_t
meta_
private_transfer_epoch_
:
SF_BIT_PRIVATE_TRANSFER_EPOCH
;
// FARM COMPAT WHITELIST FOR meta_transfer_seq_: renamed
uint64_t
meta_version_id_
:
SF_BIT_META_VERSION_ID
;
};
// for SHARED object
...
...
src/storage/blocksstable/ob_macro_block_id_register.h
浏览文件 @
9cdc3091
...
...
@@ -37,13 +37,13 @@
STORAGE_OBJECT_TYPE_INFO
(
PRIVATE_DATA_MACRO
,
"PRIVATE_DATA_MACRO"
,
false
/*is_pin_local*/
,
false
/*is_read_through*/
,
\
false
/*is_write_through*/
,
false
/*is_overwrite*/
,
true
/*is_support_fd_cache*/
,
\
/*is_valid second_id:tablet_id, third_id:server_id, fourth_id:macro_transfer_epoch+tenant_seq */
\
((
file_id_
.
second_id
()
>
0
)
&&
(
file_id_
.
second_id
()
<
INT64_MAX
)
&&
(
file_id_
.
third_id
()
>
0
)
&&
(
file_id_
.
macro_transfer_epoch
()
>=
0
)
&&
(
file_id_
.
tenant_seq
()
>=
0
)),
\
/*is_valid second_id:tablet_id, third_id:server_id, fourth_id:macro_
private_
transfer_epoch+tenant_seq */
\
((
file_id_
.
second_id
()
>
0
)
&&
(
file_id_
.
second_id
()
<
INT64_MAX
)
&&
(
file_id_
.
third_id
()
>
0
)
&&
(
file_id_
.
macro_
private_
transfer_epoch
()
>=
0
)
&&
(
file_id_
.
tenant_seq
()
>=
0
)),
\
/*to_local_path_format: tenant_id_epoch_id/tablet_data/scatter_id/tablet_id/transfer_seq/data/svr%ldseq%ld */
\
(
databuff_printf
(
path_
,
length
,
pos
,
"%s/%lu_%ld/%s/%02ld/%ld/%ld/%s/%s%ld%s%ld"
,
\
OB_DIR_MGR
.
get_local_cache_root_dir
(),
tenant_id
,
tenant_epoch_id
,
\
TABLET_DATA_DIR_STR
,
(
file_id_
.
second_id
()
%
ObDirManager
::
PRIVATE_MACRO_SCATTER_DIR_NUM
),
\
file_id_
.
second_id
(),
file_id_
.
macro_transfer_epoch
(),
\
file_id_
.
second_id
(),
file_id_
.
macro_
private_
transfer_epoch
(),
\
DATA_MACRO_DIR_STR
,
SVR_KEY_STR
,
file_id_
.
third_id
(),
SEQ_KEY_STR
,
file_id_
.
tenant_seq
())),
\
/*local_path_to_macro_id*/
\
const
char
*
sub_path
=
nullptr
;
\
...
...
@@ -68,7 +68,7 @@
macro_id
.
set_id_mode
((
uint64_t
)
ObMacroBlockIdMode
::
ID_MODE_SHARE
);
\
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_DATA_MACRO
);
\
macro_id
.
set_second_id
(
tablet_id
);
\
macro_id
.
set_macro_transfer_epoch
(
transfer_seq
);
\
macro_id
.
set_macro_
private_
transfer_epoch
(
transfer_seq
);
\
macro_id
.
set_third_id
(
server_id
);
\
macro_id
.
set_tenant_seq
(
seq_id
);
\
}
\
...
...
@@ -77,21 +77,21 @@
(
databuff_printf
(
path_
,
length
,
pos
,
"%s/%s_%ld/%s_%ld/%lu_%ld/%s/%ld/%ld/%s/%s%ld%s%ld"
,
\
object_storage_root_dir
,
CLUSTER_DIR_STR
,
cluster_id
,
SERVER_DIR_STR
,
\
file_id_
.
third_id
(),
tenant_id
,
tenant_epoch_id
,
TABLET_DATA_DIR_STR
,
file_id_
.
second_id
(),
\
file_id_
.
macro_transfer_epoch
(),
DATA_MACRO_DIR_STR
,
SVR_KEY_STR
,
file_id_
.
third_id
(),
SEQ_KEY_STR
,
file_id_
.
tenant_seq
())),
\
file_id_
.
macro_
private_
transfer_epoch
(),
DATA_MACRO_DIR_STR
,
SVR_KEY_STR
,
file_id_
.
third_id
(),
SEQ_KEY_STR
,
file_id_
.
tenant_seq
())),
\
/*get_parent_dir: tenant_id_epoch_id/tablet_data/scatter_id/tablet_id/transfer_seq/data/ */
\
(
OB_DIR_MGR
.
get_local_tablet_id_macro_dir
(
path
,
length
,
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro_transfer_epoch
(),
ObMacroType
::
DATA_MACRO
)),
\
(
OB_DIR_MGR
.
get_local_tablet_id_macro_dir
(
path
,
length
,
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro_
private_
transfer_epoch
(),
ObMacroType
::
DATA_MACRO
)),
\
/*create_parent_dir*/
\
(
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq_dir
(
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro
_transfer_epoch
())))
(
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch_dir
(
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro_private
_transfer_epoch
())))
STORAGE_OBJECT_TYPE_INFO
(
PRIVATE_META_MACRO
,
"PRIVATE_META_MACRO"
,
false
/*is_pin_local*/
,
false
/*is_read_through*/
,
\
false
/*is_write_through*/
,
false
/*is_overwrite*/
,
true
/*is_support_fd_cache*/
,
\
/*is_valid second_id:tablet_id, third_id:server_id, fourth_id:macro_transfer_epoch+tenant_seq */
\
((
file_id_
.
second_id
()
>
0
)
&&
(
file_id_
.
second_id
()
<
INT64_MAX
)
&&
(
file_id_
.
third_id
()
>
0
)
&&
(
file_id_
.
macro_transfer_epoch
()
>=
0
)
&&
(
file_id_
.
tenant_seq
()
>=
0
)),
\
/*is_valid second_id:tablet_id, third_id:server_id, fourth_id:macro_
private_
transfer_epoch+tenant_seq */
\
((
file_id_
.
second_id
()
>
0
)
&&
(
file_id_
.
second_id
()
<
INT64_MAX
)
&&
(
file_id_
.
third_id
()
>
0
)
&&
(
file_id_
.
macro_
private_
transfer_epoch
()
>=
0
)
&&
(
file_id_
.
tenant_seq
()
>=
0
)),
\
/*to_local_path_format: tenant_id_epoch_id/tablet_data/scatter_id/tablet_id/transfer_seq/meta/svr%ldseq%ld */
\
(
databuff_printf
(
path_
,
length
,
pos
,
"%s/%lu_%ld/%s/%02ld/%ld/%ld/%s/%s%ld%s%ld"
,
\
OB_DIR_MGR
.
get_local_cache_root_dir
(),
tenant_id
,
tenant_epoch_id
,
\
TABLET_DATA_DIR_STR
,
(
file_id_
.
second_id
()
%
ObDirManager
::
PRIVATE_MACRO_SCATTER_DIR_NUM
),
\
file_id_
.
second_id
(),
file_id_
.
macro_transfer_epoch
(),
\
file_id_
.
second_id
(),
file_id_
.
macro_
private_
transfer_epoch
(),
\
META_MACRO_DIR_STR
,
SVR_KEY_STR
,
file_id_
.
third_id
(),
SEQ_KEY_STR
,
file_id_
.
tenant_seq
())),
\
/*local_path_to_macro_id*/
\
const
char
*
sub_path
=
nullptr
;
\
...
...
@@ -116,7 +116,7 @@
macro_id
.
set_id_mode
((
uint64_t
)
ObMacroBlockIdMode
::
ID_MODE_SHARE
);
\
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_META_MACRO
);
\
macro_id
.
set_second_id
(
tablet_id
);
\
macro_id
.
set_macro_transfer_epoch
(
transfer_seq
);
\
macro_id
.
set_macro_
private_
transfer_epoch
(
transfer_seq
);
\
macro_id
.
set_third_id
(
server_id
);
\
macro_id
.
set_tenant_seq
(
seq_id
);
\
}
\
...
...
@@ -125,11 +125,11 @@
(
databuff_printf
(
path_
,
length
,
pos
,
"%s/%s_%ld/%s_%ld/%lu_%ld/%s/%ld/%ld/%s/%s%ld%s%ld"
,
\
object_storage_root_dir
,
CLUSTER_DIR_STR
,
cluster_id
,
SERVER_DIR_STR
,
\
file_id_
.
third_id
(),
tenant_id
,
tenant_epoch_id
,
TABLET_DATA_DIR_STR
,
file_id_
.
second_id
(),
\
file_id_
.
macro_transfer_epoch
(),
META_MACRO_DIR_STR
,
SVR_KEY_STR
,
file_id_
.
third_id
(),
SEQ_KEY_STR
,
file_id_
.
tenant_seq
())),
\
file_id_
.
macro_
private_
transfer_epoch
(),
META_MACRO_DIR_STR
,
SVR_KEY_STR
,
file_id_
.
third_id
(),
SEQ_KEY_STR
,
file_id_
.
tenant_seq
())),
\
/*get_parent_dir: tenant_id_epoch_id/tablet_data/scatter_id/tablet_id/transfer_seq/meta/ */
\
(
OB_DIR_MGR
.
get_local_tablet_id_macro_dir
(
path
,
length
,
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro_transfer_epoch
(),
ObMacroType
::
META_MACRO
)),
\
(
OB_DIR_MGR
.
get_local_tablet_id_macro_dir
(
path
,
length
,
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro_
private_
transfer_epoch
(),
ObMacroType
::
META_MACRO
)),
\
/*create_parent_dir*/
\
(
OB_DIR_MGR
.
create_tablet_data_tablet_id_
transfer_seq_dir
(
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro
_transfer_epoch
())))
(
OB_DIR_MGR
.
create_tablet_data_tablet_id_
private_transfer_epoch_dir
(
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
file_id
.
macro_private
_transfer_epoch
())))
STORAGE_OBJECT_TYPE_INFO
(
SHARED_MINI_DATA_MACRO
,
"SHARED_MINI_DATA_MACRO"
,
false
/*is_pin_local*/
,
false
/*is_read_through*/
,
\
true
/*is_write_through*/
,
false
/*is_overwrite*/
,
true
/*is_support_fd_cache*/
,
\
...
...
@@ -672,14 +672,14 @@
STORAGE_OBJECT_TYPE_INFO
(
PRIVATE_TABLET_META
,
"PRIVATE_TABLET_META"
,
false
/*is_pin_local*/
,
false
/*is_read_through*/
,
\
false
/*is_write_through*/
,
false
/*is_overwrite*/
,
false
/*is_support_fd_cache*/
,
\
/*is_valid second_id:ls_id, third_id:tablet_id, fourth_id:meta_transfer_epoch+meta_version_id */
\
((
file_id_
.
second_id
()
>=
0
)
&&
(
file_id_
.
second_id
()
<
INT64_MAX
)
&&
(
file_id_
.
third_id
()
>
0
)
&&
(
file_id_
.
meta_transfer_epoch
()
>=
0
)
&&
(
file_id_
.
meta_version_id
()
>=
0
)),
\
/*is_valid second_id:ls_id, third_id:tablet_id, fourth_id:meta_
private_
transfer_epoch+meta_version_id */
\
((
file_id_
.
second_id
()
>=
0
)
&&
(
file_id_
.
second_id
()
<
INT64_MAX
)
&&
(
file_id_
.
third_id
()
>
0
)
&&
(
file_id_
.
meta_
private_
transfer_epoch
()
>=
0
)
&&
(
file_id_
.
meta_version_id
()
>=
0
)),
\
/*to_local_path_format: tenant_id_epoch_id/ls/ls_id_epoch_id/tablet_meta/scatter_id/tablet_id/transfer_seq/ver%ld */
\
(
databuff_printf
(
path_
,
length
,
pos
,
"%s/%lu_%ld/%s/%ld_%ld/%s/%02ld/%ld/%ld/%s%ld"
,
\
OB_DIR_MGR
.
get_local_cache_root_dir
(),
tenant_id
,
tenant_epoch_id
,
\
LS_DIR_STR
,
file_id_
.
second_id
(),
ls_epoch_id_
,
TABLET_META_DIR_STR
,
\
(
file_id_
.
third_id
()
%
ObDirManager
::
PRIVATE_TABLET_META_SCATTER_DIR_NUM
),
\
file_id_
.
third_id
(),
file_id_
.
meta_transfer_epoch
(),
VER_KEY_STR
,
file_id_
.
meta_version_id
())),
\
file_id_
.
third_id
(),
file_id_
.
meta_
private_
transfer_epoch
(),
VER_KEY_STR
,
file_id_
.
meta_version_id
())),
\
/*local_path_to_macro_id*/
\
char
format
[
512
]
=
{
0
};
\
int
num
=
0
;
\
...
...
@@ -692,12 +692,12 @@
int64_t
epoch_id
=
0
;
\
int64_t
scatter_id
=
0
;
\
int64_t
tablet_id
=
0
;
\
int64_t
meta_transfer_epoch
=
0
;
\
int64_t
meta_
private_
transfer_epoch
=
0
;
\
int64_t
meta_version_id
=
0
;
\
if
(
OB_FAIL
(
databuff_printf
(
format
,
sizeof
(
format
),
"/%%ld_%%ld/%s/%%ld/%%ld/%%ld/%s%%ld.T%hhu"
,
\
TABLET_META_DIR_STR
,
VER_KEY_STR
,
(
uint8_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
)))
{
\
LOG_WARN
(
"fail to databuff printf"
,
KR
(
ret
));
\
}
else
if
(
FALSE_IT
(
num
=
sscanf
(
sub_path
,
format
,
&
ls_id
,
&
epoch_id
,
&
scatter_id
,
&
tablet_id
,
&
meta_transfer_epoch
,
&
meta_version_id
)))
{
\
}
else
if
(
FALSE_IT
(
num
=
sscanf
(
sub_path
,
format
,
&
ls_id
,
&
epoch_id
,
&
scatter_id
,
&
tablet_id
,
&
meta_
private_
transfer_epoch
,
&
meta_version_id
)))
{
\
}
else
if
(
OB_UNLIKELY
(
6
!=
num
))
{
\
ret
=
OB_UNEXPECTED_MACRO_CACHE_FILE
;
\
LOG_ERROR
(
"unexpected file in macro cache path"
,
KR
(
ret
),
K
(
sub_path
),
K
(
path
));
\
...
...
@@ -706,7 +706,7 @@
macro_id
.
set_storage_object_type
((
uint64_t
)
ObStorageObjectType
::
PRIVATE_TABLET_META
);
\
macro_id
.
set_second_id
(
ls_id
);
\
macro_id
.
set_third_id
(
tablet_id
);
\
macro_id
.
set_meta_
transfer_epoch
(
meta
_transfer_epoch
);
\
macro_id
.
set_meta_
private_transfer_epoch
(
meta_private
_transfer_epoch
);
\
macro_id
.
set_meta_version_id
(
meta_version_id
);
\
}
\
},
\
...
...
@@ -714,11 +714,11 @@
(
databuff_printf
(
path_
,
length
,
pos
,
"%s/%s_%ld/%s_%lu/%lu_%ld/%s/%ld/%s/%ld/%ld/%s%ld"
,
\
object_storage_root_dir
,
CLUSTER_DIR_STR
,
cluster_id
,
SERVER_DIR_STR
,
server_id
,
\
tenant_id
,
tenant_epoch_id
,
LS_DIR_STR
,
file_id_
.
second_id
(),
TABLET_META_DIR_STR
,
\
file_id_
.
third_id
(),
file_id_
.
meta_transfer_epoch
(),
VER_KEY_STR
,
file_id_
.
meta_version_id
())),
\
file_id_
.
third_id
(),
file_id_
.
meta_
private_
transfer_epoch
(),
VER_KEY_STR
,
file_id_
.
meta_version_id
())),
\
/*get_parent_dir: tenant_id_epoch_id/ls/ls_id_epoch_id/tablet_meta/scatter_id/tablet_id/transfer_seq */
\
(
OB_DIR_MGR
.
get_tablet_meta_tablet_id_
transfer_seq_dir
(
path
,
length
,
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
ls_epoch_id
,
file_id
.
third_id
(),
file_id
.
meta
_transfer_epoch
())),
\
(
OB_DIR_MGR
.
get_tablet_meta_tablet_id_
private_transfer_epoch_dir
(
path
,
length
,
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
ls_epoch_id
,
file_id
.
third_id
(),
file_id
.
meta_private
_transfer_epoch
())),
\
/*create_parent_dir*/
\
(
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
transfer_seq_dir
(
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
ls_epoch_id
,
file_id
.
third_id
(),
file_id
.
meta
_transfer_epoch
())))
(
OB_DIR_MGR
.
create_tablet_meta_tablet_id_
private_transfer_epoch_dir
(
tenant_id
,
tenant_epoch_id
,
file_id
.
second_id
(),
ls_epoch_id
,
file_id
.
third_id
(),
file_id
.
meta_private
_transfer_epoch
())))
STORAGE_OBJECT_TYPE_INFO
(
PRIVATE_SLOG_FILE
,
"PRIVATE_SLOG_FILE"
,
false
/*is_pin_local*/
,
false
/*is_read_through*/
,
\
false
/*is_write_through*/
,
true
/*is_overwrite slog is overwrite local cache do not need alloc and stat*/
,
false
/*is_support_fd_cache*/
,
\
...
...
src/storage/blocksstable/ob_object_manager.h
浏览文件 @
9cdc3091
...
...
@@ -116,13 +116,13 @@ public:
};
void
set_ss_private_tablet_meta_object_opt
(
const
int64_t
ls_id
,
const
uint64_t
tablet_id
,
const
uint64_t
version
,
const
int64_t
tablet_
trasfer_seq
)
const
int64_t
ls_id
,
const
uint64_t
tablet_id
,
const
uint64_t
version
,
const
int64_t
tablet_
private_trasfer_epoch
)
{
object_type_
=
ObStorageObjectType
::
PRIVATE_TABLET_META
;
ss_private_tablet_opt_
.
ls_id_
=
ls_id
;
ss_private_tablet_opt_
.
tablet_id_
=
tablet_id
;
ss_private_tablet_opt_
.
version_
=
version
;
ss_private_tablet_opt_
.
tablet_
transfer_seq_
=
tablet_trasfer_seq
;
ss_private_tablet_opt_
.
tablet_
private_transfer_epoch_
=
tablet_private_trasfer_epoch
;
}
void
set_ss_is_shared_tenant_deleted_object_opt
(
...
...
@@ -252,7 +252,7 @@ private:
uint64_t
ls_id_
;
uint64_t
tablet_id_
;
int64_t
version_
;
int64_t
tablet_
transfer_seq
_
;
int64_t
tablet_
private_transfer_epoch
_
;
};
struct
SSPrivateTabletCurrentVersionObjectOpt
{
...
...
src/storage/blocksstable/ob_shared_macro_block_manager.cpp
浏览文件 @
9cdc3091
...
...
@@ -780,9 +780,9 @@ int ObSharedMacroBlockMgr::prepare_data_desc(
{
int
ret
=
OB_SUCCESS
;
data_desc
.
reset
();
int32_t
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
is_mds_merge
(
merge_type
))
{
const
ObStorageSchema
*
storage_schema
=
ObMdsSchemaHelper
::
get_instance
().
get_storage_schema
();
if
(
OB_ISNULL
(
storage_schema
))
{
...
...
@@ -800,7 +800,7 @@ int ObSharedMacroBlockMgr::prepare_data_desc(
snapshot_version
,
cluster_version
,
tablet
.
get_tablet_meta
().
micro_index_clustered_
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
tablet
.
get_reorganization_scn
(),
end_scn
)))
{
...
...
@@ -834,7 +834,7 @@ int ObSharedMacroBlockMgr::prepare_data_desc(
snapshot_version
,
cluster_version
,
tablet
.
get_tablet_meta
().
micro_index_clustered_
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
tablet
.
get_reorganization_scn
(),
end_scn
,
...
...
src/storage/blocksstable/ob_storage_object_type.cpp
浏览文件 @
9cdc3091
此差异已折叠。
点击以展开。
src/storage/blocksstable/ob_storage_object_type_def.py
浏览文件 @
9cdc3091
此差异已折叠。
点击以展开。
src/storage/column_store/ob_co_merge_dag.cpp
浏览文件 @
9cdc3091
...
...
@@ -1446,10 +1446,10 @@ int ObCOMergeDagNet::get_compat_mode()
0
/*timeout_us*/
,
storage
::
ObMDSGetTabletMode
::
READ_ALL_COMMITED
)))
{
LOG_WARN
(
"failed to get tablet"
,
K
(
ret
),
K
(
ls_id_
),
K
(
tablet_id_
));
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
transfer_epoch_equal
(
*
tmp_tablet_handle
.
get_obj
(),
basic_param_
.
schedul
e_transfer_epoch_
)))
{
LOG_WARN
(
"tmp tablet
transfer epoch not eq with old
transfer epoch"
,
K
(
ret
),
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
private_transfer_epoch_equal
(
*
tmp_tablet_handle
.
get_obj
(),
basic_param_
.
schedule_privat
e_transfer_epoch_
)))
{
LOG_WARN
(
"tmp tablet
private transfer epoch not eq with old private
transfer epoch"
,
K
(
ret
),
"tmp_tablet_meta"
,
tmp_tablet_handle
.
get_obj
()
->
get_tablet_meta
(),
"old_
transfer_epoch"
,
basic_param_
.
schedul
e_transfer_epoch_
);
"old_
private_transfer_epoch"
,
basic_param_
.
schedule_privat
e_transfer_epoch_
);
}
else
{
basic_param_
.
dag_net_id_
=
get_dag_id
();
basic_param_
.
skip_get_tablet_
=
true
;
...
...
src/storage/compaction/ob_basic_tablet_merge_ctx.cpp
浏览文件 @
9cdc3091
...
...
@@ -678,10 +678,10 @@ int ObBasicTabletMergeCtx::build_ctx(bool &finish_flag)
if
(
OB_TABLET_NOT_EXIST
!=
ret
)
{
LOG_PRINT_WRAPPER
(
"failed to get ls_handle/tablet_handle/rebuild_seq"
);
}
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
transfer_epoch_equal
(
*
get_tablet
(),
get_schedul
e_transfer_epoch
())))
{
LOG_WARN
(
"new tablet
transfer epoch not eq with old
transfer epoch"
,
K
(
ret
),
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
private_transfer_epoch_equal
(
*
get_tablet
(),
get_schedule_privat
e_transfer_epoch
())))
{
LOG_WARN
(
"new tablet
private transfer epoch not eq with old private
transfer epoch"
,
K
(
ret
),
"new_tablet_meta"
,
get_tablet
()
->
get_tablet_meta
(),
"old_
transfer_epoch"
,
get_schedul
e_transfer_epoch
());
"old_
private_transfer_epoch"
,
get_schedule_privat
e_transfer_epoch
());
}
else
if
(
OB_FAIL
(
get_merge_tables
(
get_merge_table_result
)))
{
if
(
OB_NO_NEED_MERGE
!=
ret
)
{
LOG_PRINT_WRAPPER
(
"failed to get merge tables"
);
...
...
@@ -909,10 +909,10 @@ int ObBasicTabletMergeCtx::swap_tablet()
if
(
OB_FAIL
(
get_ls
()
->
get_tablet_svr
()
->
get_tablet_without_memtables
(
WashTabletPriority
::
WTP_LOW
,
key
,
mem_ctx_
.
get_allocator
(),
tablet_handle_
)))
{
LOG_WARN
(
"failed to get tablet without memtables"
,
K
(
ret
),
K
(
key
));
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
transfer_epoch_equal
(
*
get_tablet
(),
get_schedul
e_transfer_epoch
())))
{
LOG_WARN
(
"new tablet
transfer epoch not eq with old
transfer epoch"
,
K
(
ret
),
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
private_transfer_epoch_equal
(
*
get_tablet
(),
get_schedule_privat
e_transfer_epoch
())))
{
LOG_WARN
(
"new tablet
private transfer epoch not eq with old private
transfer epoch"
,
K
(
ret
),
"new_tablet_meta"
,
get_tablet
()
->
get_tablet_meta
(),
"old_
transfer_epoch"
,
get_schedul
e_transfer_epoch
());
"old_
private_transfer_epoch"
,
get_schedule_privat
e_transfer_epoch
());
}
else
{
static_param_
.
rowkey_read_info_
=
static_cast
<
const
ObRowkeyReadInfo
*>
(
&
(
get_tablet
()
->
get_rowkey_read_info
()));
LOG_INFO
(
"success to swap tablet handle"
,
K
(
ret
),
K
(
tablet_handle_
),
...
...
@@ -1634,10 +1634,10 @@ int ObBasicTabletMergeCtx::swap_tablet(ObGetMergeTablesResult &get_merge_table_r
if
(
OB_FAIL
(
swap_tablet
()))
{
LOG_WARN
(
"failed to get alloc tablet handle"
,
KR
(
ret
));
}
else
if
(
GCTX
.
is_shared_storage_mode
()
&&
OB_FAIL
(
ObTablet
::
check_transfer_epoch_equal
(
*
get_tablet
(),
get_merge_table_result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"new tablet
transfer epoch not eq with old
transfer epoch in ss"
,
K
(
ret
),
OB_FAIL
(
ObTablet
::
check_
private_
transfer_epoch_equal
(
*
get_tablet
(),
get_merge_table_result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"new tablet
private transfer epoch not eq with old private
transfer epoch in ss"
,
K
(
ret
),
"new_tablet_meta"
,
get_tablet
()
->
get_tablet_meta
(),
"old_transfer_epoch"
,
get_merge_table_result
.
private_transfer_epoch_
,
K
(
lbt
()));
"old_
private_
transfer_epoch"
,
get_merge_table_result
.
private_transfer_epoch_
,
K
(
lbt
()));
}
else
if
(
OB_FAIL
(
get_merge_tables
(
get_merge_table_result
)))
{
if
(
OB_NO_NEED_MERGE
!=
ret
)
{
LOG_WARN
(
"failed to get merge tables"
,
KR
(
ret
),
KPC
(
this
));
...
...
src/storage/compaction/ob_basic_tablet_merge_ctx.h
浏览文件 @
9cdc3091
...
...
@@ -308,7 +308,7 @@ public:
DAG_PARAM_FUNC
(
const
ObLSID
&
,
ls_id
);
DAG_PARAM_FUNC
(
const
ObTabletID
&
,
tablet_id
);
DAG_PARAM_FUNC
(
int64_t
,
merge_version
);
DAG_PARAM_FUNC
(
int64_t
,
schedule_transfer_epoch
);
DAG_PARAM_FUNC
(
int64_t
,
schedule_
private_
transfer_epoch
);
DAG_PARAM_FUNC
(
ObExecMode
,
exec_mode
);
STATIC_PARAM_FUNC
(
bool
,
is_tenant_major_merge
);
STATIC_PARAM_FUNC
(
bool
,
is_full_merge
);
...
...
src/storage/compaction/ob_partition_merge_policy.cpp
浏览文件 @
9cdc3091
...
...
@@ -77,7 +77,7 @@ int ObPartitionMergePolicy::get_medium_merge_tables(
}
if
(
FAILEDx
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
{
// major sstable's rec scn will always be 0
result
.
rec_scn_
.
set_min
();
...
...
@@ -237,7 +237,7 @@ int ObPartitionMergePolicy::get_mds_merge_tables(
ret
=
OB_NO_NEED_MERGE
;
result
.
handle_
.
reset
();
}
else
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
{
result
.
version_range_
.
snapshot_version_
=
tablet
.
get_snapshot_version
();
}
...
...
@@ -272,7 +272,7 @@ int ObPartitionMergePolicy::get_convert_co_major_merge_tables(
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"convert co major merge should not change major snapshot version"
,
K
(
ret
),
KPC
(
base_table
),
K
(
param
),
K
(
tablet
));
}
else
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
{
result
.
version_range_
.
base_version_
=
0
;
result
.
version_range_
.
multi_version_start_
=
tablet
.
get_multi_version_start
();
...
...
@@ -445,7 +445,7 @@ int ObPartitionMergePolicy::get_mini_merge_tables(
LOG_WARN
(
"failed to find mini merge tables"
,
K
(
ret
),
K
(
next_freeze_info
));
}
}
else
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
result
.
update_tablet_directly_
)
{
// do nothing else
}
else
if
(
OB_FAIL
(
deal_with_minor_result
(
merge_type
,
ls
,
tablet
,
result
)))
{
...
...
@@ -582,7 +582,7 @@ int ObPartitionMergePolicy::deal_with_minor_result(
}
else
{
result
.
version_range_
.
base_version_
=
0
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet
.
get_recycle_version
(
result
.
version_range_
.
multi_version_start_
,
result
.
version_range_
.
base_version_
)))
{
LOG_WARN
(
"Fail to get table store recycle version"
,
K
(
ret
),
K
(
result
.
version_range_
),
K
(
tablet
));
}
...
...
@@ -1654,7 +1654,7 @@ int ObAdaptiveMergePolicy::get_meta_merge_tables(
}
if
(
FAILEDx
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
{
FLOG_INFO
(
"succeed to get meta major merge tables"
,
K
(
merge_type
),
K
(
result
),
K
(
tablet
));
}
...
...
@@ -2503,7 +2503,7 @@ int ObPartitionMergePolicy::deal_with_ss_minor_result(
if
(
OB_SUCC
(
ret
))
{
result
.
version_range_
.
base_version_
=
0
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet
.
get_recycle_version
(
result
.
version_range_
.
multi_version_start_
,
result
.
version_range_
.
base_version_
)))
{
LOG_WARN
(
"Fail to get table store recycle version"
,
K
(
ret
),
K
(
result
.
version_range_
),
K
(
tablet
));
}
...
...
src/storage/compaction/ob_schedule_dag_func.cpp
浏览文件 @
9cdc3091
...
...
@@ -173,8 +173,8 @@ int ObDagParamFunc::fill_param(
LOG_WARN
(
"invalid argument"
,
KR
(
ret
),
K
(
ls_id
),
K
(
merge_snapshot_version
),
K
(
exec_mode
));
}
if
(
FAILEDx
(
tablet
.
get_private_transfer_epoch
(
param
.
schedule_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
K
(
tablet
));
if
(
FAILEDx
(
tablet
.
get_private_transfer_epoch
(
param
.
schedule_
private_
transfer_epoch_
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
K
(
tablet
));
}
else
{
param
.
ls_id_
=
ls_id
;
param
.
tablet_id_
=
tablet
.
get_tablet_meta
().
tablet_id_
;
...
...
@@ -204,8 +204,8 @@ int ObDagParamFunc::fill_param(
LOG_WARN
(
"invalid argument"
,
KR
(
ret
),
K
(
ls_id
),
K
(
merge_snapshot_version
),
K
(
exec_mode
));
}
if
(
FAILEDx
(
tablet
.
get_private_transfer_epoch
(
param
.
schedule_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
K
(
tablet
));
if
(
FAILEDx
(
tablet
.
get_private_transfer_epoch
(
param
.
schedule_
private_
transfer_epoch_
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
K
(
tablet
));
}
else
{
param
.
ls_id_
=
ls_id
;
param
.
tablet_id_
=
tablet
.
get_tablet_meta
().
tablet_id_
;
...
...
src/storage/compaction/ob_tablet_merge_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -330,7 +330,7 @@ ObTabletMergeDagParam::ObTabletMergeDagParam()
exec_mode_
(
ObExecMode
::
EXEC_MODE_LOCAL
),
merge_type_
(
INVALID_MERGE_TYPE
),
merge_version_
(
0
),
schedule_transfer_epoch_
(
-
1
),
schedule_
private_
transfer_epoch_
(
-
1
),
reorganization_scn_
(),
ls_id_
(),
tablet_id_
()
...
...
@@ -341,14 +341,14 @@ ObTabletMergeDagParam::ObTabletMergeDagParam(
const
compaction
::
ObMergeType
merge_type
,
const
share
::
ObLSID
&
ls_id
,
const
ObTabletID
&
tablet_id
,
const
int32_t
schedule_transfer_epoch
)
const
int32_t
schedule_
private_
transfer_epoch
)
:
skip_get_tablet_
(
false
),
need_swap_tablet_flag_
(
false
),
is_reserve_mode_
(
false
),
exec_mode_
(
ObExecMode
::
EXEC_MODE_LOCAL
),
merge_type_
(
merge_type
),
merge_version_
(
0
),
schedule_
transfer_epoch_
(
schedul
e_transfer_epoch
),
schedule_
private_transfer_epoch_
(
schedule_privat
e_transfer_epoch
),
reorganization_scn_
(),
ls_id_
(
ls_id
),
tablet_id_
(
tablet_id
)
...
...
@@ -408,10 +408,10 @@ int ObTabletMergeDag::get_tablet_and_compat_mode()
if
(
OB_NO_NEED_MERGE
!=
ret
)
{
LOG_WARN
(
"failed to check need merge"
,
K
(
ret
));
}
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
transfer_epoch_equal
(
*
tmp_tablet_handle
.
get_obj
(),
param_
.
schedul
e_transfer_epoch_
)))
{
LOG_WARN
(
"tmp tablet
transfer epoch not eq with old
transfer epoch"
,
K
(
ret
),
}
else
if
(
OB_FAIL
(
ObTablet
::
check_
private_transfer_epoch_equal
(
*
tmp_tablet_handle
.
get_obj
(),
param_
.
schedule_privat
e_transfer_epoch_
)))
{
LOG_WARN
(
"tmp tablet
private transfer epoch not eq with old private
transfer epoch"
,
K
(
ret
),
"tmp_tablet_meta"
,
tmp_tablet_handle
.
get_obj
()
->
get_tablet_meta
(),
"old_
transfer_epoch"
,
param_
.
schedul
e_transfer_epoch_
);
"old_
private_transfer_epoch"
,
param_
.
schedule_privat
e_transfer_epoch_
);
}
else
if
(
FALSE_IT
(
compat_mode_
=
tmp_tablet_handle
.
get_obj
()
->
get_tablet_meta
().
compat_mode_
))
{
}
else
if
(
is_mini_merge
(
merge_type_
))
{
int64_t
inc_sstable_cnt
=
0
;
...
...
src/storage/compaction/ob_tablet_merge_task.h
浏览文件 @
9cdc3091
...
...
@@ -120,11 +120,11 @@ struct ObTabletMergeDagParam : public share::ObIDagInitParam
const
compaction
::
ObMergeType
merge_type
,
const
share
::
ObLSID
&
ls_id
,
const
ObTabletID
&
tablet_id
,
const
int32_t
schedule_transfer_epoch
);
const
int32_t
schedule_
private_
transfer_epoch
);
virtual
bool
is_valid
()
const
override
;
VIRTUAL_TO_STRING_KV
(
K_
(
skip_get_tablet
),
"merge_type"
,
merge_type_to_str
(
merge_type_
),
K_
(
merge_version
),
K_
(
ls_id
),
K_
(
tablet_id
),
"exec_mode"
,
exec_mode_to_str
(
exec_mode_
),
K_
(
need_swap_tablet_flag
),
K_
(
is_reserve_mode
),
K_
(
schedule_transfer_epoch
),
K
(
reorganization_scn_
));
K_
(
need_swap_tablet_flag
),
K_
(
is_reserve_mode
),
K_
(
schedule_
private_
transfer_epoch
),
K
(
reorganization_scn_
));
bool
skip_get_tablet_
;
bool
need_swap_tablet_flag_
;
...
...
@@ -132,7 +132,7 @@ struct ObTabletMergeDagParam : public share::ObIDagInitParam
ObExecMode
exec_mode_
;
compaction
::
ObMergeType
merge_type_
;
int64_t
merge_version_
;
int32_t
schedule_transfer_epoch_
;
// only affect minor and major now
int32_t
schedule_
private_
transfer_epoch_
;
// only affect minor and major now
share
::
SCN
reorganization_scn_
;
// for shared storage merge
share
::
ObLSID
ls_id_
;
ObTabletID
tablet_id_
;
...
...
src/storage/compaction/ob_tenant_tablet_scheduler.cpp
浏览文件 @
9cdc3091
...
...
@@ -1329,7 +1329,7 @@ int ObTenantTabletScheduler::schedule_tablet_minor_merge(
LOG_WARN
(
"failed to check need merge"
,
K
(
ret
),
K
(
merge_type
),
K
(
tablet_id
),
K
(
tablet_handle
));
}
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
K
(
tablet_handle
));
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
K
(
tablet_handle
));
}
else
{
int64_t
minor_compact_trigger
=
ObPartitionMergePolicy
::
DEFAULT_MINOR_COMPACT_TRIGGER
;
{
...
...
@@ -1360,12 +1360,12 @@ int ObTenantTabletScheduler::schedule_tablet_minor_merge(
const
int64_t
parallel_dag_cnt
=
minor_range_mgr
.
exe_range_array_
.
count
()
+
parallel_results
.
count
();
const
int64_t
total_sstable_cnt
=
result
.
handle_
.
get_count
();
const
int64_t
create_time
=
common
::
ObTimeUtility
::
fast_current_time
();
int32_t
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
K
(
tablet_handle
));
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
K
(
tablet_handle
));
}
ObTabletMergeDagParam
dag_param
(
merge_type
,
ls_id
,
tablet_id
,
transfer_epoch
);
ObTabletMergeDagParam
dag_param
(
merge_type
,
ls_id
,
tablet_id
,
private_
transfer_epoch
);
for
(
int64_t
k
=
0
;
OB_SUCC
(
ret
)
&&
k
<
parallel_results
.
count
();
++
k
)
{
if
(
OB_UNLIKELY
(
parallel_results
.
at
(
k
).
handle_
.
get_count
()
<=
1
))
{
LOG_WARN
(
"invalid parallel result"
,
K
(
ret
),
K
(
k
),
K
(
parallel_results
));
...
...
@@ -1900,7 +1900,7 @@ int ObTenantTabletScheduler::schedule_tablet_ss_minor_merge(const ObMergeType &m
}
else
if
(
OB_FAIL
(
ret
))
{
LOG_WARN
(
"failed to check need merge"
,
K
(
ret
),
K
(
merge_type
),
K
(
ls_id
),
K
(
tablet_id
),
K
(
tablet_handle
));
}
else
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
{
const
int64_t
parallel_dag_cnt
=
1
;
const
int64_t
total_sstable_cnt
=
result
.
handle_
.
get_count
();
...
...
src/storage/ddl/ob_ddl_merge_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -1119,7 +1119,7 @@ int ObTabletDDLUtil::prepare_index_data_desc(const ObTablet &tablet,
const
int64_t
cg_idx
=
table_key
.
is_column_store_sstable
()
?
table_key
.
get_column_group_id
()
:
-
1
/*negative value means row store*/
;
const
SCN
end_scn
=
table_key
.
get_end_scn
();
const
bool
micro_index_clustered
=
tablet
.
get_tablet_meta
().
micro_index_clustered_
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_UNLIKELY
(
!
ls_id
.
is_valid
()
||
!
tablet_id
.
is_valid
()
||
snapshot_version
<=
0
||
data_format_version
<=
0
||
OB_ISNULL
(
storage_schema
)
||
!
reorganization_scn
.
is_valid
()))
{
ret
=
OB_INVALID_ARGUMENT
;
...
...
@@ -1135,14 +1135,14 @@ int ObTabletDDLUtil::prepare_index_data_desc(const ObTablet &tablet,
LOG_WARN
(
"unexpected table key is minor sstable"
,
K
(
ret
),
K
(
table_key
));
}
else
{
const
ObStorageColumnGroupSchema
&
cur_cg_schema
=
cg_schemas
.
at
(
cg_idx
);
int32_t
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
data_desc
.
init
(
true
/*is_ddl*/
,
*
storage_schema
,
ls_id
,
tablet_id
,
compaction
::
ObMergeType
::
MAJOR_MERGE
,
snapshot_version
,
data_format_version
,
tablet
.
get_tablet_meta
().
micro_index_clustered_
,
transfer_epoch
,
0
/*concurrent_cnt*/
,
reorganization_scn
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
reorganization_scn
,
end_scn
,
&
cur_cg_schema
,
cg_idx
)))
{
LOG_WARN
(
"init data desc for cg failed"
,
K
(
ret
));
}
else
{
...
...
@@ -1152,8 +1152,8 @@ int ObTabletDDLUtil::prepare_index_data_desc(const ObTablet &tablet,
K
(
micro_index_clustered
));
}
}
}
else
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
data_desc
.
init
(
true
/*is_ddl*/
,
*
storage_schema
,
ls_id
,
...
...
@@ -1162,7 +1162,7 @@ int ObTabletDDLUtil::prepare_index_data_desc(const ObTablet &tablet,
snapshot_version
,
data_format_version
,
tablet
.
get_tablet_meta
().
micro_index_clustered_
,
transfer_epoch
,
private_
transfer_epoch
,
0
/* concurrent cnt */
,
reorganization_scn
,
end_scn
)))
{
...
...
src/storage/ddl/ob_ddl_replay_executor.cpp
浏览文件 @
9cdc3091
...
...
@@ -462,7 +462,7 @@ int ObDDLRedoReplayExecutor::do_inc_replay_(
{
int
ret
=
OB_SUCCESS
;
bool
need_replay
=
true
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_UNLIKELY
(
!
is_incremental_direct_load
(
direct_load_type
)))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"only support incremental direct load"
,
KR
(
ret
),
K
(
direct_load_type
));
...
...
@@ -472,11 +472,11 @@ int ObDDLRedoReplayExecutor::do_inc_replay_(
}
}
else
if
(
!
need_replay
)
{
// do nothing
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
{
ObStorageObjectOpt
opt
;
opt
.
set_private_object_opt
(
tablet_handle
.
get_obj
()
->
get_tablet_id
().
id
(),
transfer_epoch
);
opt
.
set_private_object_opt
(
tablet_handle
.
get_obj
()
->
get_tablet_id
().
id
(),
private_
transfer_epoch
);
ObStorageObjectWriteInfo
object_write_info
;
object_write_info
.
buffer_
=
write_info
.
buffer_
;
object_write_info
.
size_
=
write_info
.
size_
;
...
...
@@ -601,7 +601,7 @@ int ObDDLRedoReplayExecutor::do_full_replay_(
int
ret
=
OB_SUCCESS
;
ObMacroBlockHandle
macro_handle
;
bool
need_replay
=
true
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
bool
block_exist_need_replay
=
false
;
ObTabletMemberWrapper
<
ObTabletTableStore
>
table_store_wrapper
;
...
...
@@ -629,8 +629,8 @@ int ObDDLRedoReplayExecutor::do_full_replay_(
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
!
need_replay
)
{
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
!
block_exist_need_replay
)
{
/* only update max scn value */
if
(
OB_FAIL
(
ObDDLKVPendingGuard
::
set_skip_block_scn
(
tablet_handle
.
get_obj
(),
...
...
@@ -644,7 +644,7 @@ int ObDDLRedoReplayExecutor::do_full_replay_(
}
else
{
const
ObDDLMacroBlockRedoInfo
&
redo_info
=
log_
->
get_redo_info
();
ObStorageObjectOpt
opt
;
opt
.
set_private_object_opt
(
tablet_handle
.
get_obj
()
->
get_tablet_id
().
id
(),
transfer_epoch
);
opt
.
set_private_object_opt
(
tablet_handle
.
get_obj
()
->
get_tablet_id
().
id
(),
private_
transfer_epoch
);
ObStorageObjectHandle
macro_handle
;
ObStorageObjectWriteInfo
write_info
;
write_info
.
buffer_
=
redo_info
.
data_buffer_
.
ptr
();
...
...
src/storage/ddl/ob_direct_insert_sstable_ctx_new.cpp
浏览文件 @
9cdc3091
...
...
@@ -1317,7 +1317,7 @@ int ObTabletDirectLoadMgr::update(
if
(
OB_FAIL
(
sqc_build_ctx_
.
build_param_
.
assign
(
build_param
)))
{
LOG_WARN
(
"assign build param failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
{
ls_id_
=
build_param
.
common_param_
.
ls_id_
;
tablet_id_
=
build_param
.
common_param_
.
tablet_id_
;
...
...
src/storage/ddl/ob_direct_load_struct.h
浏览文件 @
9cdc3091
...
...
@@ -949,7 +949,7 @@ private:
int64_t
parallel_task_count_
;
// for gc flag in shared storage mode
bool
is_micro_index_clustered_
;
/// COMMENT: make sure if tablet_transfer_seq is unused. If it's still being used
/// please replace it with transfer_epoch.
/// please replace it with
private_
transfer_epoch.
/// see:
int64_t
tablet_transfer_seq_
;
...
...
@@ -1099,7 +1099,7 @@ public:
int64_t
parallel_task_count_
;
// for gc flag in shared storage mode
bool
is_micro_index_clustered_
;
/// COMMENT: make sure if tablet_transfer_seq is unused. If it's still being used
/// please replace it with transfer_epoch.
/// please replace it with
private_
transfer_epoch.
/// see:
int64_t
tablet_transfer_seq_
;
share
::
SCN
start_scn_
;
...
...
src/storage/ddl/ob_tablet_lob_split_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -1485,7 +1485,7 @@ int ObTabletLobWriteDataTask::prepare_sstable_index_builder(const ObTabletLobWri
compaction
::
ObExecMode
exec_mode
=
GCTX
.
is_shared_storage_mode
()
?
ObExecMode
::
EXEC_MODE_OUTPUT
:
ObExecMode
::
EXEC_MODE_LOCAL
;
const
share
::
SCN
split_reorganization_scn
=
ctx_
->
split_scn_
.
is_valid
()
?
ctx_
->
split_scn_
:
SCN
::
min_scn
()
/*use min_scn to avoid invalid*/
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_UNLIKELY
(
!
ctx_
->
lob_meta_tablet_handle_
.
is_valid
()))
{
ret
=
OB_ERR_NULL_VALUE
;
LOG_WARN
(
"table is null"
,
K
(
ret
),
K
(
ctx_
->
lob_meta_tablet_handle_
));
...
...
@@ -1495,8 +1495,8 @@ int ObTabletLobWriteDataTask::prepare_sstable_index_builder(const ObTabletLobWri
}
else
if
(
OB_FAIL
(
ObTabletSplitUtil
::
get_tablet
(
tmp_arena
,
ctx_
->
ls_handle_
,
new_tablet_id
,
false
/*is_shared_mode*/
,
tablet_handle
,
ObMDSGetTabletMode
::
READ_ALL_COMMITED
)))
{
LOG_WARN
(
"get tablet failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
data_desc
.
init
(
true
/*is_ddl*/
,
storage_schema
,
param_
->
ls_id_
,
new_tablet_id
,
...
...
@@ -1504,7 +1504,7 @@ int ObTabletLobWriteDataTask::prepare_sstable_index_builder(const ObTabletLobWri
snapshot_version
,
param_
->
data_format_version_
,
ctx_
->
lob_meta_tablet_handle_
.
get_obj
()
->
get_tablet_meta
().
micro_index_clustered_
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
split_reorganization_scn
,
write_sstable_ctx
.
table_key_
.
get_end_scn
(),
...
...
src/storage/ddl/ob_tablet_split_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -522,20 +522,20 @@ int ObTabletSplitCtx::prepare_index_builder(
const
int64_t
snapshot_version
=
sstable
->
is_major_sstable
()
?
sstable
->
get_snapshot_version
()
:
sstable
->
get_end_scn
().
get_val_for_tx
();
const
ObStorageSchema
*
clipped_storage_schema
=
nullptr
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
get_clipped_storage_schema_on_demand
(
param
.
source_tablet_id_
,
*
sstable
,
*
storage_schema
,
true
/*try_create*/
,
clipped_storage_schema
)))
{
LOG_WARN
(
"get storage schema via sstable failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
ddl_get_tablet
(
ls_handle_
,
dst_tablet_id
,
tablet_handle
)))
{
LOG_WARN
(
"get tablet failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
data_desc
.
init
(
true
/*is_ddl*/
,
*
clipped_storage_schema
,
param
.
ls_id_
,
dst_tablet_id
,
merge_type
,
snapshot_version
,
param
.
data_format_version_
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
().
micro_index_clustered_
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
split_reorganization_scn
,
sstable
->
get_end_scn
(),
nullptr
/*cg_schema*/
,
...
...
@@ -1356,15 +1356,15 @@ int ObTabletSplitWriteTask::prepare_macro_block_writer(
sstable_
->
get_snapshot_version
()
:
sstable_
->
get_end_scn
().
get_val_for_tx
();
compaction
::
ObExecMode
exec_mode
=
GCTX
.
is_shared_storage_mode
()
?
ObExecMode
::
EXEC_MODE_OUTPUT
:
ObExecMode
::
EXEC_MODE_LOCAL
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
prepare_macro_seq_param
(
i
/*dest_tablet_index*/
,
macro_seq_param
)))
{
LOG_WARN
(
"prepare macro seq par failed"
,
K
(
ret
),
K
(
macro_seq_param
));
}
else
if
(
OB_FAIL
(
context_
->
index_builder_map_
.
get_refactored
(
task_key
,
sst_idx_builder
)))
{
LOG_WARN
(
"get refactored failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
ddl_get_tablet
(
context_
->
ls_handle_
,
dst_tablet_id
,
tablet_handle
)))
{
LOG_WARN
(
"get tablet failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
data_desc
.
init
(
true
/*is_ddl*/
,
clipped_storage_schema
,
param_
->
ls_id_
,
dst_tablet_id
,
...
...
@@ -1372,7 +1372,7 @@ int ObTabletSplitWriteTask::prepare_macro_block_writer(
snapshot_version
,
param_
->
data_format_version_
,
micro_index_clustered
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent cnt*/
,
split_reorganization_scn
,
sstable_
->
get_end_scn
(),
...
...
src/storage/ddl/ob_tablet_split_util.cpp
浏览文件 @
9cdc3091
...
...
@@ -999,11 +999,11 @@ int ObTabletSplitUtil::check_and_build_mds_sstable_merge_ctx(
tablet_merge_ctx
.
static_desc_
.
exec_mode_
=
ObExecMode
::
EXEC_MODE_OUTPUT
;
tablet_merge_ctx
.
static_desc_
.
reorganization_scn_
=
end_scn
;
}
int32_t
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
dest_tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
K
(
dest_tablet_handle
));
}
else
if
(
FALSE_IT
(
static_param
.
private_transfer_epoch_
=
transfer_epoch
))
{
}
else
if
(
FALSE_IT
(
tablet_merge_ctx
.
static_desc_
.
private_transfer_epoch_
=
transfer_epoch
))
{
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
dest_tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
K
(
dest_tablet_handle
));
}
else
if
(
FALSE_IT
(
static_param
.
private_transfer_epoch_
=
private_
transfer_epoch
))
{
}
else
if
(
FALSE_IT
(
tablet_merge_ctx
.
static_desc_
.
private_transfer_epoch_
=
private_
transfer_epoch
))
{
}
else
if
(
OB_FAIL
(
tablet_merge_ctx
.
init_tablet_merge_info
()))
{
LOG_WARN
(
"failed to init tablet merge info"
,
K
(
ret
),
K
(
ls_handle
),
K
(
dest_tablet_handle
),
K
(
tablet_merge_ctx
));
}
...
...
src/storage/high_availability/ob_sstable_copy_finish_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -858,9 +858,9 @@ int ObSSTableCopyFinishTask::prepare_data_store_desc_(
LOG_WARN
(
"fail to get cg schema"
,
K
(
ret
),
KPC
(
storage_schema
),
K
(
cg_idx
));
}
}
int32_t
transfer_epoch
=
-
1
;
if
(
FAILEDx
(
tablet
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
int32_t
private_
transfer_epoch
=
-
1
;
if
(
FAILEDx
(
tablet
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
desc
.
init
(
false
/*is ddl*/
,
*
storage_schema
,
...
...
@@ -870,7 +870,7 @@ int ObSSTableCopyFinishTask::prepare_data_store_desc_(
tablet
->
get_snapshot_version
(),
0
/*cluster_version*/
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
().
micro_index_clustered_
,
transfer_epoch
,
private_
transfer_epoch
,
0
/*concurrent_cnt*/
,
tablet
->
get_reorganization_scn
(),
sstable_param
->
table_key_
.
get_end_scn
(),
...
...
src/storage/high_availability/ob_storage_ha_macro_block_writer.cpp
浏览文件 @
9cdc3091
...
...
@@ -315,14 +315,14 @@ int ObStorageHALocalMacroBlockWriter::set_macro_write_info_(
blocksstable
::
ObStorageObjectOpt
&
opt
)
{
int
ret
=
OB_SUCCESS
;
int32_t
tablet_transfer_epoch
=
OB_INVALID_TRANSFER_SEQ
;
int32_t
tablet_
private_
transfer_epoch
=
OB_INVALID_TRANSFER_SEQ
;
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
STORAGE_LOG
(
WARN
,
"not inited"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
index_block_rebuilder_
))
{
ret
=
OB_ERR_UNEXPECTED
;
STORAGE_LOG
(
WARN
,
"index_block_rebuilder_ should not be nullptr"
,
KR
(
ret
),
KP
(
index_block_rebuilder_
));
}
else
if
(
OB_FAIL
(
index_block_rebuilder_
->
get_tablet_
transfer_epoch
(
tablet
_transfer_epoch
)))
{
}
else
if
(
OB_FAIL
(
index_block_rebuilder_
->
get_tablet_
private_transfer_epoch
(
tablet_private
_transfer_epoch
)))
{
STORAGE_LOG
(
WARN
,
"failed to get tablet_transfer_seq"
,
K
(
ret
));
}
else
{
write_info
.
io_desc_
.
set_wait_event
(
ObWaitEventIds
::
DB_FILE_MIGRATE_WRITE
);
...
...
@@ -333,10 +333,10 @@ int ObStorageHALocalMacroBlockWriter::set_macro_write_info_(
write_info
.
offset_
=
0
;
/*
For private_block in SS_mode, macro_block is seperated by transfer_seq directory.
But the macro_transfer_epoch of input macro_block_id may be old.
But the macro_
private_
transfer_epoch of input macro_block_id may be old.
Therefore, we use the tablet_transfer_seq_ from index_builder to write new macro_block.
*/
opt
.
set_private_object_opt
(
tablet_id_
.
id
(),
tablet_transfer_epoch
);
opt
.
set_private_object_opt
(
tablet_id_
.
id
(),
tablet_
private_
transfer_epoch
);
}
return
ret
;
}
...
...
src/storage/high_availability/ob_tablet_backfill_tx.cpp
浏览文件 @
9cdc3091
...
...
@@ -2629,9 +2629,9 @@ int ObTabletBackfillMergeCtx::get_merge_tables(ObGetMergeTablesResult &get_merge
//snapshot_info is only for calculate multi version start, backfill will not change mulit version start
get_merge_table_result
.
snapshot_info_
.
snapshot_type_
=
ObStorageSnapshotInfo
::
SNAPSHOT_MULTI_VERSION_START_ON_TABLET
;
get_merge_table_result
.
snapshot_info_
.
snapshot_
=
get_tablet
()
->
get_multi_version_start
();
//src_tablet_transfer_epoch, should not be used to write block;
//src_tablet_
private_
transfer_epoch, should not be used to write block;
if
(
OB_FAIL
(
get_tablet
()
->
get_private_transfer_epoch
(
get_merge_table_result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"Fail to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
get_tablet
()
->
get_tablet_meta
());
LOG_WARN
(
"Fail to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
get_tablet
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
get_tablet
()
->
get_recycle_version
(
get_merge_table_result
.
version_range_
.
multi_version_start_
,
get_merge_table_result
.
version_range_
.
base_version_
)))
{
LOG_WARN
(
"Fail to get table store recycle version"
,
K
(
ret
),
K_
(
get_merge_table_result
.
version_range
),
KPC
(
get_tablet
()));
...
...
src/storage/high_availability/ob_tablet_transfer_info.cpp
浏览文件 @
9cdc3091
...
...
@@ -18,9 +18,9 @@ using namespace oceanbase;
using
namespace
share
;
using
namespace
storage
;
/*static*/
bool
ObTabletTransferInfo
::
is_private_transfer_epoch_valid
(
const
int64_t
transfer_epoch
)
/*static*/
bool
ObTabletTransferInfo
::
is_private_transfer_epoch_valid
(
const
int64_t
private_
transfer_epoch
)
{
return
transfer_epoch
>=
0
&&
transfer_epoch
<
blocksstable
::
MacroBlockId
::
MAX_TRANSFER_SEQ
;
return
private_transfer_epoch
>=
0
&&
private_
transfer_epoch
<
blocksstable
::
MacroBlockId
::
MAX_TRANSFER_SEQ
;
}
ObTabletTransferInfo
::
ObTabletTransferInfo
()
...
...
@@ -92,7 +92,7 @@ bool ObTabletTransferInfo::is_valid() const
&&
transfer_start_scn_
.
is_valid
()
&&
transfer_seq_
>=
0
;
// won't check src_reorganization_scn_ for compatibility
// won't check transfer_epoch cause it's inited at dest.
// won't check
private_
transfer_epoch cause it's inited at dest.
}
bool
ObTabletTransferInfo
::
has_transfer_table
()
const
...
...
@@ -111,10 +111,10 @@ bool ObTabletTransferInfo::is_transfer_out_deleted() const
return
unused_is_transfer_out_deleted_
;
}
int
ObTabletTransferInfo
::
get_private_transfer_epoch
(
int32_t
&
transfer_epoch
)
const
int
ObTabletTransferInfo
::
get_private_transfer_epoch
(
int32_t
&
private_
transfer_epoch
)
const
{
int
ret
=
OB_SUCCESS
;
transfer_epoch
=
-
1
;
private_
transfer_epoch
=
-
1
;
if
(
-
1
==
private_transfer_epoch_
)
{
// transfer seq(!= -1) for previous version should within [0, 1<<20 - 1)
if
(
transfer_seq_
!=
-
1
...
...
@@ -123,13 +123,13 @@ int ObTabletTransferInfo::get_private_transfer_epoch(int32_t &transfer_epoch) co
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"unexpected transfer seq"
,
K
(
ret
),
K
(
transfer_seq_
));
}
else
{
transfer_epoch
=
transfer_seq_
;
private_
transfer_epoch
=
transfer_seq_
;
}
}
else
if
(
OB_UNLIKELY
(
!
is_private_transfer_epoch_valid
(
private_transfer_epoch_
)))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"unexpected transfer epoch"
,
K
(
ret
),
K
(
private_transfer_epoch_
));
}
else
{
transfer_epoch
=
private_transfer_epoch_
;
private_
transfer_epoch
=
private_transfer_epoch_
;
}
return
ret
;
}
...
...
src/storage/high_availability/ob_tablet_transfer_info.h
浏览文件 @
9cdc3091
...
...
@@ -25,7 +25,7 @@ struct ObTabletTransferInfo final
{
OB_UNIS_VERSION
(
1
);
public:
static
bool
is_private_transfer_epoch_valid
(
const
int64_t
transfer_epoch
);
static
bool
is_private_transfer_epoch_valid
(
const
int64_t
private_
transfer_epoch
);
public:
ObTabletTransferInfo
();
~
ObTabletTransferInfo
()
=
default
;
...
...
@@ -41,7 +41,7 @@ public:
bool
has_transfer_table
()
const
;
void
reset_transfer_table
();
bool
is_transfer_out_deleted
()
const
;
int
get_private_transfer_epoch
(
int32_t
&
transfer_epoch
)
const
;
int
get_private_transfer_epoch
(
int32_t
&
private_
transfer_epoch
)
const
;
int
set_private_transfer_epoch
(
const
int32_t
private_transfer_epoch
);
TO_STRING_KV
(
K_
(
ls_id
),
K_
(
transfer_start_scn
),
K_
(
transfer_seq
),
K_
(
has_transfer_table
),
...
...
@@ -57,7 +57,7 @@ public:
private:
static
const
int64_t
TRANSFER_INIT_LS_ID
=
0
;
/**
* @brief: transfer epoch:
* @brief:
private
transfer epoch:
* == MacroBlockID.forth_id(20 bits), initialized at dest.
* It's DIFFERENT with transfer_seq!!!
* Only used for local and private data storage path.
...
...
src/storage/ls/ob_ls_tablet_service.cpp
浏览文件 @
9cdc3091
...
...
@@ -933,7 +933,7 @@ int ObLSTabletService::update_tablet_table_store(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1023,7 +1023,7 @@ int ObLSTabletService::update_tablet_table_store(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1104,7 +1104,7 @@ int ObLSTabletService::update_tablet_to_empty_shell(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1179,7 +1179,7 @@ int ObLSTabletService::update_medium_compaction_info(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1287,7 +1287,7 @@ int ObLSTabletService::build_new_tablet_from_mds_table(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1369,7 +1369,7 @@ int ObLSTabletService::update_tablet_release_memtable_for_offline(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1463,7 +1463,7 @@ int ObLSTabletService::update_tablet_report_status(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1583,7 +1583,7 @@ int ObLSTabletService::update_tablet_snapshot_version(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1677,7 +1677,7 @@ int ObLSTabletService::update_tablet_restore_status(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1745,7 +1745,7 @@ int ObLSTabletService::update_tablet_ha_data_status(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -1846,7 +1846,7 @@ int ObLSTabletService::update_tablet_ha_expected_status(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -4627,7 +4627,7 @@ int ObLSTabletService::build_tablet_with_batch_tables(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
FAILEDx
(
old_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
@@ -9576,7 +9576,7 @@ int ObLSTabletService::update_tablet_ss_change_version(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
old_tablet
.
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
.
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"old_tablet_meta"
,
old_tablet
.
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
alloc_private_tablet_meta_version_without_lock
(
key
,
tablet_meta_version
)))
{
LOG_WARN
(
"failed to alloc tablet meta version"
,
K
(
ret
),
K
(
key
));
}
...
...
src/storage/meta_mem/ob_tablet_handle.cpp
浏览文件 @
9cdc3091
...
...
@@ -196,15 +196,15 @@ void ObTabletHandle::reset()
case
ObTabletHandle
::
ObTabletHdlType
::
COPY_FROM_T3M
:
case
ObTabletHandle
::
ObTabletHdlType
::
STANDALONE
:
{
int
tmp_ret
=
OB_SUCCESS
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
0
!=
ref_cnt
)
{
LOG_ERROR
(
"obj ref cnt isn't 0"
,
K
(
ref_cnt
),
KPC
(
this
));
}
if
(
OB_TMP_FAIL
(
obj_
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_ERROR
(
"fail to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
obj_
->
get_tablet_meta
());
if
(
OB_TMP_FAIL
(
obj_
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_ERROR
(
"fail to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
obj_
->
get_tablet_meta
());
}
else
if
(
ObTabletHdlType
::
COPY_FROM_T3M
==
type_
&&
OB_TMP_FAIL
(
t3m_
->
dec_external_tablet_cnt
(
obj_
->
get_tablet_id
().
id
(),
transfer_epoch
)))
{
LOG_ERROR
(
"fail to dec external tablet_cnt"
,
K
(
tmp_ret
),
KPC
(
this
),
KP
(
obj_
),
KPC
(
obj_
));
&&
OB_TMP_FAIL
(
t3m_
->
dec_external_tablet_cnt
(
obj_
->
get_tablet_id
().
id
(),
private_
transfer_epoch
)))
{
LOG_ERROR
(
"fail to dec external tablet_cnt"
,
K
(
tmp_ret
),
KPC
(
this
),
KP
(
obj_
),
KPC
(
obj_
)
,
K
(
private_transfer_epoch
)
);
}
if
(
OB_NOT_NULL
(
obj_pool_
))
{
ob_usleep
(
1000
*
1000
);
...
...
src/storage/meta_mem/ob_tablet_map_key.cpp
浏览文件 @
9cdc3091
...
...
@@ -60,21 +60,21 @@ uint64_t ObTabletMapKey::hash() const
ObDieingTabletMapKey
::
ObDieingTabletMapKey
()
:
tablet_id_
(
ObTabletID
::
INVALID_TABLET_ID
),
transfer_epoch_
(
share
::
OB_INVALID_TRANSFER_SEQ
)
private_
transfer_epoch_
(
share
::
OB_INVALID_TRANSFER_SEQ
)
{
}
ObDieingTabletMapKey
::
ObDieingTabletMapKey
(
const
uint64_t
tablet_id
,
const
int32_t
transfer_epoch
)
const
int32_t
private_
transfer_epoch
)
:
tablet_id_
(
tablet_id
),
transfer_epoch_
(
transfer_epoch
)
private_transfer_epoch_
(
private_
transfer_epoch
)
{
}
ObDieingTabletMapKey
::
ObDieingTabletMapKey
(
const
ObTabletMapKey
&
tablet_map_key
,
const
int32_t
transfer_epoch
)
ObDieingTabletMapKey
::
ObDieingTabletMapKey
(
const
ObTabletMapKey
&
tablet_map_key
,
const
int32_t
private_
transfer_epoch
)
:
tablet_id_
(
tablet_map_key
.
tablet_id_
.
id
()),
transfer_epoch_
(
transfer_epoch
)
private_transfer_epoch_
(
private_
transfer_epoch
)
{
}
...
...
@@ -86,7 +86,7 @@ ObDieingTabletMapKey::~ObDieingTabletMapKey()
void
ObDieingTabletMapKey
::
reset
()
{
tablet_id_
=
ObTabletID
::
INVALID_TABLET_ID
;
transfer_epoch_
=
-
1
;
private_
transfer_epoch_
=
-
1
;
}
int
ObDieingTabletMapKey
::
hash
(
uint64_t
&
hash_val
)
const
...
...
@@ -99,7 +99,7 @@ uint64_t ObDieingTabletMapKey::hash() const
{
uint64_t
hash_val
=
0
;
hash_val
=
common
::
murmurhash
(
&
tablet_id_
,
sizeof
(
tablet_id_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
transfer_epoch_
,
sizeof
(
transfer_epoch_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
private_transfer_epoch_
,
sizeof
(
private_
transfer_epoch_
),
hash_val
);
return
hash_val
;
}
...
...
src/storage/meta_mem/ob_tablet_map_key.h
浏览文件 @
9cdc3091
...
...
@@ -69,8 +69,8 @@ class ObDieingTabletMapKey final
{
public:
ObDieingTabletMapKey
();
ObDieingTabletMapKey
(
const
uint64_t
tablet_id
,
const
int32_t
transfer_epoch
);
ObDieingTabletMapKey
(
const
ObTabletMapKey
&
tablet_map_key
,
const
int32_t
transfer_epoch
);
ObDieingTabletMapKey
(
const
uint64_t
tablet_id
,
const
int32_t
private_
transfer_epoch
);
ObDieingTabletMapKey
(
const
ObTabletMapKey
&
tablet_map_key
,
const
int32_t
private_
transfer_epoch
);
~
ObDieingTabletMapKey
();
void
reset
();
...
...
@@ -82,20 +82,20 @@ public:
int
hash
(
uint64_t
&
hash_val
)
const
;
uint64_t
hash
()
const
;
TO_STRING_KV
(
K_
(
tablet_id
),
K_
(
transfer_epoch
));
TO_STRING_KV
(
K_
(
tablet_id
),
K_
(
private_
transfer_epoch
));
private:
uint64_t
tablet_id_
;
int32_t
transfer_epoch_
;
int32_t
private_
transfer_epoch_
;
};
inline
bool
ObDieingTabletMapKey
::
is_valid
()
const
{
return
ObTabletID
::
INVALID_TABLET_ID
!=
tablet_id_
&&
transfer_epoch_
>=
0
;
return
ObTabletID
::
INVALID_TABLET_ID
!=
tablet_id_
&&
private_
transfer_epoch_
>=
0
;
}
inline
bool
ObDieingTabletMapKey
::
operator
==
(
const
ObDieingTabletMapKey
&
other
)
const
{
return
tablet_id_
==
other
.
tablet_id_
&&
transfer_epoch_
==
other
.
transfer_epoch_
;
return
tablet_id_
==
other
.
tablet_id_
&&
private_transfer_epoch_
==
other
.
private_
transfer_epoch_
;
}
inline
bool
ObDieingTabletMapKey
::
operator
!=
(
const
ObDieingTabletMapKey
&
other
)
const
...
...
@@ -105,7 +105,7 @@ inline bool ObDieingTabletMapKey::operator !=(const ObDieingTabletMapKey &other)
inline
bool
ObDieingTabletMapKey
::
operator
<
(
const
ObDieingTabletMapKey
&
other
)
const
{
return
tablet_id_
<
other
.
tablet_id_
&&
transfer_epoch_
<
other
.
transfer_epoch_
;
return
tablet_id_
<
other
.
tablet_id_
&&
private_transfer_epoch_
<
other
.
private_
transfer_epoch_
;
}
class
ObSSTabletMapKey
final
...
...
src/storage/meta_mem/ob_tablet_pointer.cpp
浏览文件 @
9cdc3091
...
...
@@ -336,7 +336,7 @@ int ObTabletPointer::dump_meta_obj(ObTabletHandle &guard, void *&free_obj)
{
int
ret
=
OB_SUCCESS
;
ObMetaObj
<
ObTablet
>
meta_obj
;
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_ISNULL
(
obj_
.
ptr_
))
{
LOG_INFO
(
"tablet may be washed"
,
KPC
(
obj_
.
ptr_
));
}
else
if
(
OB_UNLIKELY
(
obj_
.
ptr_
->
get_ref
()
>
1
))
{
...
...
@@ -352,14 +352,14 @@ int ObTabletPointer::dump_meta_obj(ObTabletHandle &guard, void *&free_obj)
}
else
if
(
0
!=
obj_
.
ptr_
->
dec_ref
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"obj is still being used"
,
K
(
ret
),
K
(
*
this
));
}
else
if
(
OB_FAIL
(
obj_
.
ptr_
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
obj_
.
ptr_
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
obj_
.
ptr_
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
obj_
.
ptr_
->
get_tablet_meta
());
}
else
{
const
ObLSID
ls_id
=
obj_
.
ptr_
->
tablet_meta_
.
ls_id_
;
const
ObTabletID
tablet_id
=
obj_
.
ptr_
->
tablet_meta_
.
tablet_id_
;
const
int64_t
wash_score
=
obj_
.
ptr_
->
get_wash_score
();
guard
.
get_obj
(
meta_obj
);
const
ObTabletPersisterParam
param
(
0
/*data_version*/
,
ls_id
,
ls_handle_
.
get_ls
()
->
get_ls_epoch
(),
tablet_id
,
transfer_epoch
,
0
);
const
ObTabletPersisterParam
param
(
0
/*data_version*/
,
ls_id
,
ls_handle_
.
get_ls
()
->
get_ls_epoch
(),
tablet_id
,
private_
transfer_epoch
,
0
);
ObTablet
*
tmp_obj
=
obj_
.
ptr_
;
if
(
OB_NOT_NULL
(
meta_obj
.
ptr_
)
&&
obj_
.
ptr_
->
get_try_cache_size
()
<=
ObTenantMetaMemMgr
::
NORMAL_TABLET_POOL_SIZE
)
{
char
*
buf
=
reinterpret_cast
<
char
*>
(
meta_obj
.
ptr_
);
...
...
src/storage/meta_mem/ob_tablet_pointer_map.cpp
浏览文件 @
9cdc3091
...
...
@@ -611,12 +611,12 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory(
}
}
else
if
(
OB_UNLIKELY
(
!
is_in_memory
))
{
STORAGE_LOG
(
WARN
,
"add macro ref cnt in write lock, may poor performance"
,
K
(
key
),
K
(
disk_addr
));
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
CLICK_FAIL
(
t
->
deserialize_post_work
(
allocator
)))
{
STORAGE_LOG
(
WARN
,
"fail to deserialize post work"
,
K
(
ret
),
KP
(
t
));
}
else
if
(
CLICK_FAIL
(
t
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
STORAGE_LOG
(
WARN
,
"fail to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
t
->
get_tablet_meta
());
}
else
if
(
CLICK_FAIL
(
t3m
->
inc_external_tablet_cnt
(
t
->
get_tablet_id
().
id
(),
transfer_epoch
)))
{
}
else
if
(
CLICK_FAIL
(
t
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
STORAGE_LOG
(
WARN
,
"fail to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
t
->
get_tablet_meta
());
}
else
if
(
CLICK_FAIL
(
t3m
->
inc_external_tablet_cnt
(
t
->
get_tablet_id
().
id
(),
private_
transfer_epoch
)))
{
// !CAUTION: t3m->inc_external_tablet_cnt must be the last step which can modify ret; or, we have to dec_external_tablet_cnt in the failure process
STORAGE_LOG
(
WARN
,
"fail to inc external tablet cnt"
,
K
(
ret
),
KP
(
t
),
KPC
(
t
));
}
else
{
...
...
@@ -627,12 +627,12 @@ int ObTabletPointerMap::get_meta_obj_with_external_memory(
if
(
OB_SUCC
(
ret
)
&&
force_alloc_new
&&
is_in_memory
)
{
// tmp_guard is kept, so do post work outside write lock is safe
int32_t
transfer_epoch
=
-
1
;
int32_t
private_
transfer_epoch
=
-
1
;
if
(
CLICK_FAIL
(
t
->
deserialize_post_work
(
allocator
)))
{
STORAGE_LOG
(
WARN
,
"fail to deserialize post work"
,
K
(
ret
),
KP
(
t
));
}
else
if
(
CLICK_FAIL
(
t
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
STORAGE_LOG
(
WARN
,
"fail to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
t
->
get_tablet_meta
());
}
else
if
(
CLICK_FAIL
(
t3m
->
inc_external_tablet_cnt
(
t
->
get_tablet_id
().
id
(),
transfer_epoch
)))
{
}
else
if
(
CLICK_FAIL
(
t
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
STORAGE_LOG
(
WARN
,
"fail to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
t
->
get_tablet_meta
());
}
else
if
(
CLICK_FAIL
(
t3m
->
inc_external_tablet_cnt
(
t
->
get_tablet_id
().
id
(),
private_
transfer_epoch
)))
{
// !CAUTION: t3m->inc_external_tablet_cnt must be the last step which can modify ret; or, we have to dec_external_tablet_cnt in the failure process
STORAGE_LOG
(
WARN
,
"fail to inc external tablet cnt"
,
K
(
ret
),
KP
(
t
),
KPC
(
t
));
}
else
{
...
...
src/storage/meta_mem/ob_tenant_meta_mem_mgr.cpp
浏览文件 @
9cdc3091
...
...
@@ -297,13 +297,13 @@ int ObTenantMetaMemMgr::fetch_tenant_config()
int
ObTenantMetaMemMgr
::
check_allow_tablet_gc
(
const
ObTabletID
&
tablet_id
,
const
int32_t
transfer_epoch
,
const
int32_t
private_
transfer_epoch
,
bool
&
allow
)
{
int
ret
=
OB_SUCCESS
;
bool
is_exist
=
false
;
allow
=
false
;
ObDieingTabletMapKey
key
(
tablet_id
.
id
(),
transfer_epoch
);
ObDieingTabletMapKey
key
(
tablet_id
.
id
(),
private_
transfer_epoch
);
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObTenantMetaMemMgr hasn't been inited"
,
K
(
ret
));
...
...
@@ -890,11 +890,11 @@ int ObTenantMetaMemMgr::push_tablet_into_gc_queue(ObTablet *tablet)
}
else
{
const
ObTabletMeta
&
tablet_meta
=
tablet
->
get_tablet_meta
();
const
ObTabletMapKey
key
(
tablet_meta
.
ls_id_
,
tablet_meta
.
tablet_id_
);
int32_t
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
}
const
ObDieingTabletMapKey
dieing_tablet_key
(
key
,
transfer_epoch
);
const
ObDieingTabletMapKey
dieing_tablet_key
(
key
,
private_
transfer_epoch
);
ObBucketHashWLockGuard
lock_guard
(
bucket_lock_
,
key
.
hash
());
const
ObTabletPointerHandle
&
ptr_handle
=
tablet
->
get_pointer_handle
();
...
...
@@ -1899,7 +1899,7 @@ int ObTenantMetaMemMgr::get_current_version_for_tablet(
const
ObTabletID
&
tablet_id
,
int64_t
&
tablet_version
,
int64_t
&
last_gc_version
,
int64_t
&
tablet_
transfer_seq
,
int64_t
&
tablet_
private_transfer_epoch
,
uintptr_t
&
tablet_fingerprint
,
bool
&
allow_tablet_version_gc
)
{
...
...
@@ -1931,11 +1931,11 @@ int ObTenantMetaMemMgr::get_current_version_for_tablet(
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"tablet is NULL"
,
K
(
ret
),
K
(
tablet_handle
));
}
else
{
int32_t
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
int32_t
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet_handle
.
get_obj
()
->
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet_handle
.
get_obj
()
->
get_tablet_meta
());
}
const
ObDieingTabletMapKey
dieing_key
(
key
,
transfer_epoch
);
const
ObDieingTabletMapKey
dieing_key
(
key
,
private_
transfer_epoch
);
bool
exist_in_external
=
false
;
if
(
FAILEDx
(
external_tablet_cnt_map_
.
check_exist
(
dieing_key
,
exist_in_external
)))
{
LOG_WARN
(
"fail to check ex_tablet exist or not"
,
K
(
ret
),
K
(
dieing_key
),
K
(
exist_in_external
));
...
...
@@ -1943,9 +1943,9 @@ int ObTenantMetaMemMgr::get_current_version_for_tablet(
tablet_version
=
static_cast
<
int64_t
>
(
tablet_ptr
->
get_addr
().
block_id
().
meta_version_id
());
last_gc_version
=
tablet_ptr
->
get_last_gc_version
();
tablet_fingerprint
=
reinterpret_cast
<
uintptr_t
>
(
tablet_ptr
);
tablet_
transfer_seq
=
tablet_ptr
->
get_addr
().
block_id
().
meta
_transfer_epoch
();
tablet_
private_transfer_epoch
=
tablet_ptr
->
get_addr
().
block_id
().
meta_private
_transfer_epoch
();
allow_tablet_version_gc
=
tablet_ptr
->
is_old_version_chain_empty
()
&&
!
exist_in_external
;
OB_ASSERT
(
tablet_
transfer_seq
==
transfer_epoch
);
OB_ASSERT
(
tablet_
private_transfer_epoch
==
private_
transfer_epoch
);
FLOG_INFO
(
"PRINT TABLET ADDRESS"
,
K
(
ret
),
K
(
tablet_ptr
->
get_addr
()),
K
(
tablet_handle
.
get_obj
()
->
get_tablet_addr
()),
K
(
tablet_version
),
K
(
last_gc_version
),
K
(
tablet_fingerprint
));
}
...
...
@@ -2398,20 +2398,20 @@ int ObTenantMetaMemMgr::insert_or_update_ss_tablet(const ObSSTabletMapKey &key,
return
ret
;
}
int
ObTenantMetaMemMgr
::
inc_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_transfer_epoch
)
int
ObTenantMetaMemMgr
::
inc_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_
private_
transfer_epoch
)
{
int
ret
=
OB_SUCCESS
;
const
ObDieingTabletMapKey
dieing_key
(
tablet_id
,
tablet_transfer_epoch
);
const
ObDieingTabletMapKey
dieing_key
(
tablet_id
,
tablet_
private_
transfer_epoch
);
if
(
OB_FAIL
(
external_tablet_cnt_map_
.
reg_tablet
(
dieing_key
)))
{
LOG_WARN
(
"fail to inc external tablet cnt"
,
K
(
ret
),
K
(
dieing_key
));
}
return
ret
;
}
int
ObTenantMetaMemMgr
::
dec_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_transfer_epoch
)
int
ObTenantMetaMemMgr
::
dec_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_
private_
transfer_epoch
)
{
int
ret
=
OB_SUCCESS
;
const
ObDieingTabletMapKey
dieing_key
(
tablet_id
,
tablet_transfer_epoch
);
const
ObDieingTabletMapKey
dieing_key
(
tablet_id
,
tablet_
private_
transfer_epoch
);
if
(
OB_FAIL
(
external_tablet_cnt_map_
.
unreg_tablet
(
dieing_key
)))
{
LOG_WARN
(
"fail to dec external tablet cnt"
,
K
(
ret
),
K
(
dieing_key
));
}
...
...
@@ -2467,7 +2467,7 @@ int ObTenantMetaMemMgr::push_tablet_pointer_to_fly_map_if_need_(
const
ObTabletMapKey
&
key
)
{
int
ret
=
OB_SUCCESS
;
int32_t
tablet_transfer_epoch
=
-
1
;
int32_t
tablet_
private_
transfer_epoch
=
-
1
;
ObTabletPointer
*
tablet_ptr
=
nullptr
;
ObTabletPointerHandle
tp_handle
(
tablet_map_
);
ObTabletHandle
t_handle
;
...
...
@@ -2495,11 +2495,11 @@ int ObTenantMetaMemMgr::push_tablet_pointer_to_fly_map_if_need_(
}
else
if
(
!
t_handle
.
is_valid
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"invalid tablet_handle"
,
K
(
ret
),
K
(
t_handle
));
}
else
if
(
OB_FAIL
(
t_handle
.
get_obj
()
->
get_private_transfer_epoch
(
tablet_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
t_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
if
(
OB_FAIL
(
t_handle
.
get_obj
()
->
get_private_transfer_epoch
(
tablet_
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
t_handle
.
get_obj
()
->
get_tablet_meta
());
}
else
{
// need push tablet_ptr to flying map
bool
exist
=
false
;
ObDieingTabletMapKey
dieing_tablet_key
(
key
,
tablet_transfer_epoch
);
ObDieingTabletMapKey
dieing_tablet_key
(
key
,
tablet_
private_
transfer_epoch
);
if
(
OB_FAIL
(
flying_tablet_map_
.
check_exist
(
dieing_tablet_key
,
exist
)))
{
LOG_WARN
(
"failed to check exist"
,
K
(
ret
),
K
(
dieing_tablet_key
));
...
...
@@ -2518,7 +2518,7 @@ int ObTenantMetaMemMgr::push_tablet_pointer_to_fly_map_if_need_(
if
(
OB_FAIL
(
ret
))
{
if
(
OB_NOT_NULL
(
tablet_ptr
))
{
int
tmp_ret
=
OB_SUCCESS
;
ObDieingTabletMapKey
dieing_tablet_key
(
key
,
tablet_transfer_epoch
);
ObDieingTabletMapKey
dieing_tablet_key
(
key
,
tablet_
private_
transfer_epoch
);
if
(
OB_TMP_FAIL
(
flying_tablet_map_
.
erase
(
dieing_tablet_key
)))
{
LOG_WARN
(
"fail to erase tablet from tablet_pointer"
,
K
(
tmp_ret
),
K
(
dieing_tablet_key
));
}
else
{
...
...
src/storage/meta_mem/ob_tenant_meta_mem_mgr.h
浏览文件 @
9cdc3091
...
...
@@ -289,7 +289,7 @@ public:
const
ObTabletID
&
tablet_id
,
int64_t
&
tablet_version
,
int64_t
&
last_gc_version
,
int64_t
&
tablet_
transfer_seq
,
int64_t
&
tablet_
private_transfer_epoch
,
uintptr_t
&
tablet_fingerprint
,
bool
&
allow_tablet_version_gc
);
int
get_last_gc_version_for_tablet
(
...
...
@@ -309,7 +309,7 @@ public:
const
ObTabletID
&
tablet_id
,
const
uintptr_t
tablet_fingerprint
,
const
int64_t
new_gc_version
);
int
check_allow_tablet_gc
(
const
ObTabletID
&
tablet_id
,
const
int32_t
transfer_epoch
,
bool
&
allow
);
int
check_allow_tablet_gc
(
const
ObTabletID
&
tablet_id
,
const
int32_t
private_
transfer_epoch
,
bool
&
allow
);
/// @brief: check if macro check is safe.
/// Need to hold @c ObLSTabletService::bucket_lock_ before checking due to
/// tablet creation, initialization and persistence should be ATOMIC(this might
...
...
@@ -360,8 +360,8 @@ public:
int
inc_ref_in_leak_checker
(
const
int32_t
index
);
int
dec_ref_in_leak_checker
(
const
int32_t
index
);
int
inc_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_transfer_epoch
);
int
dec_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_transfer_epoch
);
int
inc_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_
private_
transfer_epoch
);
int
dec_external_tablet_cnt
(
const
uint64_t
tablet_id
,
const
int32_t
tablet_
private_
transfer_epoch
);
int
insert_or_update_ss_tablet
(
const
ObSSTabletMapKey
&
key
,
const
ObTabletHandle
&
tablet_hdl
);
int
fetch_ss_tablet
(
const
ObSSTabletMapKey
&
key
,
ObTabletHandle
&
tablet_hdl
);
int
schedule_load_bloomfilter
(
const
storage
::
ObITable
::
TableKey
&
sstable_key
,
...
...
src/storage/meta_store/ob_storage_meta_io_util.cpp
浏览文件 @
9cdc3091
...
...
@@ -39,7 +39,7 @@ int ObStorageMetaIOUtil::check_meta_existence(
const
share
::
ObLSID
&
ls_id
,
const
int64_t
ls_epoch
,
const
common
::
ObTabletID
&
tablet_id
,
const
int64_t
transfer_seq
,
const
int64_t
private_transfer_epoch
,
const
int64_t
start_version
,
const
int64_t
end_version
,
common
::
ObIArray
<
int64_t
>
&
tablet_versions
)
...
...
@@ -58,11 +58,11 @@ int ObStorageMetaIOUtil::check_meta_existence(
else
if
(
OB_UNLIKELY
(
!
ls_id
.
is_valid
()
||
(
ls_epoch
<
0
)
||
!
tablet_id
.
is_valid
()
||
(
transfer_seq
<
0
)
||
(
private_transfer_epoch
<
0
)
||
(
start_version
<
0
)
||
(
end_version
<
0
)))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid version"
,
KR
(
ret
),
K
(
ls_id
),
K
(
ls_epoch
),
K
(
tablet_id
),
K
(
transfer_seq
),
LOG_WARN
(
"invalid version"
,
KR
(
ret
),
K
(
ls_id
),
K
(
ls_epoch
),
K
(
tablet_id
),
K
(
private_transfer_epoch
),
K
(
start_version
),
K
(
end_version
));
}
else
if
(
OB_UNLIKELY
(
start_version
>
end_version
))
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
@@ -70,7 +70,7 @@ int ObStorageMetaIOUtil::check_meta_existence(
}
else
if
((
end_version
-
start_version
+
1
)
<
LIST_THRESHOLD
)
{
for
(
int64_t
ver
=
start_version
;
OB_SUCC
(
ret
)
&&
(
ver
<=
end_version
);
++
ver
)
{
blocksstable
::
ObStorageObjectOpt
opt
;
opt
.
set_ss_private_tablet_meta_object_opt
(
ls_id
.
id
(),
tablet_id
.
id
(),
ver
,
transfer_seq
);
opt
.
set_ss_private_tablet_meta_object_opt
(
ls_id
.
id
(),
tablet_id
.
id
(),
ver
,
private_transfer_epoch
);
if
(
OB_FAIL
(
ObStorageMetaIOUtil
::
check_meta_existence
(
opt
,
ls_epoch
,
is_exist
)))
{
LOG_WARN
(
"failed to check meta existence"
,
KR
(
ret
),
K
(
opt
),
K
(
ls_epoch
));
}
else
if
(
is_exist
)
{
...
...
@@ -86,9 +86,9 @@ int ObStorageMetaIOUtil::check_meta_existence(
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"tenant file manager should not be null"
,
KR
(
ret
));
}
else
if
(
OB_FAIL
(
tfm
->
list_private_tablet_meta
(
ls_id
.
id
(),
ls_epoch
,
tablet_id
.
id
(),
transfer_seq
,
tablet_versions
)))
{
private_transfer_epoch
,
tablet_versions
)))
{
LOG_WARN
(
"failed to list private tablet meta"
,
KR
(
ret
),
K
(
ls_id
),
K
(
ls_epoch
),
K
(
tablet_id
),
K
(
transfer_seq
));
K
(
private_transfer_epoch
));
}
else
{
const
int64_t
total
=
tablet_versions
.
count
();
int64_t
cur
=
0
;
...
...
src/storage/meta_store/ob_storage_meta_io_util.h
浏览文件 @
9cdc3091
...
...
@@ -129,7 +129,7 @@ public:
static
int
collect_private_tablet_versions
(
const
share
::
ObLSID
&
ls_id
,
const
int64_t
ls_epoch
,
const
common
::
ObTabletID
&
tablet_id
,
const
int64_t
transfer_seq
,
const
int64_t
private_transfer_epoch
,
const
int64_t
start_version
,
const
int64_t
end_version
,
common
::
ObIArray
<
int64_t
>
&
tablet_versions
);
...
...
src/storage/meta_store/ob_tenant_storage_meta_service.cpp
浏览文件 @
9cdc3091
...
...
@@ -735,7 +735,7 @@ int ObTenantStorageMetaService::get_blocks_from_private_tablet_meta(
const
int64_t
ls_epoch
,
const
ObTabletID
&
tablet_id
,
const
int64_t
tablet_version
,
const
int32_t
tablet_transfer_epoch
,
const
int32_t
tablet_
private_
transfer_epoch
,
const
bool
is_shared
,
ObIArray
<
blocksstable
::
MacroBlockId
>
&
block_ids
)
{
...
...
@@ -745,7 +745,7 @@ int ObTenantStorageMetaService::get_blocks_from_private_tablet_meta(
blocksstable
::
ObStorageObjectOpt
opt
;
const
int64_t
object_size
=
OB_DEFAULT_MACRO_BLOCK_SIZE
;
opt
.
set_ss_private_tablet_meta_object_opt
(
ls_id
.
id
(),
tablet_id
.
id
(),
tablet_version
,
tablet_transfer_epoch
);
opt
.
set_ss_private_tablet_meta_object_opt
(
ls_id
.
id
(),
tablet_id
.
id
(),
tablet_version
,
tablet_
private_
transfer_epoch
);
if
(
OB_FAIL
(
OB_STORAGE_OBJECT_MGR
.
ss_get_object_id
(
opt
,
object_id
)))
{
LOG_WARN
(
"fail to get object id"
,
K
(
ret
),
K
(
opt
));
}
else
if
(
OB_FAIL
(
tablet_addr
.
set_block_addr
(
object_id
,
0
/*offset*/
,
object_size
,
ObMetaDiskAddr
::
DiskType
::
RAW_BLOCK
)))
{
...
...
@@ -911,7 +911,7 @@ int ObTenantStorageMetaService::safe_batch_write_gc_tablet_slog(
item
.
tablet_id_
,
item
.
tablet_meta_version_
,
item
.
status_
,
item
.
tablet_
transfer_seq
_
);
item
.
tablet_
private_transfer_epoch
_
);
if
(
OB_FAIL
(
slog_array
.
push_back
(
slog_entry
)))
{
LOG_WARN
(
"fail to push slog entry into slog array"
,
K
(
ret
),
K
(
slog_entry
),
K
(
i
));
}
...
...
@@ -1043,7 +1043,7 @@ int ObTenantStorageMetaService::write_remove_tablet_slog_for_ss(
ObPendingFreeTabletStatus
::
WAIT_GC
,
ObTimeUtility
::
fast_current_time
(),
gc_type
,
tablet_addr
.
block_id
().
meta_transfer_epoch
(),
tablet_addr
.
block_id
().
meta_
private_
transfer_epoch
(),
last_gc_version
);
ObDeleteTabletLog
slog_entry
(
ls_id
,
tablet_id
,
...
...
@@ -1052,7 +1052,7 @@ int ObTenantStorageMetaService::write_remove_tablet_slog_for_ss(
tablet_item
.
status_
,
tablet_item
.
free_time_
,
tablet_item
.
gc_type_
,
tablet_item
.
tablet_
transfer_seq
_
,
tablet_item
.
tablet_
private_transfer_epoch
_
,
tablet_item
.
last_gc_version_
);
ObStorageLogParam
log_param
;
log_param
.
cmd_
=
ObIRedoModule
::
gen_cmd
(
ObRedoLogMainType
::
OB_REDO_LOG_TENANT_STORAGE
,
...
...
@@ -1225,7 +1225,7 @@ int ObTenantStorageMetaService::safe_batch_write_remove_tablet_slog_for_ss(
ObPendingFreeTabletStatus
::
WAIT_GC
,
INT64_MAX
/* delete_time */
,
GCTabletType
::
DropLS
,
tablet_addr
.
block_id
().
meta_transfer_epoch
(),
tablet_addr
.
block_id
().
meta_
private_
transfer_epoch
(),
last_gc_version
);
ObDeleteTabletLog
slog_entry
(
ls_id
,
tablet_id
,
...
...
@@ -1234,7 +1234,7 @@ int ObTenantStorageMetaService::safe_batch_write_remove_tablet_slog_for_ss(
tablet_item
.
status_
,
tablet_item
.
free_time_
,
tablet_item
.
gc_type_
,
tablet_item
.
tablet_
transfer_seq
_
,
tablet_item
.
tablet_
private_transfer_epoch
_
,
tablet_item
.
last_gc_version_
);
if
(
OB_UNLIKELY
(
!
tablet_info
.
is_valid
()))
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
@@ -1385,7 +1385,7 @@ int ObTenantStorageMetaService::get_wait_gc_tablet_items_except_gc_set(
tablet_item
.
tablet_id_
,
tablet_item
.
tablet_meta_version_
,
tablet_item
.
status_
,
tablet_item
.
tablet_
transfer_seq
_
);
tablet_item
.
tablet_
private_transfer_epoch
_
);
const
ObDeleteTabletLog
del_log
(
ls_id
,
tablet_item
.
tablet_id_
,
ls_epoch
,
...
...
@@ -1393,7 +1393,7 @@ int ObTenantStorageMetaService::get_wait_gc_tablet_items_except_gc_set(
tablet_item
.
status_
,
tablet_item
.
free_time_
,
tablet_item
.
gc_type_
,
tablet_item
.
tablet_
transfer_seq
_
,
tablet_item
.
tablet_
private_transfer_epoch
_
,
tablet_item
.
last_gc_version_
);
if
(
OB_FAIL
(
gc_set
.
exist_refactored
(
gc_log
))
&&
OB_HASH_NOT_EXIST
!=
ret
)
{
if
(
OB_HASH_EXIST
==
ret
)
{
...
...
@@ -1435,14 +1435,14 @@ int ObTenantStorageMetaService::add_wait_gc_set_items_except_gc_set(
log
.
status_
,
log
.
free_time_
,
log
.
gc_type_
,
log
.
tablet_
transfer_seq
_
,
log
.
tablet_
private_transfer_epoch
_
,
log
.
last_gc_version_
);
const
ObGCTabletLog
gc_log
(
ls_id
,
ls_epoch
,
tablet_item
.
tablet_id_
,
tablet_item
.
tablet_meta_version_
,
tablet_item
.
status_
,
tablet_item
.
tablet_
transfer_seq
_
);
tablet_item
.
tablet_
private_transfer_epoch
_
);
if
(
OB_FAIL
(
gc_set
.
exist_refactored
(
gc_log
))
&&
OB_HASH_NOT_EXIST
!=
ret
)
{
if
(
OB_HASH_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
// just skip, nothing to do.
...
...
src/storage/meta_store/ob_tenant_storage_meta_service.h
浏览文件 @
9cdc3091
...
...
@@ -129,7 +129,7 @@ public:
const
int64_t
ls_epoch
,
const
ObTabletID
&
tablet_id
,
const
int64_t
tablet_version
,
const
int32_t
tablet_transfer_epoch
,
const
int32_t
tablet_
private_
transfer_epoch
,
const
bool
is_shared
,
ObIArray
<
blocksstable
::
MacroBlockId
>
&
block_ids
);
int
get_shared_blocks_for_tablet
(
...
...
src/storage/multi_data_source/ob_mds_table_merge_task.cpp
浏览文件 @
9cdc3091
...
...
@@ -154,7 +154,7 @@ int ObMdsTableMergeTask::process()
#endif
}
else
if
(
FALSE_IT
(
ctx
.
static_param_
.
scn_range_
.
start_scn_
=
tablet
->
get_mds_checkpoint_scn
()))
{
}
else
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
ctx
.
static_desc_
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"fail to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
LOG_WARN
(
"fail to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
FALSE_IT
(
ctx
.
static_param_
.
rec_scn_
=
mds_table
.
get_mds_table_ptr
()
->
get_rec_scn
()))
{
}
else
if
(
MDS_FAIL
(
build_mds_sstable
(
ctx
,
mds_construct_sequence
,
table_handle
)))
{
if
(
OB_EMPTY_RESULT
!=
ret
)
{
...
...
src/storage/multi_data_source/ob_tablet_mds_merge_ctx.cpp
浏览文件 @
9cdc3091
...
...
@@ -240,7 +240,7 @@ int ObTabletCrossLSMdsMinorMergeCtxHelper::get_merge_tables(
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"tablet should not be NULL"
,
K
(
ret
),
K
(
tablet_handle
));
}
else
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
get_merge_table_result
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
KPC
(
tablet
));
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
KPC
(
tablet
));
}
else
{
get_merge_table_result
.
scn_range_
.
start_scn_
=
tables_handle
.
get_table
(
0
)
->
get_start_scn
();
get_merge_table_result
.
rec_scn_
=
tables_handle
.
get_table
(
0
)
->
get_rec_scn
();
...
...
src/storage/ob_super_block_struct.cpp
浏览文件 @
9cdc3091
...
...
@@ -599,7 +599,7 @@ OB_SERIALIZE_MEMBER(ObPendingFreeTabletItem,
status_
,
free_time_
,
gc_type_
,
tablet_
transfer_seq
_
// FARM COMPAT WHITELIST
tablet_
private_transfer_epoch
_
// FARM COMPAT WHITELIST
);
OB_SERIALIZE_MEMBER
(
ObLSPendingFreeTabletArray
,
ls_id_
,
// FARM COMPAT WHITELIST
...
...
src/storage/ob_super_block_struct.h
浏览文件 @
9cdc3091
...
...
@@ -317,7 +317,7 @@ public:
int64_t
union_id_
;
// for PRIVATE_TABLET_META
struct
{
int64_t
meta_transfer_seq_
:
blocksstable
::
MacroBlockId
::
SF_BIT_
TRANSFER_SEQ
;
int64_t
meta_transfer_seq_
:
blocksstable
::
MacroBlockId
::
SF_BIT_
PRIVATE_TRANSFER_EPOCH
;
uint64_t
meta_version_id_
:
blocksstable
::
MacroBlockId
::
SF_BIT_META_VERSION_ID
;
};
};
...
...
@@ -360,7 +360,7 @@ public:
status_
(
ObPendingFreeTabletStatus
::
MAX
),
free_time_
(
0
),
gc_type_
(
GCTabletType
::
DropTablet
),
tablet_
transfer_seq
_
(
share
::
OB_INVALID_TRANSFER_SEQ
),
tablet_
private_transfer_epoch
_
(
share
::
OB_INVALID_TRANSFER_SEQ
),
last_gc_version_
(
-
1
)
{}
ObPendingFreeTabletItem
(
...
...
@@ -369,11 +369,11 @@ public:
const
ObPendingFreeTabletStatus
status
,
const
int64_t
free_time
,
const
GCTabletType
gc_type
,
const
int32_t
tablet_transfer_epoch
,
const
int32_t
tablet_
private_
transfer_epoch
,
const
int64_t
last_gc_version
)
:
tablet_id_
(
tablet_id
),
tablet_meta_version_
(
tablet_meta_version
),
status_
(
status
),
free_time_
(
free_time
),
gc_type_
(
gc_type
),
tablet_
transfer_seq_
(
tablet
_transfer_epoch
),
gc_type_
(
gc_type
),
tablet_
private_transfer_epoch_
(
tablet_private
_transfer_epoch
),
last_gc_version_
(
last_gc_version
)
{}
...
...
@@ -381,18 +381,18 @@ public:
{
return
tablet_id_
.
is_valid
()
&&
tablet_meta_version_
>=
0
&&
ObPendingFreeTabletStatus
::
MAX
!=
status_
&&
tablet_
transfer_seq_
!=
share
::
OB_INVALID_TRANSFER_SEQ
&&
tablet_
private_transfer_epoch_
!=
share
::
OB_INVALID_TRANSFER_SEQ
&&
last_gc_version_
>=
-
1
&&
last_gc_version_
<
tablet_meta_version_
;
}
bool
operator
==
(
const
ObPendingFreeTabletItem
&
other
)
const
{
return
tablet_id_
==
other
.
tablet_id_
&&
tablet_meta_version_
==
other
.
tablet_meta_version_
&&
status_
==
other
.
status_
&&
tablet_
transfer_seq_
==
other
.
tablet_transfer_seq_
&&
tablet_
private_transfer_epoch_
==
other
.
tablet_private_transfer_epoch_
&&
last_gc_version_
==
other
.
last_gc_version_
;
}
TO_STRING_KV
(
K_
(
tablet_id
),
K_
(
tablet_meta_version
),
K_
(
status
),
K_
(
gc_type
),
K_
(
tablet_
transfer_seq
),
K_
(
last_gc_version
));
TO_STRING_KV
(
K_
(
tablet_id
),
K_
(
tablet_meta_version
),
K_
(
status
),
K_
(
gc_type
),
K_
(
tablet_
private_transfer_epoch
),
K_
(
last_gc_version
));
OB_UNIS_VERSION
(
1
);
public:
...
...
@@ -402,7 +402,7 @@ public:
// pending_free_items in pending_free_tablet_arr are incremented according to free time
int64_t
free_time_
;
GCTabletType
gc_type_
;
int64_t
tablet_
transfer_seq
_
;
// FARM COMPAT WHITELIST FOR tablet_transfer_seq_: renamed
int64_t
tablet_
private_transfer_epoch
_
;
// FARM COMPAT WHITELIST FOR tablet_transfer_seq_: renamed
int64_t
last_gc_version_
;
};
...
...
src/storage/slog/ob_storage_log.cpp
浏览文件 @
9cdc3091
...
...
@@ -153,7 +153,7 @@ ObDeleteTabletLog::ObDeleteTabletLog()
status_
(
ObPendingFreeTabletStatus
::
MAX
),
free_time_
(
0
),
gc_type_
(
GCTabletType
::
DropTablet
),
tablet_
transfer_seq
_
(
share
::
OB_INVALID_TRANSFER_SEQ
),
tablet_
private_transfer_epoch
_
(
share
::
OB_INVALID_TRANSFER_SEQ
),
last_gc_version_
(
-
1
)
{
}
...
...
@@ -166,7 +166,7 @@ ObDeleteTabletLog::ObDeleteTabletLog(const ObLSID &ls_id, const ObTabletID &tabl
status_
(
ObPendingFreeTabletStatus
::
MAX
),
free_time_
(
0
),
gc_type_
(
GCTabletType
::
DropTablet
),
tablet_
transfer_seq
_
(
share
::
OB_INVALID_TRANSFER_SEQ
),
tablet_
private_transfer_epoch
_
(
share
::
OB_INVALID_TRANSFER_SEQ
),
last_gc_version_
(
-
1
)
{
}
...
...
@@ -179,7 +179,7 @@ ObDeleteTabletLog::ObDeleteTabletLog(
const
ObPendingFreeTabletStatus
&
status
,
const
int64_t
free_time
,
const
GCTabletType
&
gc_type
,
const
int64_t
tablet_
transfer_seq
,
const
int64_t
tablet_
private_transfer_epoch
,
const
int64_t
last_gc_version
)
:
ls_id_
(
ls_id
),
tablet_id_
(
tablet_id
),
...
...
@@ -188,7 +188,7 @@ ObDeleteTabletLog::ObDeleteTabletLog(
status_
(
status
),
free_time_
(
free_time
),
gc_type_
(
gc_type
),
tablet_
transfer_seq_
(
tablet_transfer_seq
),
tablet_
private_transfer_epoch_
(
tablet_private_transfer_epoch
),
last_gc_version_
(
last_gc_version
)
{
}
...
...
@@ -201,7 +201,7 @@ bool ObDeleteTabletLog::is_valid() const
&&
ls_epoch_
>=
0
&&
tablet_meta_version_
>=
0
&&
ObPendingFreeTabletStatus
::
MAX
!=
status_
&&
tablet_
transfer_seq
_
!=
share
::
OB_INVALID_TRANSFER_SEQ
&&
tablet_
private_transfer_epoch
_
!=
share
::
OB_INVALID_TRANSFER_SEQ
&&
last_gc_version_
>=
-
1
&&
last_gc_version_
<
tablet_meta_version_
;
}
...
...
@@ -217,7 +217,7 @@ bool ObDeleteTabletLog::operator ==(const ObDeleteTabletLog &other) const
&&
status_
==
other
.
status_
&&
free_time_
==
other
.
free_time_
&&
gc_type_
==
other
.
gc_type_
&&
tablet_
transfer_seq_
==
other
.
tablet_transfer_seq
_
&&
tablet_
private_transfer_epoch_
==
other
.
tablet_private_transfer_epoch
_
&&
last_gc_version_
==
other
.
last_gc_version_
;
}
...
...
@@ -231,7 +231,7 @@ uint64_t ObDeleteTabletLog::hash() const
uint64_t
hash_val
=
ls_id_
.
hash
()
+
tablet_id_
.
hash
();
hash_val
=
common
::
murmurhash
(
&
ls_epoch_
,
sizeof
(
ls_epoch_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
tablet_meta_version_
,
sizeof
(
tablet_meta_version_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
tablet_
transfer_seq_
,
sizeof
(
tablet_transfer_seq
_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
tablet_
private_transfer_epoch_
,
sizeof
(
tablet_private_transfer_epoch
_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
last_gc_version_
,
sizeof
(
last_gc_version_
),
hash_val
);
return
hash_val
;
}
...
...
@@ -251,7 +251,7 @@ OB_SERIALIZE_MEMBER(ObDeleteTabletLog,
status_
,
free_time_
,
gc_type_
,
tablet_
transfer_seq
_
,
// FARM COMPAT WHITELIST
tablet_
private_transfer_epoch
_
,
// FARM COMPAT WHITELIST
last_gc_version_
);
DEF_TO_STRING
(
ObDeleteTabletLog
)
...
...
@@ -259,7 +259,7 @@ DEF_TO_STRING(ObDeleteTabletLog)
int64_t
pos
=
0
;
J_OBJ_START
();
J_KV
(
K_
(
ls_id
),
K_
(
tablet_id
),
K_
(
ls_epoch
),
K_
(
tablet_meta_version
),
K_
(
status
),
K_
(
free_time
),
K_
(
gc_type
),
K_
(
tablet_
transfer_seq
),
K_
(
last_gc_version
));
K_
(
tablet_
private_transfer_epoch
),
K_
(
last_gc_version
));
J_OBJ_END
();
return
pos
;
}
...
...
@@ -270,7 +270,7 @@ ObGCTabletLog::ObGCTabletLog()
ls_epoch_
(
0
),
tablet_meta_version_
(
0
),
status_
(
ObPendingFreeTabletStatus
::
MAX
),
tablet_
transfer_seq
_
(
0
)
tablet_
private_transfer_epoch
_
(
0
)
{}
ObGCTabletLog
::
ObGCTabletLog
(
...
...
@@ -279,13 +279,13 @@ ObGCTabletLog::ObGCTabletLog(
const
common
::
ObTabletID
&
tablet_id
,
const
int64_t
tablet_meta_version
,
const
ObPendingFreeTabletStatus
&
status
,
const
int64_t
tablet_
transfer_seq
)
const
int64_t
tablet_
private_transfer_epoch
)
:
ls_id_
(
ls_id
),
tablet_id_
(
tablet_id
),
ls_epoch_
(
ls_epoch
),
tablet_meta_version_
(
tablet_meta_version
),
status_
(
status
),
tablet_
transfer_seq_
(
tablet_transfer_seq
)
tablet_
private_transfer_epoch_
(
tablet_private_transfer_epoch
)
{
}
...
...
@@ -296,7 +296,7 @@ bool ObGCTabletLog::is_valid() const
&&
tablet_id_
.
is_valid
()
&&
tablet_meta_version_
>=
0
&&
ObPendingFreeTabletStatus
::
MAX
!=
status_
&&
tablet_
transfer_seq
_
!=
share
::
OB_INVALID_TRANSFER_SEQ
;
&&
tablet_
private_transfer_epoch
_
!=
share
::
OB_INVALID_TRANSFER_SEQ
;
}
bool
ObGCTabletLog
::
operator
==
(
const
ObGCTabletLog
&
other
)
const
...
...
@@ -306,7 +306,7 @@ bool ObGCTabletLog::operator ==(const ObGCTabletLog &other) const
&&
ls_epoch_
==
other
.
ls_epoch_
&&
tablet_meta_version_
==
other
.
tablet_meta_version_
&&
status_
==
other
.
status_
&&
tablet_
transfer_seq_
==
other
.
tablet_transfer_seq
_
;
&&
tablet_
private_transfer_epoch_
==
other
.
tablet_private_transfer_epoch
_
;
}
bool
ObGCTabletLog
::
operator
!=
(
const
ObGCTabletLog
&
other
)
const
...
...
@@ -319,7 +319,7 @@ uint64_t ObGCTabletLog::hash() const
uint64_t
hash_val
=
ls_id_
.
hash
()
+
tablet_id_
.
hash
();
hash_val
=
common
::
murmurhash
(
&
ls_epoch_
,
sizeof
(
ls_epoch_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
tablet_meta_version_
,
sizeof
(
tablet_meta_version_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
tablet_
transfer_seq_
,
sizeof
(
tablet_transfer_seq
_
),
hash_val
);
hash_val
=
common
::
murmurhash
(
&
tablet_
private_transfer_epoch_
,
sizeof
(
tablet_private_transfer_epoch
_
),
hash_val
);
return
hash_val
;
}
...
...
@@ -336,14 +336,14 @@ OB_SERIALIZE_MEMBER(ObGCTabletLog,
tablet_id_
,
tablet_meta_version_
,
status_
,
tablet_
transfer_seq
_
// FARM COMPAT WHITELIST
tablet_
private_transfer_epoch
_
// FARM COMPAT WHITELIST
);
DEF_TO_STRING
(
ObGCTabletLog
)
{
int64_t
pos
=
0
;
J_OBJ_START
();
J_KV
(
K_
(
ls_id
),
K_
(
tablet_id
),
K_
(
ls_epoch
),
K_
(
tablet_meta_version
),
K_
(
status
),
K_
(
tablet_
transfer_seq
));
J_KV
(
K_
(
ls_id
),
K_
(
tablet_id
),
K_
(
ls_epoch
),
K_
(
tablet_meta_version
),
K_
(
status
),
K_
(
tablet_
private_transfer_epoch
));
J_OBJ_END
();
return
pos
;
}
...
...
src/storage/slog/ob_storage_log.h
浏览文件 @
9cdc3091
...
...
@@ -198,7 +198,7 @@ public:
const
ObPendingFreeTabletStatus
&
status
,
const
int64_t
free_time
,
const
GCTabletType
&
gc_type
,
const
int64_t
tablet_
transfer_seq
,
const
int64_t
tablet_
private_transfer_epoch
,
const
int64_t
last_gc_version
);
virtual
~
ObDeleteTabletLog
()
{}
virtual
bool
is_valid
()
const
override
;
...
...
@@ -219,7 +219,7 @@ public:
ObPendingFreeTabletStatus
status_
;
int64_t
free_time_
;
GCTabletType
gc_type_
;
int64_t
tablet_
transfer_seq_
;
// FARM COMPAT WHITELIST FOR tablet_transfer_seq_: renamed
int64_t
tablet_
private_transfer_epoch_
;
int64_t
last_gc_version_
;
};
...
...
@@ -233,7 +233,7 @@ public:
const
common
::
ObTabletID
&
tablet_id
,
const
int64_t
tablet_meta_version
,
const
ObPendingFreeTabletStatus
&
status
,
const
int64_t
tablet_
transfer_seq
);
const
int64_t
tablet_
private_transfer_epoch
);
virtual
~
ObGCTabletLog
()
=
default
;
virtual
bool
is_valid
()
const
override
;
...
...
@@ -250,7 +250,7 @@ public:
int64_t
ls_epoch_
;
int64_t
tablet_meta_version_
;
ObPendingFreeTabletStatus
status_
;
int64_t
tablet_
transfer_seq_
;
// FARM COMPAT WHITELIST FOR tablet_transfer_seq_: renamed
int64_t
tablet_
private_transfer_epoch_
;
};
struct
ObUpdateTabletLog
:
public
ObIBaseStorageLogEntry
...
...
src/storage/slog_ckpt/ob_linked_macro_block_struct.cpp
浏览文件 @
9cdc3091
...
...
@@ -152,7 +152,7 @@ bool ObLinkedMacroInfoWriteParam::is_valid() const
bool
is_valid
=
false
;
switch
(
type_
)
{
case
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
:
{
is_valid
=
tablet_id_
.
is_valid
()
&&
tablet_transfer_epoch_
>=
0
;
is_valid
=
tablet_id_
.
is_valid
()
&&
tablet_
private_
transfer_epoch_
>=
0
;
break
;
}
case
ObLinkedMacroBlockWriteType
::
SHARED_MAJOR_MACRO_INFO
:
{
...
...
@@ -197,7 +197,7 @@ int ObLinkedMacroInfoWriteParam::build_linked_marco_info_param(
}
else
{
// private
type_
=
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
;
tablet_id_
=
persist_param
.
tablet_id_
;
tablet_transfer_epoch_
=
persist_param
.
private_transfer_epoch_
;
tablet_
private_
transfer_epoch_
=
persist_param
.
private_transfer_epoch_
;
write_callback_
=
persist_param
.
ddl_redo_callback_
;
}
return
ret
;
...
...
@@ -208,7 +208,7 @@ void ObLinkedMacroInfoWriteParam::reset()
type_
=
ObLinkedMacroBlockWriteType
::
LMI_MAX_TYPE
;
ls_id_
.
reset
();
tablet_id_
.
reset
();
tablet_transfer_epoch_
=
-
1
;
tablet_
private_
transfer_epoch_
=
-
1
;
start_macro_seq_
=
-
1
;
reorganization_scn_
=
-
1
;
op_id_
=
0
;
...
...
src/storage/slog_ckpt/ob_linked_macro_block_struct.h
浏览文件 @
9cdc3091
...
...
@@ -137,7 +137,7 @@ public:
:
type_
(
ObLinkedMacroBlockWriteType
::
LMI_MAX_TYPE
),
ls_id_
(),
tablet_id_
(),
tablet_transfer_epoch_
(
-
1
),
tablet_
private_
transfer_epoch_
(
-
1
),
start_macro_seq_
(
-
1
),
reorganization_scn_
(
-
1
),
op_id_
(
0
),
...
...
@@ -153,7 +153,7 @@ public:
TO_STRING_KV
(
K_
(
type
),
K_
(
ls_id
),
K_
(
tablet_id
),
K_
(
tablet_transfer_epoch
),
K_
(
tablet_
private_
transfer_epoch
),
K_
(
start_macro_seq
),
K_
(
reorganization_scn
),
K_
(
op_id
),
...
...
@@ -164,7 +164,7 @@ private:
ObLinkedMacroBlockWriteType
type_
;
share
::
ObLSID
ls_id_
;
ObTabletID
tablet_id_
;
int32_t
tablet_transfer_epoch_
;
int32_t
tablet_
private_
transfer_epoch_
;
int64_t
start_macro_seq_
;
int64_t
reorganization_scn_
;
uint64_t
op_id_
;
...
...
src/storage/slog_ckpt/ob_linked_macro_block_writer.cpp
浏览文件 @
9cdc3091
...
...
@@ -118,7 +118,7 @@ int ObLinkedMacroBlockWriter::write_block(
break
;
}
case
WriteType
::
PRIV_MACRO_INFO
:
{
opt
.
set_private_meta_macro_object_opt
(
macro_info_param_
.
tablet_id_
.
id
(),
macro_info_param_
.
tablet_transfer_epoch_
);
opt
.
set_private_meta_macro_object_opt
(
macro_info_param_
.
tablet_id_
.
id
(),
macro_info_param_
.
tablet_
private_
transfer_epoch_
);
break
;
}
default:
{
...
...
src/storage/slog_ckpt/ob_tenant_slog_checkpoint_util.cpp
浏览文件 @
9cdc3091
...
...
@@ -138,7 +138,7 @@ int ObTenantSlogCkptUtil::write_and_apply_tablet(
}
else
if
(
OB_NOT_NULL
(
src_tablet
)
&&
OB_FAIL
(
src_tablet
->
get_ls_epoch
(
ls_epoch
)))
{
STORAGE_LOG
(
WARN
,
"failed to get ls epoch"
,
K
(
ret
),
K
(
tablet_key
));
}
else
if
(
OB_NOT_NULL
(
src_tablet
)
&&
OB_FAIL
(
src_tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
STORAGE_LOG
(
WARN
,
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
src_tablet
->
get_tablet_meta
());
STORAGE_LOG
(
WARN
,
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
src_tablet
->
get_tablet_meta
());
}
const
ObTabletPersisterParam
param
(
data_version
,
tablet_key
.
ls_id_
,
ls_epoch
,
tablet_key
.
tablet_id_
,
private_transfer_epoch
,
tablet_meta_version
);
...
...
src/storage/slog_ckpt/ob_tenant_storage_snapshot_writer.cpp
浏览文件 @
9cdc3091
...
...
@@ -421,7 +421,7 @@ int ObTenantStorageSnapshotWriter::copy_tablet(
int32_t
private_transfer_epoch
=
-
1
;
int64_t
tablet_meta_version
=
0
;
if
(
OB_FAIL
(
tablet
->
get_private_transfer_epoch
(
private_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
->
get_tablet_meta
());
}
else
if
(
GCTX
.
is_shared_storage_mode
()
&&
OB_FAIL
(
ls
.
get_tablet_svr
()
->
alloc_private_tablet_meta_version_with_lock
(
tablet_key
,
tablet_meta_version
)))
{
if
(
OB_ENTRY_NOT_EXIST
==
ret
)
{
LOG_INFO
(
"skip writing snapshot for this tablet"
,
K
(
tablet_key
));
...
...
src/storage/tablet/ob_tablet.cpp
浏览文件 @
9cdc3091
...
...
@@ -9138,17 +9138,17 @@ int ObTablet::check_snapshot_readable(const ObDDLInfoCache& ddl_info_cache, cons
return
ret
;
}
/* static */
int
ObTablet
::
check_
transfer_epoch_equal
(
const
ObTablet
&
tablet
,
const
int32_t
transfer_epoch
)
/* static */
int
ObTablet
::
check_
private_transfer_epoch_equal
(
const
ObTablet
&
tablet
,
const
int32_t
private_
transfer_epoch
)
{
int
ret
=
OB_SUCCESS
;
if
(
0
<=
transfer_epoch
)
{
int32_t
expected_transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
expected_transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch"
,
K
(
ret
),
K
(
tablet
));
}
else
if
(
transfer_epoch
!=
expected
_transfer_epoch
)
{
if
(
0
<=
private_
transfer_epoch
)
{
int32_t
expected_
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
expected_
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get
private
transfer epoch"
,
K
(
ret
),
K
(
tablet
));
}
else
if
(
private_transfer_epoch
!=
expected_private
_transfer_epoch
)
{
ret
=
OB_TABLET_TRANSFER_SEQ_NOT_MATCH
;
LOG_WARN
(
"tablet
transfer epoch not eq with
transfer epoch"
,
K
(
expected_
transfer_epoch
),
K
(
transfer_epoch
),
K
(
tablet
));
LOG_WARN
(
"tablet
private transfer epoch not eq with expected private
transfer epoch"
,
K
(
expected_
private_transfer_epoch
),
K
(
private_
transfer_epoch
),
K
(
tablet
));
}
}
return
ret
;
...
...
@@ -9894,11 +9894,11 @@ int ObTablet::check_tx_data_can_explain_user_data(const share::SCN &tx_data_tabl
}
return
ret
;
}
int
ObTablet
::
get_private_transfer_epoch
(
int32_t
&
transfer_epoch
)
const
int
ObTablet
::
get_private_transfer_epoch
(
int32_t
&
private_
transfer_epoch
)
const
{
int
ret
=
OB_SUCCESS
;
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet_meta_
.
transfer_info_
.
get_private_transfer_epoch
(
transfer_epoch
)))
{
private_
transfer_epoch
=
-
1
;
if
(
OB_FAIL
(
tablet_meta_
.
transfer_info_
.
get_private_transfer_epoch
(
private_
transfer_epoch
)))
{
LOG_WARN
(
"failed to get transfer epoch from transfer info"
,
K
(
ret
),
K_
(
tablet_meta_
.
transfer_info
));
}
return
ret
;
...
...
src/storage/tablet/ob_tablet.h
浏览文件 @
9cdc3091
...
...
@@ -487,7 +487,7 @@ public:
share
::
ObLSID
&
ls_id
,
common
::
ObTabletID
&
tablet_id
);
static
int
check_transfer_seq_equal
(
const
ObTablet
&
tablet
,
const
int64_t
transfer_seq
);
static
int
check_
transfer_epoch_equal
(
const
ObTablet
&
tablet
,
const
int32_t
transfer_epoch
);
static
int
check_
private_transfer_epoch_equal
(
const
ObTablet
&
tablet
,
const
int32_t
private_
transfer_epoch
);
// migration section
// used for migration source generating create tablet rpc argument
...
...
@@ -583,7 +583,7 @@ public:
int64_t
get_snapshot_version
()
const
{
return
tablet_meta_
.
snapshot_version_
;
}
int64_t
get_multi_version_start
()
const
{
return
tablet_meta_
.
multi_version_start_
;
}
int64_t
get_transfer_seq
()
const
{
return
tablet_meta_
.
transfer_info_
.
transfer_seq_
;
}
int
get_private_transfer_epoch
(
int32_t
&
transfer_epoch
)
const
;
int
get_private_transfer_epoch
(
int32_t
&
private_
transfer_epoch
)
const
;
share
::
SCN
get_reorganization_scn
()
const
{
return
tablet_meta_
.
transfer_info_
.
transfer_start_scn_
;
}
int
get_multi_version_start
(
share
::
SCN
&
scn
)
const
;
int
get_snapshot_version
(
share
::
SCN
&
scn
)
const
;
...
...
src/storage/tablet/ob_tablet_mds_table_mini_merger.cpp
浏览文件 @
9cdc3091
...
...
@@ -633,7 +633,7 @@ int ObMdsDataCompatHelper::generate_mds_mini_sstable(
ctx
->
parallel_merge_ctx_
.
init_serial_merge
();
// only use concurrent_cnt for small sstable temp space optimization
if
(
OB_FAIL
(
tablet
.
get_private_transfer_epoch
(
ctx
->
static_desc_
.
private_transfer_epoch_
)))
{
LOG_WARN
(
"fail to get transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
LOG_WARN
(
"fail to get
private
transfer epoch"
,
K
(
ret
),
"tablet_meta"
,
tablet
.
get_tablet_meta
());
}
else
if
(
CLICK_FAIL
(
tablet
.
build_full_memory_mds_data
(
allocator
,
data
)))
{
LOG_WARN
(
"fail to build full memory mds data"
,
K
(
ret
));
}
else
{
...
...
unittest/storage/blocksstable/test_macro_block_id.cpp
浏览文件 @
9cdc3091
...
...
@@ -121,7 +121,7 @@ TEST_F(TestMacroBlockId, test_transfer_seq)
test_block_id
.
set_second_id
(
curr_opt
.
ss_private_tablet_opt_
.
ls_id_
);
test_block_id
.
set_third_id
(
curr_opt
.
ss_private_tablet_opt_
.
tablet_id_
);
test_block_id
.
set_meta_version_id
(
curr_opt
.
ss_private_tablet_opt_
.
version_
);
test_block_id
.
set_meta_
transfer_epoch
(
curr_opt
.
ss_private_tablet_opt_
.
tablet_transfer_seq
_
);
test_block_id
.
set_meta_
private_transfer_epoch
(
curr_opt
.
ss_private_tablet_opt_
.
tablet_private_transfer_epoch
_
);
OB_LOG
(
INFO
,
"after set"
);
hex_dump
(
&
test_block_id
.
fourth_id_
,
...
...
@@ -129,8 +129,8 @@ TEST_F(TestMacroBlockId, test_transfer_seq)
true
,
OB_LOG_LEVEL_WARN
);
OB_LOG
(
INFO
,
"show test_block_id"
,
K
(
test_block_id
),
K
(
test_block_id
.
meta_transfer_epoch
()),
K
(
test_block_id
.
meta_version_id
()));
int64_t
transfer_seq1
=
test_block_id
.
meta_transfer_epoch
();
OB_LOG
(
INFO
,
"show test_block_id"
,
K
(
test_block_id
),
K
(
test_block_id
.
meta_
private_
transfer_epoch
()),
K
(
test_block_id
.
meta_version_id
()));
int64_t
transfer_seq1
=
test_block_id
.
meta_
private_
transfer_epoch
();
OB_LOG
(
INFO
,
"transfer_seq1"
);
hex_dump
(
&
transfer_seq1
,
sizeof
(
int64_t
),
...
...
@@ -154,7 +154,7 @@ TEST_F(TestMacroBlockId, test_transfer_seq)
ASSERT_EQ
(
OB_INVALID_ARGUMENT
,
ret
);
ASSERT_EQ
(
0
,
pos
);
test_block_id
.
set_meta_transfer_epoch
(
0
);
test_block_id
.
set_meta_
private_
transfer_epoch
(
0
);
test_block_id
.
set_meta_version_id
(
100002
);
ret
=
test_block_id
.
serialize
(
buf
,
50
,
pos
);
...
...
unittest/storage/blocksstable/test_sstable_meta.cpp
浏览文件 @
9cdc3091
...
...
@@ -570,7 +570,7 @@ TEST_F(TestSSTableMacroInfo, test_huge_block_ids)
ObLinkedMacroInfoWriteParam
write_param
;
write_param
.
type_
=
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
;
write_param
.
tablet_id_
=
tablet_id
;
write_param
.
tablet_transfer_epoch_
=
0
;
write_param
.
tablet_
private_
transfer_epoch_
=
0
;
write_param
.
start_macro_seq_
=
macro_start_seq
;
ObSharedObjectsWriteCtx
linked_block_write_ctx
;
ObSArray
<
ObSharedObjectsWriteCtx
>
total_ctxs
;
...
...
@@ -650,7 +650,7 @@ TEST_F(TestSSTableMeta, test_common_sstable_persister_linked_block)
ObLinkedMacroInfoWriteParam
write_param
;
write_param
.
type_
=
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
;
write_param
.
tablet_id_
=
tablet_id
;
write_param
.
tablet_transfer_epoch_
=
0
;
write_param
.
tablet_
private_
transfer_epoch_
=
0
;
ASSERT_EQ
(
OB_SUCCESS
,
sstable
.
persist_linked_block_if_need
(
allocator_
,
write_param
,
...
...
@@ -734,7 +734,7 @@ TEST_F(TestSSTableMeta, test_huge_sstable_persister_linked_block)
ObLinkedMacroInfoWriteParam
write_param
;
write_param
.
type_
=
ObLinkedMacroBlockWriteType
::
PRIV_MACRO_INFO
;
write_param
.
tablet_id_
=
tablet_id
;
write_param
.
tablet_transfer_epoch_
=
0
;
write_param
.
tablet_
private_
transfer_epoch_
=
0
;
write_param
.
start_macro_seq_
=
macro_start_seq
;
ASSERT_EQ
(
OB_SUCCESS
,
sstable
.
persist_linked_block_if_need
(
allocator_
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录