Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3c3f32bd
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3c3f32bd
编写于
1月 05, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
ad94dff0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
53 addition
and
12 deletion
+53
-12
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+11
-10
source/dnode/mnode/impl/test/trans/trans.cpp
source/dnode/mnode/impl/test/trans/trans.cpp
+41
-1
未找到文件。
source/dnode/mgmt/impl/test/qnode/dqnode.cpp
浏览文件 @
3c3f32bd
...
...
@@ -73,7 +73,7 @@ TEST_F(DndTestQnode, 01_Create_Qnode) {
}
}
TEST_F
(
DndTestQnode
,
0
1
_Drop_Qnode
)
{
TEST_F
(
DndTestQnode
,
0
2
_Drop_Qnode
)
{
{
int32_t
contLen
=
sizeof
(
SDDropQnodeReq
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
3c3f32bd
...
...
@@ -24,7 +24,7 @@
static
SSdbRaw
*
mndTransActionEncode
(
STrans
*
pTrans
);
static
SSdbRow
*
mndTransActionDecode
(
SSdbRaw
*
pRaw
);
static
int32_t
mndTransActionInsert
(
SSdb
*
pSdb
,
STrans
*
pTrans
);
static
int32_t
mndTransActionUpdate
(
SSdb
*
pSdb
,
STrans
*
OldTrans
,
STrans
*
pOld
Trans
);
static
int32_t
mndTransActionUpdate
(
SSdb
*
pSdb
,
STrans
*
OldTrans
,
STrans
*
pOld
);
static
int32_t
mndTransActionDelete
(
SSdb
*
pSdb
,
STrans
*
pTrans
);
static
int32_t
mndTransAppendLog
(
SArray
*
pArray
,
SSdbRaw
*
pRaw
);
...
...
@@ -314,9 +314,10 @@ static int32_t mndTransActionDelete(SSdb *pSdb, STrans *pTrans) {
return
0
;
}
static
int32_t
mndTransActionUpdate
(
SSdb
*
pSdb
,
STrans
*
pOldTrans
,
STrans
*
pNewTrans
)
{
mTrace
(
"trans:%d, perform update action, old_row:%p new_row:%p"
,
pOldTrans
->
id
,
pOldTrans
,
pNewTrans
);
pOldTrans
->
stage
=
pNewTrans
->
stage
;
static
int32_t
mndTransActionUpdate
(
SSdb
*
pSdb
,
STrans
*
pOld
,
STrans
*
pNew
)
{
mTrace
(
"trans:%d, perform update action, old row:%p stage:%d, new row:%p stage:%d"
,
pOld
->
id
,
pOld
,
pOld
->
stage
,
pNew
,
pNew
->
stage
);
pOld
->
stage
=
pNew
->
stage
;
return
0
;
}
...
...
@@ -464,16 +465,16 @@ int32_t mndTransPrepare(SMnode *pMnode, STrans *pTrans) {
}
mDebug
(
"trans:%d, prepare finished"
,
pTrans
->
id
);
STrans
*
pNew
Trans
=
mndAcquireTrans
(
pMnode
,
pTrans
->
id
);
if
(
pNew
Trans
==
NULL
)
{
STrans
*
pNew
=
mndAcquireTrans
(
pMnode
,
pTrans
->
id
);
if
(
pNew
==
NULL
)
{
mError
(
"trans:%d, failed to read from sdb since %s"
,
pTrans
->
id
,
terrstr
());
return
-
1
;
}
pNew
Trans
->
rpcHandle
=
pTrans
->
rpcHandle
;
pNew
Trans
->
rpcAHandle
=
pTrans
->
rpcAHandle
;
mndTransExecute
(
pMnode
,
pNew
Trans
);
mndReleaseTrans
(
pMnode
,
pNew
Trans
);
pNew
->
rpcHandle
=
pTrans
->
rpcHandle
;
pNew
->
rpcAHandle
=
pTrans
->
rpcAHandle
;
mndTransExecute
(
pMnode
,
pNew
);
mndReleaseTrans
(
pMnode
,
pNew
);
return
0
;
}
...
...
source/dnode/mnode/impl/test/trans/trans.cpp
浏览文件 @
3c3f32bd
...
...
@@ -10,7 +10,6 @@
*/
#include "sut.h"
#include "os.h"
class
MndTestTrans
:
public
::
testing
::
Test
{
protected:
...
...
@@ -84,3 +83,44 @@ TEST_F(MndTestTrans, 01_Create_User_Crash) {
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
}
TEST_F
(
MndTestTrans
,
02
_Create_Qnode_Crash
)
{
{
int32_t
contLen
=
sizeof
(
SMCreateQnodeReq
);
SMCreateQnodeReq
*
pReq
=
(
SMCreateQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
ASSERT_EQ
(
pRsp
->
code
,
0
);
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_QNODE
,
""
);
CHECK_META
(
"show qnodes"
,
3
);
test
.
SendShowRetrieveReq
();
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
}
KillThenRestartServer
();
{
int32_t
retry
=
0
;
int32_t
retryMax
=
10
;
for
(
retry
=
0
;
retry
<
retryMax
;
retry
++
)
{
int32_t
contLen
=
sizeof
(
SMCreateQnodeReq
);
SMCreateQnodeReq
*
pReq
=
(
SMCreateQnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_CREATE_QNODE
,
pReq
,
contLen
);
ASSERT_NE
(
pRsp
,
nullptr
);
if
(
pRsp
->
code
==
0
)
break
;
taosMsleep
(
1000
);
}
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_QNODE
,
""
);
CHECK_META
(
"show qnodes"
,
3
);
test
.
SendShowRetrieveReq
();
EXPECT_EQ
(
test
.
GetShowRows
(),
1
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录