Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9dd5922d
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9dd5922d
编写于
1月 04, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
error returned when trans rollback
上级
ad965dbc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
14 deletion
+15
-14
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+4
-4
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+11
-10
未找到文件。
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
9dd5922d
...
...
@@ -64,10 +64,10 @@ typedef enum {
TRN_STAGE_PREPARE
=
0
,
TRN_STAGE_REDO_LOG
=
1
,
TRN_STAGE_REDO_ACTION
=
2
,
TRN_STAGE_
UNDO
_LOG
=
3
,
TRN_STAGE_
UNDO_ACTION
=
4
,
TRN_STAGE_
COMMIT_LOG
=
5
,
TRN_STAGE_
COMMIT
=
6
,
TRN_STAGE_
COMMIT
_LOG
=
3
,
TRN_STAGE_
COMMIT
=
4
,
TRN_STAGE_
UNDO_ACTION
=
5
,
TRN_STAGE_
UNDO_LOG
=
6
,
TRN_STAGE_ROLLBACK
=
7
,
TRN_STAGE_FINISHED
=
8
}
ETrnStage
;
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
9dd5922d
...
...
@@ -496,10 +496,15 @@ static int32_t mndTransRollback(SMnode *pMnode, STrans *pTrans) {
}
static
void
mndTransSendRpcRsp
(
STrans
*
pTrans
)
{
if
(
pTrans
->
rpcHandle
!=
NULL
)
{
mDebug
(
"trans:%d, send rsp, ahandle:%p code:0x%x"
,
pTrans
->
id
,
pTrans
->
rpcAHandle
,
pTrans
->
code
&
0xFFFF
);
SRpcMsg
rspMsg
=
{.
handle
=
pTrans
->
rpcHandle
,
.
code
=
pTrans
->
code
,
.
ahandle
=
pTrans
->
rpcAHandle
};
rpcSendResponse
(
&
rspMsg
);
if
(
pTrans
->
stage
==
TRN_STAGE_FINISHED
||
pTrans
->
stage
==
TRN_STAGE_UNDO_LOG
||
pTrans
->
stage
==
TRN_STAGE_UNDO_ACTION
||
pTrans
->
stage
==
TRN_STAGE_ROLLBACK
)
{
if
(
pTrans
->
rpcHandle
!=
NULL
)
{
mDebug
(
"trans:%d, send rsp, code:0x%x stage:%d app:%p"
,
pTrans
->
id
,
pTrans
->
code
&
0xFFFF
,
pTrans
->
stage
,
pTrans
->
rpcAHandle
);
SRpcMsg
rspMsg
=
{.
handle
=
pTrans
->
rpcHandle
,
.
code
=
pTrans
->
code
,
.
ahandle
=
pTrans
->
rpcAHandle
};
rpcSendResponse
(
&
rspMsg
);
pTrans
->
rpcHandle
=
NULL
;
}
}
}
...
...
@@ -764,7 +769,6 @@ static bool mndTransPerformCommitLogStage(SMnode *pMnode, STrans *pTrans) {
pTrans
->
failedTimes
++
;
mError
(
"trans:%d, stage keep on commitLog since %s"
,
pTrans
->
id
,
terrstr
());
continueExec
=
false
;
;
}
return
continueExec
;
...
...
@@ -791,7 +795,7 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans) {
int32_t
code
=
mndTransExecuteUndoActions
(
pMnode
,
pTrans
);
if
(
code
==
0
)
{
pTrans
->
stage
=
TRN_STAGE_
RE
DO_LOG
;
pTrans
->
stage
=
TRN_STAGE_
UN
DO_LOG
;
mDebug
(
"trans:%d, stage from undoAction to undoLog"
,
pTrans
->
id
);
continueExec
=
true
;
}
else
if
(
code
==
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
...
...
@@ -814,7 +818,6 @@ static bool mndTransPerformRollbackStage(SMnode *pMnode, STrans *pTrans) {
pTrans
->
stage
=
TRN_STAGE_FINISHED
;
mDebug
(
"trans:%d, stage from rollback to finished"
,
pTrans
->
id
);
continueExec
=
true
;
;
}
else
{
pTrans
->
failedTimes
++
;
mError
(
"trans:%d, stage keep on rollback since %s"
,
pTrans
->
id
,
terrstr
());
...
...
@@ -880,9 +883,7 @@ static void mndTransExecute(SMnode *pMnode, STrans *pTrans) {
}
}
if
(
pTrans
->
stage
==
TRN_STAGE_FINISHED
)
{
mndTransSendRpcRsp
(
pTrans
);
}
mndTransSendRpcRsp
(
pTrans
);
}
static
int32_t
mndProcessTransMsg
(
SMnodeMsg
*
pMsg
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录