Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f8841046
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看板
提交
f8841046
编写于
5月 16, 2023
作者:
B
Benguang Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: refactor func name of mndTransPerformFinishStage
上级
30104f30
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
10 deletion
+10
-10
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+9
-9
未找到文件。
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
f8841046
...
@@ -108,7 +108,7 @@ typedef enum {
...
@@ -108,7 +108,7 @@ typedef enum {
TRN_STAGE_UNDO_ACTION
=
3
,
TRN_STAGE_UNDO_ACTION
=
3
,
TRN_STAGE_COMMIT
=
4
,
TRN_STAGE_COMMIT
=
4
,
TRN_STAGE_COMMIT_ACTION
=
5
,
TRN_STAGE_COMMIT_ACTION
=
5
,
TRN_STAGE_FINISH
ED
=
6
,
TRN_STAGE_FINISH
=
6
,
TRN_STAGE_PRE_FINISH
=
7
TRN_STAGE_PRE_FINISH
=
7
}
ETrnStage
;
}
ETrnStage
;
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
f8841046
...
@@ -52,7 +52,7 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans);
...
@@ -52,7 +52,7 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans);
static
bool
mndTransPerformCommitActionStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndTransPerformCommitActionStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndTransPerformCommitStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndTransPerformCommitStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndTransPerformRollbackStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndTransPerformRollbackStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndTransPerformFinish
ed
Stage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndTransPerformFinishStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
bool
mndCannotExecuteTransAction
(
SMnode
*
pMnode
)
{
return
!
pMnode
->
deploy
&&
!
mndIsLeader
(
pMnode
);
}
static
bool
mndCannotExecuteTransAction
(
SMnode
*
pMnode
)
{
return
!
pMnode
->
deploy
&&
!
mndIsLeader
(
pMnode
);
}
static
void
mndTransSendRpcRsp
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
static
void
mndTransSendRpcRsp
(
SMnode
*
pMnode
,
STrans
*
pTrans
);
...
@@ -458,7 +458,7 @@ static const char *mndTransStr(ETrnStage stage) {
...
@@ -458,7 +458,7 @@ static const char *mndTransStr(ETrnStage stage) {
return
"commit"
;
return
"commit"
;
case
TRN_STAGE_COMMIT_ACTION
:
case
TRN_STAGE_COMMIT_ACTION
:
return
"commitAction"
;
return
"commitAction"
;
case
TRN_STAGE_FINISH
ED
:
case
TRN_STAGE_FINISH
:
return
"finished"
;
return
"finished"
;
case
TRN_STAGE_PRE_FINISH
:
case
TRN_STAGE_PRE_FINISH
:
return
"pre-finish"
;
return
"pre-finish"
;
...
@@ -607,7 +607,7 @@ static int32_t mndTransActionUpdate(SSdb *pSdb, STrans *pOld, STrans *pNew) {
...
@@ -607,7 +607,7 @@ static int32_t mndTransActionUpdate(SSdb *pSdb, STrans *pOld, STrans *pNew) {
}
}
if
(
pOld
->
stage
==
TRN_STAGE_PRE_FINISH
)
{
if
(
pOld
->
stage
==
TRN_STAGE_PRE_FINISH
)
{
pOld
->
stage
=
TRN_STAGE_FINISH
ED
;
pOld
->
stage
=
TRN_STAGE_FINISH
;
mTrace
(
"trans:%d, stage from pre-finish to finished since perform update action"
,
pNew
->
id
);
mTrace
(
"trans:%d, stage from pre-finish to finished since perform update action"
,
pNew
->
id
);
}
}
...
@@ -961,7 +961,7 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
...
@@ -961,7 +961,7 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
bool
sendRsp
=
false
;
bool
sendRsp
=
false
;
int32_t
code
=
pTrans
->
code
;
int32_t
code
=
pTrans
->
code
;
if
(
pTrans
->
stage
==
TRN_STAGE_FINISH
ED
)
{
if
(
pTrans
->
stage
==
TRN_STAGE_FINISH
)
{
sendRsp
=
true
;
sendRsp
=
true
;
}
}
...
@@ -1476,7 +1476,7 @@ static bool mndTransPerformCommitActionStage(SMnode *pMnode, STrans *pTrans) {
...
@@ -1476,7 +1476,7 @@ static bool mndTransPerformCommitActionStage(SMnode *pMnode, STrans *pTrans) {
if
(
code
==
0
)
{
if
(
code
==
0
)
{
pTrans
->
code
=
0
;
pTrans
->
code
=
0
;
pTrans
->
stage
=
TRN_STAGE_FINISH
ED
;
// TRN_STAGE_PRE_FINISH is not necessary
pTrans
->
stage
=
TRN_STAGE_FINISH
;
// TRN_STAGE_PRE_FINISH is not necessary
mInfo
(
"trans:%d, stage from commitAction to finished"
,
pTrans
->
id
);
mInfo
(
"trans:%d, stage from commitAction to finished"
,
pTrans
->
id
);
continueExec
=
true
;
continueExec
=
true
;
}
else
{
}
else
{
...
@@ -1535,7 +1535,7 @@ static bool mndTransPerformPreFinishStage(SMnode *pMnode, STrans *pTrans) {
...
@@ -1535,7 +1535,7 @@ static bool mndTransPerformPreFinishStage(SMnode *pMnode, STrans *pTrans) {
int32_t
code
=
mndTransPreFinish
(
pMnode
,
pTrans
);
int32_t
code
=
mndTransPreFinish
(
pMnode
,
pTrans
);
if
(
code
==
0
)
{
if
(
code
==
0
)
{
pTrans
->
stage
=
TRN_STAGE_FINISH
ED
;
pTrans
->
stage
=
TRN_STAGE_FINISH
;
mInfo
(
"trans:%d, stage from pre-finish to finish"
,
pTrans
->
id
);
mInfo
(
"trans:%d, stage from pre-finish to finish"
,
pTrans
->
id
);
continueExec
=
true
;
continueExec
=
true
;
}
else
{
}
else
{
...
@@ -1547,7 +1547,7 @@ static bool mndTransPerformPreFinishStage(SMnode *pMnode, STrans *pTrans) {
...
@@ -1547,7 +1547,7 @@ static bool mndTransPerformPreFinishStage(SMnode *pMnode, STrans *pTrans) {
return
continueExec
;
return
continueExec
;
}
}
static
bool
mndTransPerformFinish
ed
Stage
(
SMnode
*
pMnode
,
STrans
*
pTrans
)
{
static
bool
mndTransPerformFinishStage
(
SMnode
*
pMnode
,
STrans
*
pTrans
)
{
bool
continueExec
=
false
;
bool
continueExec
=
false
;
SSdbRaw
*
pRaw
=
mndTransActionEncode
(
pTrans
);
SSdbRaw
*
pRaw
=
mndTransActionEncode
(
pTrans
);
...
@@ -1611,8 +1611,8 @@ void mndTransExecute(SMnode *pMnode, STrans *pTrans, bool isLeader) {
...
@@ -1611,8 +1611,8 @@ void mndTransExecute(SMnode *pMnode, STrans *pTrans, bool isLeader) {
continueExec
=
false
;
continueExec
=
false
;
}
}
break
;
break
;
case
TRN_STAGE_FINISH
ED
:
case
TRN_STAGE_FINISH
:
continueExec
=
mndTransPerformFinish
ed
Stage
(
pMnode
,
pTrans
);
continueExec
=
mndTransPerformFinishStage
(
pMnode
,
pTrans
);
break
;
break
;
default:
default:
continueExec
=
false
;
continueExec
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录