Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
c7ab0dbf
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,体验更适合开发者的 AI 搜索 >>
提交
c7ab0dbf
编写于
3月 02, 2023
作者:
R
renju96
提交者:
ob-robot
3月 02, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
child__ddl_task errnum did't pass to father_task
上级
fe94e4d3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
8 deletion
+21
-8
src/share/ob_ddl_error_message_table_operator.cpp
src/share/ob_ddl_error_message_table_operator.cpp
+5
-3
src/share/ob_ddl_error_message_table_operator.h
src/share/ob_ddl_error_message_table_operator.h
+3
-2
src/storage/ddl/ob_build_index_task.cpp
src/storage/ddl/ob_build_index_task.cpp
+6
-1
src/storage/ddl/ob_direct_insert_sstable_ctx.cpp
src/storage/ddl/ob_direct_insert_sstable_ctx.cpp
+7
-2
未找到文件。
src/share/ob_ddl_error_message_table_operator.cpp
浏览文件 @
c7ab0dbf
...
...
@@ -346,7 +346,8 @@ int ObDDLErrorMessageTableOperator::build_ddl_error_message(
const
ObString
index_name
,
const
uint64_t
index_id
,
const
ObDDLType
ddl_type
,
const
char
*
message
)
const
char
*
message
,
int
&
report_ret_code
)
{
int
ret
=
OB_SUCCESS
;
int
tmp_ret_code
=
ret_code
;
...
...
@@ -362,6 +363,7 @@ int ObDDLErrorMessageTableOperator::build_ddl_error_message(
}
else
{
if
(
OB_ERR_PRIMARY_KEY_DUPLICATE
==
tmp_ret_code
)
{
tmp_ret_code
=
OB_ERR_DUPLICATED_UNIQUE_KEY
;
//error message of OB_ERR_PRIMARY_KEY_DUPLICATE is not compatiable with oracle, so use a new error code
report_ret_code
=
tmp_ret_code
;
}
error_message
.
ret_code_
=
tmp_ret_code
;
error_message
.
ddl_type_
=
ddl_type
;
...
...
@@ -402,7 +404,7 @@ int ObDDLErrorMessageTableOperator::build_ddl_error_message(
int
ObDDLErrorMessageTableOperator
::
generate_index_ddl_error_message
(
const
int
ret_code
,
const
ObTableSchema
&
index_schema
,
const
int64_t
task_id
,
const
int64_t
object_id
,
const
ObAddr
&
addr
,
ObMySQLProxy
&
sql_proxy
,
const
char
*
index_key
)
ObMySQLProxy
&
sql_proxy
,
const
char
*
index_key
,
int
&
report_ret_code
)
{
int
ret
=
OB_SUCCESS
;
ObBuildDDLErrorMessage
error_message
;
...
...
@@ -420,7 +422,7 @@ int ObDDLErrorMessageTableOperator::generate_index_ddl_error_message(const int r
}
else
if
(
OB_FAIL
(
index_schema
.
get_index_name
(
index_name
)))
{
//get index name
LOG_WARN
(
"fail to get index name"
,
K
(
ret
),
K
(
index_name
),
K
(
index_table_id
));
}
else
if
(
OB_FAIL
(
build_ddl_error_message
(
ret_code
,
index_schema
.
get_tenant_id
(),
data_table_id
,
error_message
,
index_name
,
index_table_id
,
DDL_CREATE_INDEX
,
index_key
)))
{
index_table_id
,
DDL_CREATE_INDEX
,
index_key
,
report_ret_code
)))
{
LOG_WARN
(
"build ddl error message failed"
,
K
(
ret
),
K
(
data_table_id
),
K
(
index_name
));
}
else
if
(
OB_FAIL
(
report_ddl_error_message
(
error_message
,
//report into __all_ddl_error_message
tenant_id
,
task_id
,
data_table_id
,
schema_version
,
object_id
,
addr
,
sql_proxy
)))
{
...
...
src/share/ob_ddl_error_message_table_operator.h
浏览文件 @
c7ab0dbf
...
...
@@ -65,9 +65,10 @@ public:
const
common
::
ObAddr
&
addr
,
common
::
ObMySQLProxy
&
sql_proxy
);
static
int
build_ddl_error_message
(
const
int
ret_code
,
const
uint64_t
tenant_id
,
const
uint64_t
table_id
,
ObBuildDDLErrorMessage
&
error_message
,
const
common
::
ObString
index_name
,
const
uint64_t
index_id
,
const
ObDDLType
ddl_type
,
const
char
*
message
);
const
uint64_t
index_id
,
const
ObDDLType
ddl_type
,
const
char
*
message
,
int
&
report_ret_code
);
static
int
generate_index_ddl_error_message
(
const
int
ret_code
,
const
share
::
schema
::
ObTableSchema
&
index_schema
,
const
int64_t
task_id
,
const
int64_t
object_id
,
const
common
::
ObAddr
&
addr
,
common
::
ObMySQLProxy
&
sql_proxy
,
const
char
*
index_key
);
const
int64_t
task_id
,
const
int64_t
object_id
,
const
common
::
ObAddr
&
addr
,
common
::
ObMySQLProxy
&
sql_proxy
,
const
char
*
index_key
,
int
&
report_ret_code
);
};
}
// end namespace share
}
// end namespace oceanbase
...
...
src/storage/ddl/ob_build_index_task.cpp
浏览文件 @
c7ab0dbf
...
...
@@ -539,6 +539,7 @@ int ObUniqueIndexChecker::check_unique_index(ObIDag *dag)
}
if
(
is_inited_
&&
need_report_error_msg
)
{
int
tmp_ret
=
OB_SUCCESS
;
int
report_ret_code
=
OB_SUCCESS
;
const
ObAddr
&
self_addr
=
GCTX
.
self_addr
();
bool
keep_report_err_msg
=
true
;
LOG_INFO
(
"begin to report build index status & ddl error message"
,
K
(
index_schema_
->
get_table_id
()),
K
(
*
index_schema_
),
K
(
tablet_id_
));
...
...
@@ -552,11 +553,15 @@ int ObUniqueIndexChecker::check_unique_index(ObIDag *dag)
LOG_INFO
(
"get task id failed, but retry to get it"
,
K
(
ret
),
K
(
tmp_ret
),
KPC
(
index_schema_
));
}
}
else
if
(
OB_SUCCESS
!=
(
tmp_ret
=
ObDDLErrorMessageTableOperator
::
generate_index_ddl_error_message
(
ret
,
*
index_schema_
,
task_id
,
tablet_id_
.
id
(),
self_addr
,
*
GCTX
.
sql_proxy_
,
"
\0
"
)))
{
ret
,
*
index_schema_
,
task_id
,
tablet_id_
.
id
(),
self_addr
,
*
GCTX
.
sql_proxy_
,
"
\0
"
,
report_ret_code
)))
{
LOG_WARN
(
"fail to generate index ddl error message"
,
K
(
ret
),
K
(
tmp_ret
),
KPC
(
index_schema_
),
K
(
tablet_id_
),
K
(
self_addr
));
ob_usleep
(
RETRY_INTERVAL
);
dag_yield
();
}
else
{
if
(
OB_ERR_PRIMARY_KEY_DUPLICATE
==
ret
&&
OB_ERR_DUPLICATED_UNIQUE_KEY
==
report_ret_code
)
{
//error message of OB_ERR_PRIMARY_KEY_DUPLICATE is not compatiable with oracle, so use a new error code
ret
=
OB_ERR_DUPLICATED_UNIQUE_KEY
;
}
keep_report_err_msg
=
false
;
}
...
...
src/storage/ddl/ob_direct_insert_sstable_ctx.cpp
浏览文件 @
c7ab0dbf
...
...
@@ -553,6 +553,7 @@ int ObSSTableInsertTabletContext::build_sstable_slice(
break
;
}
else
if
(
!
ddl_committed
&&
OB_FAIL
(
sstable_slice_writer
->
append_row
(
*
row_val
)))
{
int
tmp_ret
=
OB_SUCCESS
;
int
report_ret_code
=
OB_SUCCESS
;
if
(
OB_ERR_PRIMARY_KEY_DUPLICATE
==
ret
&&
table_schema
->
is_unique_index
())
{
LOG_USER_ERROR
(
OB_ERR_PRIMARY_KEY_DUPLICATE
,
""
,
static_cast
<
int
>
(
sizeof
(
"UNIQUE IDX"
)
-
1
),
"UNIQUE IDX"
);
...
...
@@ -566,8 +567,12 @@ int ObSSTableInsertTabletContext::build_sstable_slice(
}
else
if
(
OB_TMP_FAIL
(
ObDDLErrorMessageTableOperator
::
get_index_task_id
(
*
GCTX
.
sql_proxy_
,
*
table_schema
,
task_id
)))
{
LOG_WARN
(
"get task id of index table failed"
,
K
(
tmp_ret
),
K
(
task_id
),
KPC
(
table_schema
));
}
else
if
(
OB_TMP_FAIL
(
ObDDLErrorMessageTableOperator
::
generate_index_ddl_error_message
(
ret
,
*
table_schema
,
task_id
,
row_tablet_id
.
id
(),
GCTX
.
self_addr
(),
*
GCTX
.
sql_proxy_
,
index_key_buffer
)))
{
LOG_WARN
(
"generate index ddl error message"
,
K
(
tmp_ret
),
K
(
ret
));
task_id
,
row_tablet_id
.
id
(),
GCTX
.
self_addr
(),
*
GCTX
.
sql_proxy_
,
index_key_buffer
,
report_ret_code
)))
{
LOG_WARN
(
"generate index ddl error message"
,
K
(
tmp_ret
),
K
(
ret
),
K
(
report_ret_code
));
}
if
(
OB_ERR_DUPLICATED_UNIQUE_KEY
==
report_ret_code
)
{
//error message of OB_ERR_PRIMARY_KEY_DUPLICATE is not compatiable with oracle, so use a new error code
ret
=
OB_ERR_DUPLICATED_UNIQUE_KEY
;
}
}
else
if
(
OB_TRANS_COMMITED
==
ret
)
{
ret
=
OB_SUCCESS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录