Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f4bb5d06
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,发现更多精彩内容 >>
提交
f4bb5d06
编写于
1月 10, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
a326b290
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
82 addition
and
30 deletion
+82
-30
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+4
-1
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+2
-2
source/dnode/mnode/impl/src/mndVgroup.c
source/dnode/mnode/impl/src/mndVgroup.c
+6
-8
source/dnode/mnode/impl/test/db/db.cpp
source/dnode/mnode/impl/test/db/db.cpp
+4
-15
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+5
-4
tests/script/sim/db/basic1.sim
tests/script/sim/db/basic1.sim
+0
-0
tests/script/sim/db/error1.sim
tests/script/sim/db/error1.sim
+61
-0
tests/script/sim/dnode/basic1.sim
tests/script/sim/dnode/basic1.sim
+0
-0
tests/script/sim/table/basic1.sim
tests/script/sim/table/basic1.sim
+0
-0
tests/script/sim/user/basic1.sim
tests/script/sim/user/basic1.sim
+0
-0
未找到文件。
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
f4bb5d06
...
@@ -463,7 +463,7 @@ static int32_t mndProcessCreateDbReq(SMnodeMsg *pReq) {
...
@@ -463,7 +463,7 @@ static int32_t mndProcessCreateDbReq(SMnodeMsg *pReq) {
pCreate
->
commitTime
=
htonl
(
pCreate
->
commitTime
);
pCreate
->
commitTime
=
htonl
(
pCreate
->
commitTime
);
pCreate
->
fsyncPeriod
=
htonl
(
pCreate
->
fsyncPeriod
);
pCreate
->
fsyncPeriod
=
htonl
(
pCreate
->
fsyncPeriod
);
mDebug
(
"db:%s, start to create
"
,
pCreate
->
db
);
mDebug
(
"db:%s, start to create
, vgroups:%d"
,
pCreate
->
db
,
pCreate
->
numOfVgroups
);
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pCreate
->
db
);
SDbObj
*
pDb
=
mndAcquireDb
(
pMnode
,
pCreate
->
db
);
if
(
pDb
!=
NULL
)
{
if
(
pDb
!=
NULL
)
{
...
@@ -476,6 +476,9 @@ static int32_t mndProcessCreateDbReq(SMnodeMsg *pReq) {
...
@@ -476,6 +476,9 @@ static int32_t mndProcessCreateDbReq(SMnodeMsg *pReq) {
mError
(
"db:%s, failed to create since %s"
,
pCreate
->
db
,
terrstr
());
mError
(
"db:%s, failed to create since %s"
,
pCreate
->
db
,
terrstr
());
return
-
1
;
return
-
1
;
}
}
}
else
if
(
terrno
!=
TSDB_CODE_MND_DB_NOT_EXIST
)
{
mError
(
"db:%s, failed to create since %s"
,
pCreate
->
db
,
terrstr
());
return
-
1
;
}
}
SUserObj
*
pOperUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
SUserObj
*
pOperUser
=
mndAcquireUser
(
pMnode
,
pReq
->
user
);
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
f4bb5d06
...
@@ -809,7 +809,7 @@ static bool mndTransPerformUndoLogStage(SMnode *pMnode, STrans *pTrans) {
...
@@ -809,7 +809,7 @@ static bool mndTransPerformUndoLogStage(SMnode *pMnode, STrans *pTrans) {
mDebug
(
"trans:%d, stage from undoLog to rollback"
,
pTrans
->
id
);
mDebug
(
"trans:%d, stage from undoLog to rollback"
,
pTrans
->
id
);
continueExec
=
true
;
continueExec
=
true
;
}
else
{
}
else
{
m
Debug
(
"trans:%d, stage keep on undoLog since %s"
,
pTrans
->
id
,
terrstr
());
m
Error
(
"trans:%d, stage keep on undoLog since %s"
,
pTrans
->
id
,
terrstr
());
continueExec
=
false
;
continueExec
=
false
;
}
}
...
@@ -825,7 +825,7 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans) {
...
@@ -825,7 +825,7 @@ static bool mndTransPerformUndoActionStage(SMnode *pMnode, STrans *pTrans) {
mDebug
(
"trans:%d, stage from undoAction to undoLog"
,
pTrans
->
id
);
mDebug
(
"trans:%d, stage from undoAction to undoLog"
,
pTrans
->
id
);
continueExec
=
true
;
continueExec
=
true
;
}
else
if
(
code
==
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
}
else
if
(
code
==
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
m
Debug
(
"trans:%d, stage keep on undoAction since %s"
,
pTrans
->
id
,
tstrerror
(
code
));
m
Error
(
"trans:%d, stage keep on undoAction since %s"
,
pTrans
->
id
,
tstrerror
(
code
));
continueExec
=
false
;
continueExec
=
false
;
}
else
{
}
else
{
pTrans
->
failedTimes
++
;
pTrans
->
failedTimes
++
;
...
...
source/dnode/mnode/impl/src/mndVgroup.c
浏览文件 @
f4bb5d06
...
@@ -273,15 +273,10 @@ static bool mndBuildDnodesArrayFp(SMnode *pMnode, void *pObj, void *p1, void *p2
...
@@ -273,15 +273,10 @@ static bool mndBuildDnodesArrayFp(SMnode *pMnode, void *pObj, void *p1, void *p2
SDnodeObj
*
pDnode
=
pObj
;
SDnodeObj
*
pDnode
=
pObj
;
SArray
*
pArray
=
p1
;
SArray
*
pArray
=
p1
;
pDnode
->
numOfVnodes
=
mndGetVnodesNum
(
pMnode
,
pDnode
->
id
);
int64_t
curMs
=
taosGetTimestampMs
();
int64_t
curMs
=
taosGetTimestampMs
();
bool
online
=
mndIsDnodeOnline
(
pMnode
,
pDnode
,
curMs
);
bool
online
=
mndIsDnodeOnline
(
pMnode
,
pDnode
,
curMs
);
if
(
online
&&
pDnode
->
numOfSupportVnodes
>
0
)
{
bool
isMnode
=
mndIsMnode
(
pMnode
,
pDnode
->
id
);
taosArrayPush
(
pArray
,
pDnode
);
pDnode
->
numOfVnodes
=
mndGetVnodesNum
(
pMnode
,
pDnode
->
id
);
}
bool
isMnode
=
mndIsMnode
(
pMnode
,
pDnode
->
id
);
mDebug
(
"dnode:%d, vnodes:%d supportVnodes:%d isMnode:%d online:%d"
,
pDnode
->
id
,
pDnode
->
numOfVnodes
,
mDebug
(
"dnode:%d, vnodes:%d supportVnodes:%d isMnode:%d online:%d"
,
pDnode
->
id
,
pDnode
->
numOfVnodes
,
pDnode
->
numOfSupportVnodes
,
isMnode
,
online
);
pDnode
->
numOfSupportVnodes
,
isMnode
,
online
);
...
@@ -290,6 +285,9 @@ static bool mndBuildDnodesArrayFp(SMnode *pMnode, void *pObj, void *p1, void *p2
...
@@ -290,6 +285,9 @@ static bool mndBuildDnodesArrayFp(SMnode *pMnode, void *pObj, void *p1, void *p2
pDnode
->
numOfVnodes
++
;
pDnode
->
numOfVnodes
++
;
}
}
if
(
online
&&
pDnode
->
numOfSupportVnodes
>
0
)
{
taosArrayPush
(
pArray
,
pDnode
);
}
return
true
;
return
true
;
}
}
...
@@ -311,7 +309,7 @@ static SArray *mndBuildDnodesArray(SMnode *pMnode) {
...
@@ -311,7 +309,7 @@ static SArray *mndBuildDnodesArray(SMnode *pMnode) {
static
int32_t
mndCompareDnodeVnodes
(
SDnodeObj
*
pDnode1
,
SDnodeObj
*
pDnode2
)
{
static
int32_t
mndCompareDnodeVnodes
(
SDnodeObj
*
pDnode1
,
SDnodeObj
*
pDnode2
)
{
float
d1Score
=
(
float
)
pDnode1
->
numOfVnodes
/
pDnode1
->
numOfSupportVnodes
;
float
d1Score
=
(
float
)
pDnode1
->
numOfVnodes
/
pDnode1
->
numOfSupportVnodes
;
float
d2Score
=
(
float
)
pDnode2
->
numOfVnodes
/
pDnode2
->
numOfSupportVnodes
;
float
d2Score
=
(
float
)
pDnode2
->
numOfVnodes
/
pDnode2
->
numOfSupportVnodes
;
return
d1Score
>
d2Score
?
1
:
0
;
return
d1Score
>
=
d2Score
?
1
:
0
;
}
}
static
int32_t
mndGetAvailableDnode
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SArray
*
pArray
)
{
static
int32_t
mndGetAvailableDnode
(
SMnode
*
pMnode
,
SVgObj
*
pVgroup
,
SArray
*
pArray
)
{
...
...
source/dnode/mnode/impl/test/db/db.cpp
浏览文件 @
f4bb5d06
...
@@ -13,28 +13,17 @@
...
@@ -13,28 +13,17 @@
class
MndTestDb
:
public
::
testing
::
Test
{
class
MndTestDb
:
public
::
testing
::
Test
{
protected:
protected:
static
void
SetUpTestSuite
()
{
static
void
SetUpTestSuite
()
{
test
.
Init
(
"/tmp/mnode_test_db"
,
9030
);
}
test
.
Init
(
"/tmp/mnode_test_db"
,
9030
);
static
void
TearDownTestSuite
()
{
test
.
Cleanup
();
}
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9030"
;
server2
.
Start
(
"/tmp/mnode_test_db2"
,
fqdn
,
9031
,
firstEp
);
static
Testbase
test
;
}
static
void
TearDownTestSuite
()
{
server2
.
Stop
();
test
.
Cleanup
();
}
static
Testbase
test
;
static
TestServer
server2
;
public:
public:
void
SetUp
()
override
{}
void
SetUp
()
override
{}
void
TearDown
()
override
{}
void
TearDown
()
override
{}
};
};
Testbase
MndTestDb
::
test
;
Testbase
MndTestDb
::
test
;
TestServer
MndTestDb
::
server2
;
TEST_F
(
MndTestDb
,
01
_ShowDb
)
{
TEST_F
(
MndTestDb
,
01
_ShowDb
)
{
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_DB
,
""
);
test
.
SendShowMetaReq
(
TSDB_MGMT_TABLE_DB
,
""
);
...
...
tests/script/jenkins/basic.txt
浏览文件 @
f4bb5d06
...
@@ -2,15 +2,16 @@
...
@@ -2,15 +2,16 @@
#======================b1-start===============
#======================b1-start===============
# ---- user
# ---- user
./test.sh -f
general
/user/basic1.sim
./test.sh -f
sim
/user/basic1.sim
# ---- db
# ---- db
./test.sh -f general/db/basic1.sim
./test.sh -f sim/db/basic1.sim
./test.sh -f sim/db/error1.sim
# ---- table
# ---- table
./test.sh -f
general
/table/basic1.sim
./test.sh -f
sim
/table/basic1.sim
# ---- dnode
# ---- dnode
./test.sh -f
unique
/dnode/basic1.sim
./test.sh -f
sim
/dnode/basic1.sim
#======================b1-end===============
#======================b1-end===============
tests/script/
general
/db/basic1.sim
→
tests/script/
sim
/db/basic1.sim
浏览文件 @
f4bb5d06
文件已移动
tests/script/sim/db/error1.sim
0 → 100644
浏览文件 @
f4bb5d06
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/deploy.sh -n dnode2 -i 2
system sh/exec.sh -n dnode2 -s start
sql connect
print ========== create dnodes
sql create dnode $hostname port 7200
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql show dnodes
if $data4_2 != ready then
goto create1
endi
print ========== stop dnode2
system sh/exec.sh -n dnode2 -s stop -x SIGKILL
print =============== create database
sql_error create database d1 vgroups 4
print ========== start dnode2
system sh/exec.sh -n dnode2 -s start
print =============== re-create database
$x = 0
re-create1:
$x = $x + 1
sleep 1000
if $x == 10 then
return -1
endi
sql create database d1 vgroups 2 -x re-create1
sql show databases
if $rows != 1 then
return -1
endi
if $data00 != d1 then
return -1
endi
if $data02 != 2 then
return -1
endi
if $data03 != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/
unique
/dnode/basic1.sim
→
tests/script/
sim
/dnode/basic1.sim
浏览文件 @
f4bb5d06
文件已移动
tests/script/
general
/table/basic1.sim
→
tests/script/
sim
/table/basic1.sim
浏览文件 @
f4bb5d06
文件已移动
tests/script/
general
/user/basic1.sim
→
tests/script/
sim
/user/basic1.sim
浏览文件 @
f4bb5d06
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录