Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
2b43f09c
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2b43f09c
编写于
11月 17, 2021
作者:
Y
yishenglanlingzui
提交者:
LINGuanRen
11月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cp] fix bug remote_exec cover the err_code
上级
db982ff1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
44 deletion
+41
-44
src/sql/executor/ob_remote_executor_processor.cpp
src/sql/executor/ob_remote_executor_processor.cpp
+41
-44
未找到文件。
src/sql/executor/ob_remote_executor_processor.cpp
浏览文件 @
2b43f09c
...
...
@@ -408,58 +408,55 @@ int ObRemoteBaseExecuteP<T>::auto_end_phy_trans(bool is_rollback, const ObPartit
{
int
ret
=
OB_SUCCESS
;
int
end_ret
=
OB_SUCCESS
;
if
(
trans_state_
.
is_start_participant_executed
()
&&
trans_state_
.
is_start_participant_success
())
{
if
(
OB_SUCCESS
!=
(
end_ret
=
ObSqlTransControl
::
end_participant
(
exec_ctx_
,
is_rollback
,
participants
)))
{
ret
=
(
OB_SUCCESS
==
ret
)
?
end_ret
:
ret
;
LOG_WARN
(
"fail to end participant"
,
K
(
ret
),
K
(
end_ret
),
K
(
is_rollback
),
K
(
participants
),
K
(
exec_ctx_
));
}
trans_state_
.
clear_start_participant_executed
();
bool
ac
=
false
;
ObEndTransSyncCallback
callback
;
ObSQLSessionInfo
*
my_session
=
GET_MY_SESSION
(
exec_ctx_
);
if
(
OB_ISNULL
(
my_session
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"ret is OB_SUCCESS, but session is NULL"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
my_session
->
get_autocommit
(
ac
)))
{
LOG_WARN
(
"fail to get autocommit"
,
K
(
ret
));
}
if
(
trans_state_
.
is_start_stmt_executed
()
&&
trans_state_
.
is_start_stmt_success
())
{
if
(
OB_SUCCESS
!=
(
end_ret
=
ObSqlTransControl
::
end_stmt
(
exec_ctx_
,
is_rollback
||
OB_SUCCESS
!=
ret
)))
{
ret
=
(
OB_SUCCESS
==
ret
)
?
end_ret
:
ret
;
LOG_WARN
(
"fail to end stmt"
,
K
(
ret
),
K
(
end_ret
),
K
(
is_rollback
),
K
(
exec_ctx_
));
if
(
OB_SUCC
(
ret
))
{
if
(
trans_state_
.
is_start_participant_executed
()
&&
trans_state_
.
is_start_participant_success
())
{
if
(
OB_SUCCESS
!=
(
end_ret
=
ObSqlTransControl
::
end_participant
(
exec_ctx_
,
is_rollback
,
participants
)))
{
ret
=
(
OB_SUCCESS
==
ret
)
?
end_ret
:
ret
;
LOG_WARN
(
"fail to end participant"
,
K
(
ret
),
K
(
end_ret
),
K
(
is_rollback
),
K
(
participants
),
K
(
exec_ctx_
));
}
trans_state_
.
clear_start_participant_executed
();
}
trans_state_
.
clear_start_stmt_executed
();
}
if
(
trans_state_
.
is_start_trans_executed
()
&&
trans_state_
.
is_start_trans_success
())
{
ObSQLSessionInfo
*
my_session
=
GET_MY_SESSION
(
exec_ctx_
);
if
(
OB_ISNULL
(
my_session
))
{
if
(
OB_SUCC
(
ret
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_ERROR
(
"ret is OB_SUCCESS, but session is NULL"
,
K
(
ret
));
}
else
{
LOG_ERROR
(
"ret is not OB_SUCCESS, and session is NULL"
,
K
(
ret
));
if
(
trans_state_
.
is_start_stmt_executed
()
&&
trans_state_
.
is_start_stmt_success
())
{
if
(
OB_SUCCESS
!=
(
end_ret
=
ObSqlTransControl
::
end_stmt
(
exec_ctx_
,
is_rollback
||
OB_SUCCESS
!=
ret
)))
{
ret
=
(
OB_SUCCESS
==
ret
)
?
end_ret
:
ret
;
LOG_WARN
(
"fail to end stmt"
,
K
(
ret
),
K
(
end_ret
),
K
(
is_rollback
),
K
(
exec_ctx_
));
}
}
else
{
trans_state_
.
clear_start_stmt_executed
();
}
if
(
trans_state_
.
is_start_trans_executed
()
&&
trans_state_
.
is_start_trans_success
())
{
bool
in_trans
=
my_session
->
get_in_transaction
();
bool
ac
=
false
;
if
(
OB_FAIL
(
my_session
->
get_autocommit
(
ac
)))
{
LOG_WARN
(
"fail to get autocommit"
,
K
(
ret
));
}
else
if
(
ObSqlTransUtil
::
plan_can_end_trans
(
ac
,
in_trans
))
{
if
(
ObSqlTransUtil
::
plan_can_end_trans
(
ac
,
in_trans
))
{
if
(
!
my_session
->
is_standalone_stmt
())
{
ObEndTransSyncCallback
callback
;
is_rollback
=
(
is_rollback
||
OB_SUCCESS
!=
ret
);
if
(
OB_FAIL
(
callback
.
init
(
&
(
my_session
->
get_trans_desc
()),
my_session
)))
{
if
(
OB_SUCCESS
!=
(
end_ret
=
callback
.
init
(
&
(
my_session
->
get_trans_desc
()),
my_session
)))
{
ret
=
(
OB_SUCCESS
==
ret
)
?
end_ret
:
ret
;
LOG_WARN
(
"fail init callback"
,
K
(
ret
));
}
else
{
int
wait_ret
=
OB_SUCCESS
;
if
(
OB_SUCCESS
!=
(
end_ret
=
ObSqlTransControl
::
implicit_end_trans
(
exec_ctx_
,
is_rollback
,
callback
)))
{
// implicit commit, no rollback
ret
=
(
OB_SUCCESS
==
ret
)
?
end_ret
:
ret
;
LOG_WARN
(
"fail end implicit trans"
,
K
(
is_rollback
),
K
(
ret
));
}
if
(
OB_UNLIKELY
(
OB_SUCCESS
!=
(
wait_ret
=
callback
.
wait
())))
{
LOG_WARN
(
"sync end trans callback return an error!"
,
K
(
ret
),
K
(
wait_ret
),
K
(
is_rollback
),
K
(
my_session
->
get_trans_desc
()));
}
ret
=
OB_SUCCESS
!=
ret
?
ret
:
wait_ret
;
}
is_rollback
=
(
is_rollback
||
OB_SUCCESS
!=
ret
);
int
wait_ret
=
OB_SUCCESS
;
if
(
OB_SUCCESS
!=
(
end_ret
=
ObSqlTransControl
::
implicit_end_trans
(
exec_ctx_
,
is_rollback
,
callback
)))
{
// implicit commit, no rollback
ret
=
(
OB_SUCCESS
==
ret
)
?
end_ret
:
ret
;
LOG_WARN
(
"fail end implicit trans"
,
K
(
is_rollback
),
K
(
ret
));
}
if
(
OB_UNLIKELY
(
OB_SUCCESS
!=
(
wait_ret
=
callback
.
wait
())))
{
LOG_WARN
(
"sync end trans callback return an error!"
,
K
(
ret
),
K
(
wait_ret
),
K
(
is_rollback
),
K
(
my_session
->
get_trans_desc
()));
}
ret
=
OB_SUCCESS
!=
ret
?
ret
:
wait_ret
;
}
trans_state_
.
clear_start_trans_executed
();
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录