Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
1c5798c4
O
oceanbase
项目概览
oceanbase
/
oceanbase
9 个月 前同步成功
通知
261
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1c5798c4
编写于
11月 29, 2022
作者:
H
Hongqin-Li
提交者:
OB-robot
11月 29, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] Fix schema guard reset due to double get_tenant_schema_guard
上级
2ce29562
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
7 deletion
+10
-7
src/rootserver/ddl_task/ob_column_redefinition_task.cpp
src/rootserver/ddl_task/ob_column_redefinition_task.cpp
+5
-3
src/rootserver/ob_ddl_service.cpp
src/rootserver/ob_ddl_service.cpp
+3
-4
src/rootserver/ob_ddl_service.h
src/rootserver/ob_ddl_service.h
+1
-0
src/rootserver/ob_index_builder.cpp
src/rootserver/ob_index_builder.cpp
+1
-0
未找到文件。
src/rootserver/ddl_task/ob_column_redefinition_task.cpp
浏览文件 @
1c5798c4
...
...
@@ -261,6 +261,10 @@ int ObColumnRedefinitionTask::copy_table_indexes()
}
DEBUG_SYNC
(
COLUMN_REDEFINITION_COPY_TABLE_INDEXES
);
if
(
OB_SUCC
(
ret
)
&&
index_ids
.
count
()
>
0
)
{
ObSchemaGetterGuard
new_schema_guard
;
if
(
OB_FAIL
(
root_service
->
get_ddl_service
().
get_tenant_schema_guard_with_version_in_inner_table
(
tenant_id_
,
new_schema_guard
)))
{
LOG_WARN
(
"failed to refresh schema guard"
,
K
(
ret
));
}
for
(
int64_t
i
=
0
;
OB_SUCC
(
ret
)
&&
i
<
index_ids
.
count
();
++
i
)
{
const
uint64_t
index_id
=
index_ids
.
at
(
i
);
const
ObTableSchema
*
index_schema
=
nullptr
;
...
...
@@ -271,9 +275,7 @@ int ObColumnRedefinitionTask::copy_table_indexes()
create_index_arg
.
nls_date_format_
=
alter_table_arg_
.
nls_formats_
[
0
];
create_index_arg
.
nls_timestamp_format_
=
alter_table_arg_
.
nls_formats_
[
1
];
create_index_arg
.
nls_timestamp_tz_format_
=
alter_table_arg_
.
nls_formats_
[
2
];
if
(
OB_FAIL
(
root_service
->
get_ddl_service
().
get_tenant_schema_guard_with_version_in_inner_table
(
tenant_id_
,
schema_guard
)))
{
LOG_WARN
(
"get schema guard failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
schema_guard
.
get_table_schema
(
tenant_id_
,
index_ids
.
at
(
i
),
index_schema
)))
{
if
(
OB_FAIL
(
new_schema_guard
.
get_table_schema
(
tenant_id_
,
index_ids
.
at
(
i
),
index_schema
)))
{
LOG_WARN
(
"get table schema failed"
,
K
(
ret
));
}
else
if
(
OB_ISNULL
(
index_schema
))
{
ret
=
OB_ERR_SYS
;
...
...
src/rootserver/ob_ddl_service.cpp
浏览文件 @
1c5798c4
...
...
@@ -4995,6 +4995,7 @@ int ObDDLService::alter_table_index(const obrpc::ObAlterTableArg &alter_table_ar
if (OB_FAIL(rename_dropping_index_name(origin_table_schema.get_table_id(),
origin_table_schema.get_database_id(),
*drop_index_arg,
schema_guard,
ddl_operator,
trans,
new_index_schema))) {
...
...
@@ -5813,9 +5814,7 @@ int ObDDLService::get_index_schema_by_name(
const ObString &index_name = drop_index_arg.index_name_;
//build index name and get index schema
if (OB_FAIL(schema_service_->get_tenant_schema_guard(tenant_id, schema_guard))) {
LOG_WARN("failed to get schema guard", K(ret));
} else if (OB_FAIL(ObTableSchema::build_index_table_name(allocator,
if (OB_FAIL(ObTableSchema::build_index_table_name(allocator,
data_table_id,
index_name,
index_table_name))) {
...
...
@@ -5847,12 +5846,12 @@ int ObDDLService::rename_dropping_index_name(
const uint64_t data_table_id,
const uint64_t database_id,
const ObDropIndexArg &drop_index_arg,
ObSchemaGetterGuard &schema_guard,
ObDDLOperator &ddl_operator,
common::ObMySQLTransaction &trans,
share::schema::ObTableSchema &new_index_schema)
{
int ret = OB_SUCCESS;
ObSchemaGetterGuard schema_guard;
const ObTableSchema *index_table_schema = nullptr;
int nwrite = 0;
const int64_t buf_size = number::ObNumber::MAX_PRINTABLE_SIZE;
src/rootserver/ob_ddl_service.h
浏览文件 @
1c5798c4
...
...
@@ -938,6 +938,7 @@ public:
const
uint64_t
data_table_id
,
const
uint64_t
database_id
,
const
obrpc
::
ObDropIndexArg
&
drop_index_arg
,
ObSchemaGetterGuard
&
schema_guard
,
ObDDLOperator
&
ddl_operator
,
ObMySQLTransaction
&
trans
,
share
::
schema
::
ObTableSchema
&
new_index_schema
);
...
...
src/rootserver/ob_index_builder.cpp
浏览文件 @
1c5798c4
...
...
@@ -181,6 +181,7 @@ int ObIndexBuilder::drop_index(const ObDropIndexArg &arg, obrpc::ObDropIndexRes
table_schema
->
get_table_id
(),
table_schema
->
get_database_id
(),
arg
,
schema_guard
,
ddl_operator
,
trans
,
new_index_schema
)))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录