Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
917d1165
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
917d1165
编写于
2月 06, 2023
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: set transId to 0 while timeout or in follower state
上级
fbc94135
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
6 deletion
+16
-6
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+1
-1
source/dnode/mnode/impl/src/mndSync.c
source/dnode/mnode/impl/src/mndSync.c
+6
-2
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+9
-3
未找到文件。
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
917d1165
...
@@ -49,7 +49,7 @@ static void mmProcessRpcMsg(SQueueInfo *pInfo, SRpcMsg *pMsg) {
...
@@ -49,7 +49,7 @@ static void mmProcessRpcMsg(SQueueInfo *pInfo, SRpcMsg *pMsg) {
pMsg
->
info
.
node
=
pMgmt
->
pMnode
;
pMsg
->
info
.
node
=
pMgmt
->
pMnode
;
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
const
STraceId
*
trace
=
&
pMsg
->
info
.
traceId
;
dGTrace
(
"msg:%p, get from mnode queue
"
,
pMsg
);
dGTrace
(
"msg:%p, get from mnode queue
, type:%s"
,
pMsg
,
TMSG_INFO
(
pMsg
->
msgType
)
);
int32_t
code
=
mndProcessRpcMsg
(
pMsg
);
int32_t
code
=
mndProcessRpcMsg
(
pMsg
);
...
...
source/dnode/mnode/impl/src/mndSync.c
浏览文件 @
917d1165
...
@@ -114,7 +114,11 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta
...
@@ -114,7 +114,11 @@ int32_t mndProcessWriteMsg(const SSyncFSM *pFsm, SRpcMsg *pMsg, const SFsmCbMeta
taosThreadMutexUnlock
(
&
pMgmt
->
lock
);
taosThreadMutexUnlock
(
&
pMgmt
->
lock
);
STrans
*
pTrans
=
mndAcquireTrans
(
pMnode
,
transId
);
STrans
*
pTrans
=
mndAcquireTrans
(
pMnode
,
transId
);
if
(
pTrans
!=
NULL
)
{
if
(
pTrans
!=
NULL
)
{
mInfo
(
"trans:%d, execute in mnode which not leader or sync timeout"
,
transId
);
mInfo
(
"trans:%d, execute in mnode which not leader or sync timeout, createTime:%"
PRId64
" saved trans:%d"
,
transId
,
pTrans
->
createdTime
,
pMgmt
->
transId
);
pMgmt
->
transId
=
0
;
pMgmt
->
transSec
=
0
;
pMgmt
->
transSeq
=
0
;
mndTransExecute
(
pMnode
,
pTrans
);
mndTransExecute
(
pMnode
,
pTrans
);
mndReleaseTrans
(
pMnode
,
pTrans
);
mndReleaseTrans
(
pMnode
,
pTrans
);
// sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
// sdbWriteFile(pMnode->pSdb, SDB_WRITE_DELTA);
...
@@ -372,7 +376,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) {
...
@@ -372,7 +376,7 @@ int32_t mndSyncPropose(SMnode *pMnode, SSdbRaw *pRaw, int32_t transId) {
taosThreadMutexLock
(
&
pMgmt
->
lock
);
taosThreadMutexLock
(
&
pMgmt
->
lock
);
pMgmt
->
errCode
=
0
;
pMgmt
->
errCode
=
0
;
if
(
pMgmt
->
transId
!=
0
)
{
if
(
pMgmt
->
transId
!=
0
&&
pMgmt
->
transId
!=
transId
)
{
mError
(
"trans:%d, can't be proposed since trans:%d already waiting for confirm"
,
transId
,
pMgmt
->
transId
);
mError
(
"trans:%d, can't be proposed since trans:%d already waiting for confirm"
,
transId
,
pMgmt
->
transId
);
taosThreadMutexUnlock
(
&
pMgmt
->
lock
);
taosThreadMutexUnlock
(
&
pMgmt
->
lock
);
rpcFreeCont
(
req
.
pCont
);
rpcFreeCont
(
req
.
pCont
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
917d1165
...
@@ -794,7 +794,8 @@ static int32_t mndTransSync(SMnode *pMnode, STrans *pTrans) {
...
@@ -794,7 +794,8 @@ static int32_t mndTransSync(SMnode *pMnode, STrans *pTrans) {
mInfo
(
"trans:%d, sync to other mnodes, stage:%s"
,
pTrans
->
id
,
mndTransStr
(
pTrans
->
stage
));
mInfo
(
"trans:%d, sync to other mnodes, stage:%s"
,
pTrans
->
id
,
mndTransStr
(
pTrans
->
stage
));
int32_t
code
=
mndSyncPropose
(
pMnode
,
pRaw
,
pTrans
->
id
);
int32_t
code
=
mndSyncPropose
(
pMnode
,
pRaw
,
pTrans
->
id
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
mError
(
"trans:%d, failed to sync, errno:%s code:%s"
,
pTrans
->
id
,
terrstr
(),
tstrerror
(
code
));
mError
(
"trans:%d, failed to sync, errno:%s code:%s createTime:%"
PRId64
" saved trans:%d"
,
pTrans
->
id
,
terrstr
(),
tstrerror
(
code
),
pTrans
->
createdTime
,
pMnode
->
syncMgmt
.
transId
);
sdbFreeRaw
(
pRaw
);
sdbFreeRaw
(
pRaw
);
return
-
1
;
return
-
1
;
}
}
...
@@ -1495,7 +1496,11 @@ static bool mndTransPerfromFinishedStage(SMnode *pMnode, STrans *pTrans) {
...
@@ -1495,7 +1496,11 @@ static bool mndTransPerfromFinishedStage(SMnode *pMnode, STrans *pTrans) {
mError
(
"trans:%d, failed to write sdb since %s"
,
pTrans
->
id
,
terrstr
());
mError
(
"trans:%d, failed to write sdb since %s"
,
pTrans
->
id
,
terrstr
());
}
}
mInfo
(
"trans:%d, execute finished, code:0x%x, failedTimes:%d"
,
pTrans
->
id
,
pTrans
->
code
,
pTrans
->
failedTimes
);
mInfo
(
"trans:%d, execute finished, code:0x%x, failedTimes:%d createTime:%"
PRId64
,
pTrans
->
id
,
pTrans
->
code
,
pTrans
->
failedTimes
,
pTrans
->
createdTime
);
pMnode
->
syncMgmt
.
transId
=
0
;
pMnode
->
syncMgmt
.
transSec
=
0
;
pMnode
->
syncMgmt
.
transSeq
=
0
;
return
continueExec
;
return
continueExec
;
}
}
...
@@ -1503,7 +1508,8 @@ void mndTransExecute(SMnode *pMnode, STrans *pTrans) {
...
@@ -1503,7 +1508,8 @@ void mndTransExecute(SMnode *pMnode, STrans *pTrans) {
bool
continueExec
=
true
;
bool
continueExec
=
true
;
while
(
continueExec
)
{
while
(
continueExec
)
{
mInfo
(
"trans:%d, continue to execute, stage:%s"
,
pTrans
->
id
,
mndTransStr
(
pTrans
->
stage
));
mInfo
(
"trans:%d, continue to execute, stage:%s createTime:%"
PRId64
,
pTrans
->
id
,
mndTransStr
(
pTrans
->
stage
),
pTrans
->
createdTime
);
pTrans
->
lastExecTime
=
taosGetTimestampMs
();
pTrans
->
lastExecTime
=
taosGetTimestampMs
();
switch
(
pTrans
->
stage
)
{
switch
(
pTrans
->
stage
)
{
case
TRN_STAGE_PREPARE
:
case
TRN_STAGE_PREPARE
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录