Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cba62beb
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
cba62beb
编写于
6月 15, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: make create db retry
上级
26179507
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
88 addition
and
51 deletion
+88
-51
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+1
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+5
-7
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-1
tests/script/tsim/trans/create_db.sim
tests/script/tsim/trans/create_db.sim
+81
-42
未找到文件。
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
cba62beb
...
...
@@ -472,7 +472,7 @@ static int32_t mndCreateDb(SMnode *pMnode, SRpcMsg *pReq, SCreateDbReq *pCreate,
}
int32_t
code
=
-
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_R
OLLBACK
,
TRN_CONFLICT_DB
,
pReq
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_R
ETRY
,
TRN_CONFLICT_DB
,
pReq
);
if
(
pTrans
==
NULL
)
goto
_OVER
;
mDebug
(
"trans:%d, used to create db:%s"
,
pTrans
->
id
,
pCreate
->
db
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
cba62beb
...
...
@@ -1347,13 +1347,11 @@ int32_t mndKillTrans(SMnode *pMnode, STrans *pTrans) {
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pArray
);
++
i
)
{
STransAction
*
pAction
=
taosArrayGet
(
pArray
,
i
);
if
(
pAction
->
errCode
!=
0
)
{
mInfo
(
"trans:%d, %s:%d set processed for kill msg received, errCode from %s to success"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
i
,
tstrerror
(
pAction
->
errCode
));
pAction
->
msgSent
=
1
;
pAction
->
msgReceived
=
1
;
pAction
->
errCode
=
0
;
}
mInfo
(
"trans:%d, %s:%d set processed for kill msg received, errCode from %s to success"
,
pTrans
->
id
,
mndTransStr
(
pAction
->
stage
),
i
,
tstrerror
(
pAction
->
errCode
));
pAction
->
msgSent
=
1
;
pAction
->
msgReceived
=
1
;
pAction
->
errCode
=
0
;
}
mndTransExecute
(
pMnode
,
pTrans
);
...
...
tests/script/jenkins/basic.txt
浏览文件 @
cba62beb
...
...
@@ -58,7 +58,7 @@
# ---- mnode
./test.sh -f tsim/mnode/basic1.sim
./test.sh -f tsim/mnode/basic2.sim
#
./test.sh -f tsim/mnode/basic3.sim
./test.sh -f tsim/mnode/basic3.sim
./test.sh -f tsim/mnode/basic4.sim
./test.sh -f tsim/mnode/basic5.sim
...
...
tests/script/tsim/trans/create_db.sim
浏览文件 @
cba62beb
...
...
@@ -7,44 +7,28 @@ system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
sql connect
print =============== show dnodes
sql show dnodes;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
sql show mnodes;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data02 != leader then
return -1
endi
print =============== create dnodes
sql create dnode $hostname port 7200
sleep 2000
sql show dnodes;
if $rows != 2 then
return -1
endi
if $data00 != 1 then
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
return -1
endi
if $data10 != 2 then
return -1
if $data(1)[4] != ready then
goto step1
endi
if $data(2)[4] != ready then
goto step1
endi
print =============== kill dnode2
...
...
@@ -68,7 +52,7 @@ if $data[0][0] != 7 then
return -1
endi
if $data[0][2] !=
un
doAction then
if $data[0][2] !=
re
doAction then
return -1
endi
...
...
@@ -80,14 +64,34 @@ sql_error create database d1 vgroups 2;
print =============== start dnode2
system sh/exec.sh -n dnode2 -s start
sleep 3000
$x = 0
step2:
$x = $x + 1
sleep 1000
if $x == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
return -1
endi
if $data(1)[4] != ready then
goto step2
endi
if $data(2)[4] != ready then
goto step2
endi
sql show transactions
if $rows != 0 then
return -1
endi
sql create database d1 vgroups 2;
sql
_error
create database d1 vgroups 2;
print =============== kill dnode2
system sh/exec.sh -n dnode2 -s stop -x SIGINT
...
...
@@ -106,22 +110,31 @@ if $rows != 1 then
return -1
endi
if $data[0][0] !=
9
then
if $data[0][0] !=
8
then
return -1
endi
if $data[0][2] !=
un
doAction then
if $data[0][2] !=
re
doAction then
return -1
endi
if $data[0][3] != d2 then
return -1
endi
return
sql show databases ;
if $rows != 4 then
return -1
endi
print d2 ==> $data(d2)[19]
if $data(d2)[19] != creating then
return -1
endi
sql_error create database d2 vgroups 2;
print =============== kill transaction
sql kill transaction
9
;
sql kill transaction
8
;
sleep 2000
sql show transactions
...
...
@@ -131,7 +144,34 @@ endi
print =============== start dnode2
system sh/exec.sh -n dnode2 -s start
sleep 3000
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
if $rows != 2 then
return -1
endi
if $data(1)[4] != ready then
goto step3
endi
if $data(2)[4] != ready then
goto step3
endi
sql show transactions
if $rows != 0 then
return -1
endi
sql drop database d2;
sql show transactions
if $rows != 0 then
...
...
@@ -145,6 +185,5 @@ sql_error kill transaction 3;
sql_error kill transaction 4;
sql_error kill transaction 5;
return
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录