Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
75d329f7
O
oceanbase
项目概览
clmforever
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
75d329f7
编写于
11月 14, 2022
作者:
Y
YoungYang0820
提交者:
wangzelin.wzl
11月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
acquire snapshot for lob tablet when doing ddl
上级
9875d033
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
171 addition
and
1 deletion
+171
-1
src/rootserver/ddl_task/ob_constraint_task.cpp
src/rootserver/ddl_task/ob_constraint_task.cpp
+32
-0
src/rootserver/ddl_task/ob_ddl_redefinition_task.cpp
src/rootserver/ddl_task/ob_ddl_redefinition_task.cpp
+50
-0
src/rootserver/ddl_task/ob_index_build_task.cpp
src/rootserver/ddl_task/ob_index_build_task.cpp
+86
-1
src/rootserver/ddl_task/ob_index_build_task.h
src/rootserver/ddl_task/ob_index_build_task.h
+3
-0
未找到文件。
src/rootserver/ddl_task/ob_constraint_task.cpp
浏览文件 @
75d329f7
...
...
@@ -600,14 +600,30 @@ int ObConstraintTask::hold_snapshot(const int64_t snapshot_version)
int
ret
=
OB_SUCCESS
;
ObDDLService
&
ddl_service
=
root_service_
->
get_ddl_service
();
ObSEArray
<
ObTabletID
,
1
>
tablet_ids
;
ObSchemaGetterGuard
schema_guard
;
const
ObTableSchema
*
table_schema
=
nullptr
;
ObMultiVersionSchemaService
&
schema_service
=
ObMultiVersionSchemaService
::
get_instance
();
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObConstraintTask has not been inited"
,
K
(
ret
));
}
else
if
(
OB_UNLIKELY
(
snapshot_version
<
0
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
snapshot_version
));
}
else
if
(
OB_FAIL
(
schema_service
.
get_tenant_schema_guard
(
tenant_id_
,
schema_guard
)))
{
LOG_WARN
(
"get tenant schema guard failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
object_id_
,
table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
object_id_
));
}
else
if
(
OB_ISNULL
(
table_schema
))
{
ret
=
OB_TABLE_NOT_EXIST
;
LOG_WARN
(
"table not exist"
,
K
(
ret
),
K
(
object_id_
),
K
(
target_object_id_
),
KP
(
table_schema
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
object_id_
,
tablet_ids
)))
{
LOG_WARN
(
"failed to get tablet snapshots"
,
K
(
ret
));
}
else
if
(
table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob meta table snapshot"
,
K
(
ret
));
}
else
if
(
table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob piece table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ddl_service
.
get_snapshot_mgr
().
batch_acquire_snapshot
(
ddl_service
.
get_sql_proxy
(),
SNAPSHOT_FOR_DDL
,
tenant_id_
,
schema_version_
,
snapshot_version
,
nullptr
,
tablet_ids
)))
{
LOG_WARN
(
"acquire snapshot failed"
,
K
(
ret
),
K
(
tablet_ids
));
...
...
@@ -622,15 +638,31 @@ int ObConstraintTask::release_snapshot(const int64_t snapshot_version)
int
ret
=
OB_SUCCESS
;
ObDDLService
&
ddl_service
=
root_service_
->
get_ddl_service
();
ObSEArray
<
ObTabletID
,
1
>
tablet_ids
;
ObSchemaGetterGuard
schema_guard
;
const
ObTableSchema
*
table_schema
=
nullptr
;
ObMultiVersionSchemaService
&
schema_service
=
ObMultiVersionSchemaService
::
get_instance
();
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObConstraintTask has not been inited"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_service
.
get_tenant_schema_guard
(
tenant_id_
,
schema_guard
)))
{
LOG_WARN
(
"get tenant schema guard failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
object_id_
,
table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
object_id_
));
}
else
if
(
OB_ISNULL
(
table_schema
))
{
ret
=
OB_TABLE_NOT_EXIST
;
LOG_WARN
(
"table not exist"
,
K
(
ret
),
K
(
object_id_
),
K
(
target_object_id_
),
KP
(
table_schema
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
object_id_
,
tablet_ids
)))
{
if
(
OB_TABLE_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
}
else
{
LOG_WARN
(
"failed to get tablet snapshots"
,
K
(
ret
));
}
}
else
if
(
table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob meta table snapshot"
,
K
(
ret
));
}
else
if
(
table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob piece table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
batch_release_snapshot
(
snapshot_version
,
tablet_ids
)))
{
LOG_WARN
(
"failed to release snapshots"
,
K
(
ret
));
}
...
...
src/rootserver/ddl_task/ob_ddl_redefinition_task.cpp
浏览文件 @
75d329f7
...
...
@@ -312,6 +312,10 @@ int ObDDLRedefinitionTask::hold_snapshot(const int64_t snapshot_version)
int
ret
=
OB_SUCCESS
;
ObRootService
*
root_service
=
GCTX
.
root_service_
;
ObSEArray
<
ObTabletID
,
1
>
tablet_ids
;
ObSchemaGetterGuard
schema_guard
;
const
ObTableSchema
*
data_table_schema
=
nullptr
;
const
ObTableSchema
*
dest_table_schema
=
nullptr
;
ObMultiVersionSchemaService
&
schema_service
=
ObMultiVersionSchemaService
::
get_instance
();
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ObDDLRedefinitionTask has not been inited"
,
K
(
ret
));
...
...
@@ -321,10 +325,31 @@ int ObDDLRedefinitionTask::hold_snapshot(const int64_t snapshot_version)
}
else
if
(
OB_UNLIKELY
(
snapshot_version
<
0
))
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid arguments"
,
K
(
ret
),
K
(
snapshot_version
));
}
else
if
(
OB_FAIL
(
schema_service
.
get_tenant_schema_guard
(
tenant_id_
,
schema_guard
)))
{
LOG_WARN
(
"get tenant schema guard failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
object_id_
,
data_table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
object_id_
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
target_object_id_
,
dest_table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
target_object_id_
));
}
else
if
(
OB_ISNULL
(
data_table_schema
)
||
OB_ISNULL
(
dest_table_schema
))
{
ret
=
OB_TABLE_NOT_EXIST
;
LOG_WARN
(
"table not exist"
,
K
(
ret
),
K
(
object_id_
),
K
(
target_object_id_
),
KP
(
data_table_schema
),
KP
(
dest_table_schema
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
object_id_
,
tablet_ids
)))
{
LOG_WARN
(
"failed to get data table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
target_object_id_
,
tablet_ids
)))
{
LOG_WARN
(
"failed to get dest table snapshot"
,
K
(
ret
));
}
else
if
(
data_table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob meta table snapshot"
,
K
(
ret
));
}
else
if
(
data_table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob piece table snapshot"
,
K
(
ret
));
}
else
if
(
dest_table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
dest_table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get dest lob meta table snapshot"
,
K
(
ret
));
}
else
if
(
dest_table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
dest_table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get dest lob piece table snapshot"
,
K
(
ret
));
}
else
{
ObDDLService
&
ddl_service
=
root_service
->
get_ddl_service
();
if
(
OB_FAIL
(
ddl_service
.
get_snapshot_mgr
().
batch_acquire_snapshot
(
...
...
@@ -341,16 +366,41 @@ int ObDDLRedefinitionTask::release_snapshot(const int64_t snapshot_version)
int
ret
=
OB_SUCCESS
;
ObRootService
*
root_service
=
GCTX
.
root_service_
;
ObSEArray
<
ObTabletID
,
1
>
tablet_ids
;
ObSchemaGetterGuard
schema_guard
;
const
ObTableSchema
*
data_table_schema
=
nullptr
;
const
ObTableSchema
*
dest_table_schema
=
nullptr
;
ObMultiVersionSchemaService
&
schema_service
=
ObMultiVersionSchemaService
::
get_instance
();
if
(
OB_UNLIKELY
(
!
is_inited_
))
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not init"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
root_service
))
{
ret
=
OB_ERR_SYS
;
LOG_WARN
(
"error sys, root service must not be nullptr"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_service
.
get_tenant_schema_guard
(
tenant_id_
,
schema_guard
)))
{
LOG_WARN
(
"get tenant schema guard failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
object_id_
,
data_table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
object_id_
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
target_object_id_
,
dest_table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
target_object_id_
));
}
else
if
(
OB_ISNULL
(
data_table_schema
)
||
OB_ISNULL
(
dest_table_schema
))
{
ret
=
OB_TABLE_NOT_EXIST
;
LOG_WARN
(
"table not exist"
,
K
(
ret
),
K
(
object_id_
),
K
(
target_object_id_
),
KP
(
data_table_schema
),
KP
(
dest_table_schema
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
object_id_
,
tablet_ids
)))
{
LOG_WARN
(
"failed to get data table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
target_object_id_
,
tablet_ids
)))
{
LOG_WARN
(
"failed to get dest table snapshot"
,
K
(
ret
));
}
else
if
(
data_table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob meta table snapshot"
,
K
(
ret
));
}
else
if
(
data_table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob piece table snapshot"
,
K
(
ret
));
}
else
if
(
dest_table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
dest_table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get dest lob meta table snapshot"
,
K
(
ret
));
}
else
if
(
dest_table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
dest_table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get dest lob piece table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
batch_release_snapshot
(
snapshot_version
,
tablet_ids
)))
{
LOG_WARN
(
"failed to release snapshot"
,
K
(
ret
));
}
...
...
src/rootserver/ddl_task/ob_index_build_task.cpp
浏览文件 @
75d329f7
...
...
@@ -532,10 +532,32 @@ int ObIndexBuildTask::hold_snapshot(const int64_t snapshot)
}
else
{
ObDDLService
&
ddl_service
=
root_service_
->
get_ddl_service
();
ObSEArray
<
ObTabletID
,
2
>
tablet_ids
;
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
object_id_
,
tablet_ids
)))
{
ObSchemaGetterGuard
schema_guard
;
const
ObTableSchema
*
data_table_schema
=
nullptr
;
const
ObTableSchema
*
index_table_schema
=
nullptr
;
ObMultiVersionSchemaService
&
schema_service
=
ObMultiVersionSchemaService
::
get_instance
();
bool
need_acquire_lob
=
false
;
if
(
OB_FAIL
(
schema_service
.
get_tenant_schema_guard
(
tenant_id_
,
schema_guard
)))
{
LOG_WARN
(
"get tenant schema guard failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
object_id_
,
data_table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
object_id_
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
target_object_id_
,
index_table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
target_object_id_
));
}
else
if
(
OB_ISNULL
(
data_table_schema
)
||
OB_ISNULL
(
index_table_schema
))
{
ret
=
OB_TABLE_NOT_EXIST
;
LOG_WARN
(
"table not exist"
,
K
(
ret
),
K
(
object_id_
),
K
(
target_object_id_
),
KP
(
data_table_schema
),
KP
(
index_table_schema
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
object_id_
,
tablet_ids
)))
{
LOG_WARN
(
"failed to get data table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
target_object_id_
,
tablet_ids
)))
{
LOG_WARN
(
"failed to get dest table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
check_need_acquire_lob_snapshot
(
data_table_schema
,
index_table_schema
,
need_acquire_lob
)))
{
LOG_WARN
(
"failed to check if need to acquire lob snapshot"
,
K
(
ret
));
}
else
if
(
need_acquire_lob
&&
data_table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob meta table snapshot"
,
K
(
ret
));
}
else
if
(
need_acquire_lob
&&
data_table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
LOG_WARN
(
"failed to get data lob piece table snapshot"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ddl_service
.
get_snapshot_mgr
().
batch_acquire_snapshot
(
ddl_service
.
get_sql_proxy
(),
SNAPSHOT_FOR_DDL
,
tenant_id_
,
schema_version_
,
snapshot
,
nullptr
,
tablet_ids
)))
{
LOG_WARN
(
"batch acquire snapshot failed"
,
K
(
ret
),
K
(
tablet_ids
));
...
...
@@ -554,6 +576,9 @@ int ObIndexBuildTask::release_snapshot(const int64_t snapshot)
}
else
{
ObDDLService
&
ddl_service
=
root_service_
->
get_ddl_service
();
ObSEArray
<
ObTabletID
,
2
>
tablet_ids
;
ObSchemaGetterGuard
schema_guard
;
const
ObTableSchema
*
data_table_schema
=
nullptr
;
ObMultiVersionSchemaService
&
schema_service
=
ObMultiVersionSchemaService
::
get_instance
();
if
(
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
object_id_
,
tablet_ids
)))
{
if
(
OB_TABLE_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
...
...
@@ -567,6 +592,29 @@ int ObIndexBuildTask::release_snapshot(const int64_t snapshot)
LOG_WARN
(
"failed to get dest table snapshot"
,
K
(
ret
));
}
}
if
(
OB_FAIL
(
ret
))
{
}
else
if
(
OB_FAIL
(
schema_service
.
get_tenant_schema_guard
(
tenant_id_
,
schema_guard
)))
{
LOG_WARN
(
"get tenant schema guard failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
object_id_
,
data_table_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
),
K
(
object_id_
));
}
else
if
(
OB_ISNULL
(
data_table_schema
))
{
LOG_INFO
(
"table not exist"
,
K
(
ret
),
K
(
object_id_
),
K
(
target_object_id_
),
KP
(
data_table_schema
));
}
else
if
(
data_table_schema
->
get_aux_lob_meta_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_meta_tid
(),
tablet_ids
)))
{
if
(
OB_TABLE_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
}
else
{
LOG_WARN
(
"failed to get data lob meta table snapshot"
,
K
(
ret
));
}
}
else
if
(
data_table_schema
->
get_aux_lob_piece_tid
()
!=
OB_INVALID_ID
&&
OB_FAIL
(
ObDDLUtil
::
get_tablets
(
tenant_id_
,
data_table_schema
->
get_aux_lob_piece_tid
(),
tablet_ids
)))
{
if
(
OB_TABLE_NOT_EXIST
==
ret
)
{
ret
=
OB_SUCCESS
;
}
else
{
LOG_WARN
(
"failed to get data lob piece table snapshot"
,
K
(
ret
));
}
}
if
(
OB_SUCC
(
ret
)
&&
tablet_ids
.
count
()
>
0
&&
OB_FAIL
(
batch_release_snapshot
(
snapshot
,
tablet_ids
)))
{
LOG_WARN
(
"batch relase snapshot failed"
,
K
(
ret
),
K
(
tablet_ids
));
}
...
...
@@ -738,6 +786,43 @@ int ObIndexBuildTask::check_need_verify_checksum(bool &need_verify)
return
ret
;
}
int
ObIndexBuildTask
::
check_need_acquire_lob_snapshot
(
const
ObTableSchema
*
data_table_schema
,
const
ObTableSchema
*
index_table_schema
,
bool
&
need_acquire
)
{
int
ret
=
OB_SUCCESS
;
need_acquire
=
false
;
ObTableSchema
::
const_column_iterator
iter
=
index_table_schema
->
column_begin
();
ObTableSchema
::
const_column_iterator
iter_end
=
index_table_schema
->
column_end
();
for
(;
OB_SUCC
(
ret
)
&&
!
need_acquire
&&
iter
!=
iter_end
;
iter
++
)
{
const
ObColumnSchemaV2
*
index_col
=
*
iter
;
if
(
OB_ISNULL
(
index_col
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"column schema is null"
,
K
(
ret
));
}
else
{
const
ObColumnSchemaV2
*
col
=
data_table_schema
->
get_column_schema
(
index_col
->
get_column_id
());
if
(
OB_ISNULL
(
col
))
{
}
else
if
(
col
->
is_generated_column
())
{
ObSEArray
<
uint64_t
,
8
>
ref_columns
;
if
(
OB_FAIL
(
col
->
get_cascaded_column_ids
(
ref_columns
)))
{
STORAGE_LOG
(
WARN
,
"Failed to get cascaded column ids"
,
K
(
ret
));
}
else
{
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
!
need_acquire
&&
i
<
ref_columns
.
count
();
i
++
)
{
const
ObColumnSchemaV2
*
data_table_col
=
data_table_schema
->
get_column_schema
(
ref_columns
.
at
(
i
));
if
(
OB_ISNULL
(
data_table_col
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"column schema is null"
,
K
(
ret
));
}
else
if
(
is_lob_v2
(
data_table_col
->
get_data_type
()))
{
need_acquire
=
true
;
}
}
}
}
}
}
return
ret
;
}
// verify column checksum between data table and index table
int
ObIndexBuildTask
::
verify_checksum
()
{
...
...
src/rootserver/ddl_task/ob_index_build_task.h
浏览文件 @
75d329f7
...
...
@@ -123,6 +123,9 @@ private:
int
send_build_single_replica_request
();
int
check_build_single_replica
(
bool
&
is_end
);
int
check_need_verify_checksum
(
bool
&
need_verify
);
int
check_need_acquire_lob_snapshot
(
const
ObTableSchema
*
data_table_schema
,
const
ObTableSchema
*
index_table_schema
,
bool
&
need_acquire
);
private:
static
const
int64_t
OB_INDEX_BUILD_TASK_VERSION
=
1
;
using
ObDDLTask
::
is_inited_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录