Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f57151d2
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看板
提交
f57151d2
编写于
12月 15, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-10431 process create db msg
上级
d22296f2
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
128 addition
and
85 deletion
+128
-85
include/common/taosmsg.h
include/common/taosmsg.h
+1
-1
source/dnode/mgmt/impl/test/CMakeLists.txt
source/dnode/mgmt/impl/test/CMakeLists.txt
+12
-0
source/dnode/mgmt/impl/test/db/db.cpp
source/dnode/mgmt/impl/test/db/db.cpp
+78
-50
source/dnode/mgmt/impl/test/dnode/dnode.cpp
source/dnode/mgmt/impl/test/dnode/dnode.cpp
+28
-28
source/dnode/mgmt/impl/test/user/user.cpp
source/dnode/mgmt/impl/test/user/user.cpp
+5
-5
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+2
-1
source/dnode/mnode/impl/src/mndShow.c
source/dnode/mnode/impl/src/mndShow.c
+2
-0
未找到文件。
include/common/taosmsg.h
浏览文件 @
f57151d2
...
@@ -168,8 +168,8 @@ typedef enum _mgmt_table {
...
@@ -168,8 +168,8 @@ typedef enum _mgmt_table {
TSDB_MGMT_TABLE_SCORES
,
TSDB_MGMT_TABLE_SCORES
,
TSDB_MGMT_TABLE_GRANTS
,
TSDB_MGMT_TABLE_GRANTS
,
TSDB_MGMT_TABLE_VNODES
,
TSDB_MGMT_TABLE_VNODES
,
TSDB_MGMT_TABLE_STREAMTABLES
,
TSDB_MGMT_TABLE_CLUSTER
,
TSDB_MGMT_TABLE_CLUSTER
,
TSDB_MGMT_TABLE_STREAMTABLES
,
TSDB_MGMT_TABLE_TP
,
TSDB_MGMT_TABLE_TP
,
TSDB_MGMT_TABLE_FUNCTION
,
TSDB_MGMT_TABLE_FUNCTION
,
TSDB_MGMT_TABLE_MAX
,
TSDB_MGMT_TABLE_MAX
,
...
...
source/dnode/mgmt/impl/test/CMakeLists.txt
浏览文件 @
f57151d2
# add_subdirectory(acct)
# add_subdirectory(acct)
# add_subdirectory(auth)
# add_subdirectory(balance)
# add_subdirectory(cluster)
# add_subdirectory(cluster)
add_subdirectory
(
db
)
add_subdirectory
(
db
)
add_subdirectory
(
dnode
)
add_subdirectory
(
dnode
)
# add_subdirectory(func)
# add_subdirectory(mnode)
# add_subdirectory(profile)
# add_subdirectory(profile)
# add_subdirectory(show)
# add_subdirectory(show)
# add_subdirectory(stb)
# add_subdirectory(sync)
# add_subdirectory(telem)
# add_subdirectory(trans)
add_subdirectory
(
user
)
add_subdirectory
(
user
)
# add_subdirectory(vgroup)
# add_subdirectory(common)
source/dnode/mgmt/impl/test/db/db.cpp
浏览文件 @
f57151d2
...
@@ -27,9 +27,9 @@ class DndTestDb : public ::testing::Test {
...
@@ -27,9 +27,9 @@ class DndTestDb : public ::testing::Test {
initLog
(
"/tmp/dnode_test_db"
);
initLog
(
"/tmp/dnode_test_db"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9
53
0"
;
const
char
*
firstEp
=
"localhost:9
04
0"
;
pServer
=
CreateServer
(
"/tmp/dnode_test_db"
,
fqdn
,
9
53
0
,
firstEp
);
pServer
=
CreateServer
(
"/tmp/dnode_test_db"
,
fqdn
,
9
04
0
,
firstEp
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9
53
0
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9
04
0
);
taosMsleep
(
300
);
taosMsleep
(
300
);
}
}
...
@@ -134,12 +134,24 @@ class DndTestDb : public ::testing::Test {
...
@@ -134,12 +134,24 @@ class DndTestDb : public ::testing::Test {
pos
=
0
;
pos
=
0
;
}
}
void
CheckInt8
(
int8_t
val
)
{
int8_t
data
=
*
((
int8_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int8_t
);
EXPECT_EQ
(
data
,
val
);
}
void
CheckInt16
(
int16_t
val
)
{
void
CheckInt16
(
int16_t
val
)
{
int16_t
data
=
*
((
int16_t
*
)(
pData
+
pos
));
int16_t
data
=
*
((
int16_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int16_t
);
pos
+=
sizeof
(
int16_t
);
EXPECT_EQ
(
data
,
val
);
EXPECT_EQ
(
data
,
val
);
}
}
void
CheckInt32
(
int32_t
val
)
{
int32_t
data
=
*
((
int32_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int32_t
);
EXPECT_EQ
(
data
,
val
);
}
void
CheckInt64
(
int64_t
val
)
{
void
CheckInt64
(
int64_t
val
)
{
int64_t
data
=
*
((
int64_t
*
)(
pData
+
pos
));
int64_t
data
=
*
((
int64_t
*
)(
pData
+
pos
));
pos
+=
sizeof
(
int64_t
);
pos
+=
sizeof
(
int64_t
);
...
@@ -170,30 +182,55 @@ SServer* DndTestDb::pServer;
...
@@ -170,30 +182,55 @@ SServer* DndTestDb::pServer;
SClient
*
DndTestDb
::
pClient
;
SClient
*
DndTestDb
::
pClient
;
int32_t
DndTestDb
::
connId
;
int32_t
DndTestDb
::
connId
;
TEST_F
(
DndTestDb
,
ShowUser
)
{
TEST_F
(
DndTestDb
,
ShowDb
)
{
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_USER
,
"show users"
,
4
);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DB
,
"show databases"
,
16
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_BINARY
,
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
,
"name"
);
CheckSchema
(
0
,
TSDB_DATA_TYPE_BINARY
,
TSDB_DB_NAME_LEN
-
1
+
VARSTR_HEADER_SIZE
,
"name"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_BINARY
,
10
+
VARSTR_HEADER_SIZE
,
"privilege"
);
CheckSchema
(
1
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create time"
);
CheckSchema
(
2
,
TSDB_DATA_TYPE_TIMESTAMP
,
8
,
"create time"
);
CheckSchema
(
2
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"replica"
);
CheckSchema
(
3
,
TSDB_DATA_TYPE_BINARY
,
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
,
"account"
);
CheckSchema
(
3
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"quorum"
);
CheckSchema
(
4
,
TSDB_DATA_TYPE_SMALLINT
,
2
,
"days"
);
SendThenCheckShowRetrieveMsg
(
1
);
CheckSchema
(
5
,
TSDB_DATA_TYPE_BINARY
,
24
+
VARSTR_HEADER_SIZE
,
"keep0,keep1,keep2"
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckSchema
(
6
,
TSDB_DATA_TYPE_INT
,
4
,
"cache(MB)"
);
CheckBinary
(
"super"
,
10
);
CheckSchema
(
7
,
TSDB_DATA_TYPE_INT
,
4
,
"blocks"
);
CheckTimestamp
();
CheckSchema
(
8
,
TSDB_DATA_TYPE_INT
,
4
,
"minrows"
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckSchema
(
9
,
TSDB_DATA_TYPE_INT
,
4
,
"maxrows"
);
CheckSchema
(
10
,
TSDB_DATA_TYPE_TINYINT
,
1
,
"wallevel"
);
CheckSchema
(
11
,
TSDB_DATA_TYPE_INT
,
4
,
"fsync"
);
CheckSchema
(
12
,
TSDB_DATA_TYPE_TINYINT
,
1
,
"comp"
);
CheckSchema
(
13
,
TSDB_DATA_TYPE_TINYINT
,
1
,
"cachelast"
);
CheckSchema
(
14
,
TSDB_DATA_TYPE_BINARY
,
3
+
VARSTR_HEADER_SIZE
,
"precision"
);
CheckSchema
(
15
,
TSDB_DATA_TYPE_TINYINT
,
1
,
"update"
);
SendThenCheckShowRetrieveMsg
(
0
);
}
}
TEST_F
(
DndTestDb
,
Create
User
_01
)
{
TEST_F
(
DndTestDb
,
Create
Db
_01
)
{
{
{
SCreateUserMsg
*
pReq
=
(
SCreateUserMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateUserMsg
));
SCreateDbMsg
*
pReq
=
(
SCreateDbMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDbMsg
));
strcpy
(
pReq
->
user
,
"u1"
);
strcpy
(
pReq
->
db
,
"d1"
);
strcpy
(
pReq
->
pass
,
"p1"
);
pReq
->
cacheBlockSize
=
16
;
pReq
->
totalBlocks
=
10
;
pReq
->
daysPerFile
=
10
;
pReq
->
daysToKeep0
=
3650
;
pReq
->
daysToKeep1
=
3650
;
pReq
->
daysToKeep2
=
3650
;
pReq
->
minRowsPerFileBlock
=
100
;
pReq
->
maxRowsPerFileBlock
=
4096
;
pReq
->
commitTime
=
3600
;
pReq
->
fsyncPeriod
=
3000
;
pReq
->
walLevel
=
1
;
pReq
->
precision
=
0
;
pReq
->
compression
=
2
;
pReq
->
replications
=
1
;
pReq
->
quorum
=
1
;
pReq
->
update
=
0
;
pReq
->
cacheLastRow
=
0
;
pReq
->
ignoreExist
=
1
;
SRpcMsg
rpcMsg
=
{
0
};
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SCreateUserMsg
);
rpcMsg
.
contLen
=
sizeof
(
SCreateUserMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_CREATE_
USER
;
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_CREATE_
DB
;
sendMsg
(
pClient
,
&
rpcMsg
);
sendMsg
(
pClient
,
&
rpcMsg
);
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
...
@@ -201,38 +238,27 @@ TEST_F(DndTestDb, CreateUser_01) {
...
@@ -201,38 +238,27 @@ TEST_F(DndTestDb, CreateUser_01) {
ASSERT_EQ
(
pMsg
->
code
,
0
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
}
{
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_USER
,
"show databases"
,
6
);
SCreateUserMsg
*
pReq
=
(
SCreateUserMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateUserMsg
));
strcpy
(
pReq
->
user
,
"u2"
);
strcpy
(
pReq
->
pass
,
"p2"
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
sizeof
(
SCreateUserMsg
);
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_CREATE_USER
;
sendMsg
(
pClient
,
&
rpcMsg
);
SRpcMsg
*
pMsg
=
pClient
->
pRsp
;
ASSERT_NE
(
pMsg
,
nullptr
);
ASSERT_EQ
(
pMsg
->
code
,
0
);
}
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_USER
,
"show users"
,
4
);
SendThenCheckShowRetrieveMsg
(
3
);
SendThenCheckShowRetrieveMsg
(
3
);
CheckBinary
(
"u1"
,
TSDB_USER_LEN
);
CheckBinary
(
"d1"
,
TSDB_DB_NAME_LEN
-
1
);
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckBinary
(
"u2"
,
TSDB_USER_LEN
);
CheckBinary
(
"normal"
,
10
);
CheckBinary
(
"super"
,
10
);
CheckBinary
(
"normal"
,
10
);
CheckTimestamp
();
CheckTimestamp
();
CheckTimestamp
();
CheckTimestamp
();
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckInt16
(
1
);
// replica
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckInt16
(
1
);
// quorum
CheckBinary
(
"root"
,
TSDB_USER_LEN
);
CheckInt16
(
10
);
// days
CheckBinary
(
"3650,3650,3650"
,
24
);
// days
CheckInt32
(
16
);
// cache
CheckInt32
(
10
);
// blocks
CheckInt32
(
100
);
// minrows
CheckInt32
(
4096
);
// maxrows
CheckInt8
(
1
);
// wallevel
CheckInt32
(
3000
);
// fsync
CheckInt8
(
2
);
// comp
CheckInt8
(
0
);
// cachelast
CheckBinary
(
"ms"
,
3
);
// precision
CheckInt8
(
0
);
// update
}
}
#if 0
TEST_F(DndTestDb, AlterUser_01) {
TEST_F(DndTestDb, AlterUser_01) {
SAlterUserMsg* pReq = (SAlterUserMsg*)rpcMallocCont(sizeof(SAlterUserMsg));
SAlterUserMsg* pReq = (SAlterUserMsg*)rpcMallocCont(sizeof(SAlterUserMsg));
strcpy(pReq->user, "u1");
strcpy(pReq->user, "u1");
...
@@ -297,8 +323,8 @@ TEST_F(DndTestDb, RestartDnode) {
...
@@ -297,8 +323,8 @@ TEST_F(DndTestDb, RestartDnode) {
uInfo("start all server");
uInfo("start all server");
const char* fqdn = "localhost";
const char* fqdn = "localhost";
const
char
*
firstEp
=
"localhost:9
53
0"
;
const char* firstEp = "localhost:9
04
0";
pServer
=
startServer
(
"/tmp/dnode_test_db"
,
fqdn
,
9
53
0
,
firstEp
);
pServer = startServer("/tmp/dnode_test_db", fqdn, 9
04
0, firstEp);
uInfo("all server is running");
uInfo("all server is running");
...
@@ -313,3 +339,5 @@ TEST_F(DndTestDb, RestartDnode) {
...
@@ -313,3 +339,5 @@ TEST_F(DndTestDb, RestartDnode) {
CheckBinary("root", TSDB_USER_LEN);
CheckBinary("root", TSDB_USER_LEN);
CheckBinary("root", TSDB_USER_LEN);
CheckBinary("root", TSDB_USER_LEN);
}
}
#endif
\ No newline at end of file
source/dnode/mgmt/impl/test/dnode/dnode.cpp
浏览文件 @
f57151d2
...
@@ -27,13 +27,13 @@ class DndTestDnode : public ::testing::Test {
...
@@ -27,13 +27,13 @@ class DndTestDnode : public ::testing::Test {
initLog
(
"/tmp/dnode_test_dnode"
);
initLog
(
"/tmp/dnode_test_dnode"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9
52
1"
;
const
char
*
firstEp
=
"localhost:9
04
1"
;
pServer1
=
CreateServer
(
"/tmp/dnode_test_dnode1"
,
fqdn
,
9
52
1
,
firstEp
);
pServer1
=
CreateServer
(
"/tmp/dnode_test_dnode1"
,
fqdn
,
9
04
1
,
firstEp
);
pServer2
=
CreateServer
(
"/tmp/dnode_test_dnode2"
,
fqdn
,
9
52
2
,
firstEp
);
pServer2
=
CreateServer
(
"/tmp/dnode_test_dnode2"
,
fqdn
,
9
04
2
,
firstEp
);
pServer3
=
CreateServer
(
"/tmp/dnode_test_dnode3"
,
fqdn
,
9
52
3
,
firstEp
);
pServer3
=
CreateServer
(
"/tmp/dnode_test_dnode3"
,
fqdn
,
9
04
3
,
firstEp
);
pServer4
=
CreateServer
(
"/tmp/dnode_test_dnode4"
,
fqdn
,
9
52
4
,
firstEp
);
pServer4
=
CreateServer
(
"/tmp/dnode_test_dnode4"
,
fqdn
,
9
04
4
,
firstEp
);
pServer5
=
CreateServer
(
"/tmp/dnode_test_dnode5"
,
fqdn
,
9
52
5
,
firstEp
);
pServer5
=
CreateServer
(
"/tmp/dnode_test_dnode5"
,
fqdn
,
9
04
5
,
firstEp
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9
52
1
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9
04
1
);
taosMsleep
(
300
);
taosMsleep
(
300
);
}
}
...
@@ -200,7 +200,7 @@ TEST_F(DndTestDnode, ShowDnode) {
...
@@ -200,7 +200,7 @@ TEST_F(DndTestDnode, ShowDnode) {
SendThenCheckShowRetrieveMsg
(
1
);
SendThenCheckShowRetrieveMsg
(
1
);
CheckInt16
(
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:9
52
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
1"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
1
);
CheckInt16
(
1
);
CheckBinary
(
"ready"
,
10
);
CheckBinary
(
"ready"
,
10
);
...
@@ -226,7 +226,7 @@ TEST_F(DndTestDnode, ConfigDnode_01) {
...
@@ -226,7 +226,7 @@ TEST_F(DndTestDnode, ConfigDnode_01) {
TEST_F
(
DndTestDnode
,
CreateDnode_01
)
{
TEST_F
(
DndTestDnode
,
CreateDnode_01
)
{
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
strcpy
(
pReq
->
ep
,
"localhost:9
52
2"
);
strcpy
(
pReq
->
ep
,
"localhost:9
04
2"
);
SRpcMsg
rpcMsg
=
{
0
};
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
pCont
=
pReq
;
...
@@ -243,8 +243,8 @@ TEST_F(DndTestDnode, CreateDnode_01) {
...
@@ -243,8 +243,8 @@ TEST_F(DndTestDnode, CreateDnode_01) {
SendThenCheckShowRetrieveMsg
(
2
);
SendThenCheckShowRetrieveMsg
(
2
);
CheckInt16
(
1
);
CheckInt16
(
1
);
CheckInt16
(
2
);
CheckInt16
(
2
);
CheckBinary
(
"localhost:9
52
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
52
2"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
2"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
1
);
CheckInt16
(
1
);
...
@@ -274,7 +274,7 @@ TEST_F(DndTestDnode, DropDnode_01) {
...
@@ -274,7 +274,7 @@ TEST_F(DndTestDnode, DropDnode_01) {
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DNODE
,
"show dnodes"
,
7
);
SendTheCheckShowMetaMsg
(
TSDB_MGMT_TABLE_DNODE
,
"show dnodes"
,
7
);
SendThenCheckShowRetrieveMsg
(
1
);
SendThenCheckShowRetrieveMsg
(
1
);
CheckInt16
(
1
);
CheckInt16
(
1
);
CheckBinary
(
"localhost:9
52
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
1"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
1
);
CheckInt16
(
1
);
CheckBinary
(
"ready"
,
10
);
CheckBinary
(
"ready"
,
10
);
...
@@ -285,7 +285,7 @@ TEST_F(DndTestDnode, DropDnode_01) {
...
@@ -285,7 +285,7 @@ TEST_F(DndTestDnode, DropDnode_01) {
TEST_F
(
DndTestDnode
,
CreateDnode_02
)
{
TEST_F
(
DndTestDnode
,
CreateDnode_02
)
{
{
{
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
strcpy
(
pReq
->
ep
,
"localhost:9
52
3"
);
strcpy
(
pReq
->
ep
,
"localhost:9
04
3"
);
SRpcMsg
rpcMsg
=
{
0
};
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
pCont
=
pReq
;
...
@@ -300,7 +300,7 @@ TEST_F(DndTestDnode, CreateDnode_02) {
...
@@ -300,7 +300,7 @@ TEST_F(DndTestDnode, CreateDnode_02) {
{
{
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
strcpy
(
pReq
->
ep
,
"localhost:9
52
4"
);
strcpy
(
pReq
->
ep
,
"localhost:9
04
4"
);
SRpcMsg
rpcMsg
=
{
0
};
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
pCont
=
pReq
;
...
@@ -315,7 +315,7 @@ TEST_F(DndTestDnode, CreateDnode_02) {
...
@@ -315,7 +315,7 @@ TEST_F(DndTestDnode, CreateDnode_02) {
{
{
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
SCreateDnodeMsg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
sizeof
(
SCreateDnodeMsg
));
strcpy
(
pReq
->
ep
,
"localhost:9
52
5"
);
strcpy
(
pReq
->
ep
,
"localhost:9
04
5"
);
SRpcMsg
rpcMsg
=
{
0
};
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
pCont
=
pReq
;
...
@@ -335,10 +335,10 @@ TEST_F(DndTestDnode, CreateDnode_02) {
...
@@ -335,10 +335,10 @@ TEST_F(DndTestDnode, CreateDnode_02) {
CheckInt16
(
3
);
CheckInt16
(
3
);
CheckInt16
(
4
);
CheckInt16
(
4
);
CheckInt16
(
5
);
CheckInt16
(
5
);
CheckBinary
(
"localhost:9
52
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
52
3"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
3"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
52
4"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
4"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
52
5"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
5"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
...
@@ -377,11 +377,11 @@ TEST_F(DndTestDnode, RestartDnode_01) {
...
@@ -377,11 +377,11 @@ TEST_F(DndTestDnode, RestartDnode_01) {
uInfo
(
"start all server"
);
uInfo
(
"start all server"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9
52
1"
;
const
char
*
firstEp
=
"localhost:9
04
1"
;
pServer1
=
startServer
(
"/tmp/dnode_test_dnode1"
,
fqdn
,
9
52
1
,
firstEp
);
pServer1
=
startServer
(
"/tmp/dnode_test_dnode1"
,
fqdn
,
9
04
1
,
firstEp
);
pServer3
=
startServer
(
"/tmp/dnode_test_dnode3"
,
fqdn
,
9
52
3
,
firstEp
);
pServer3
=
startServer
(
"/tmp/dnode_test_dnode3"
,
fqdn
,
9
04
3
,
firstEp
);
pServer4
=
startServer
(
"/tmp/dnode_test_dnode4"
,
fqdn
,
9
52
4
,
firstEp
);
pServer4
=
startServer
(
"/tmp/dnode_test_dnode4"
,
fqdn
,
9
04
4
,
firstEp
);
pServer5
=
startServer
(
"/tmp/dnode_test_dnode5"
,
fqdn
,
9
52
5
,
firstEp
);
pServer5
=
startServer
(
"/tmp/dnode_test_dnode5"
,
fqdn
,
9
04
5
,
firstEp
);
uInfo
(
"all server is running"
);
uInfo
(
"all server is running"
);
...
@@ -392,10 +392,10 @@ TEST_F(DndTestDnode, RestartDnode_01) {
...
@@ -392,10 +392,10 @@ TEST_F(DndTestDnode, RestartDnode_01) {
CheckInt16
(
3
);
CheckInt16
(
3
);
CheckInt16
(
4
);
CheckInt16
(
4
);
CheckInt16
(
5
);
CheckInt16
(
5
);
CheckBinary
(
"localhost:9
52
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
1"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
52
3"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
3"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
52
4"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
4"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
52
5"
,
TSDB_EP_LEN
);
CheckBinary
(
"localhost:9
04
5"
,
TSDB_EP_LEN
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
CheckInt16
(
0
);
...
...
source/dnode/mgmt/impl/test/user/user.cpp
浏览文件 @
f57151d2
...
@@ -27,9 +27,9 @@ class DndTestUser : public ::testing::Test {
...
@@ -27,9 +27,9 @@ class DndTestUser : public ::testing::Test {
initLog
(
"/tmp/dnode_test_user"
);
initLog
(
"/tmp/dnode_test_user"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9
53
0"
;
const
char
*
firstEp
=
"localhost:9
14
0"
;
pServer
=
CreateServer
(
"/tmp/dnode_test_user"
,
fqdn
,
9
53
0
,
firstEp
);
pServer
=
CreateServer
(
"/tmp/dnode_test_user"
,
fqdn
,
9
14
0
,
firstEp
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9
53
0
);
pClient
=
createClient
(
"root"
,
"taosdata"
,
fqdn
,
9
14
0
);
taosMsleep
(
300
);
taosMsleep
(
300
);
}
}
...
@@ -297,8 +297,8 @@ TEST_F(DndTestUser, RestartDnode) {
...
@@ -297,8 +297,8 @@ TEST_F(DndTestUser, RestartDnode) {
uInfo
(
"start all server"
);
uInfo
(
"start all server"
);
const
char
*
fqdn
=
"localhost"
;
const
char
*
fqdn
=
"localhost"
;
const
char
*
firstEp
=
"localhost:9
53
0"
;
const
char
*
firstEp
=
"localhost:9
14
0"
;
pServer
=
startServer
(
"/tmp/dnode_test_user"
,
fqdn
,
9
53
0
,
firstEp
);
pServer
=
startServer
(
"/tmp/dnode_test_user"
,
fqdn
,
9
14
0
,
firstEp
);
uInfo
(
"all server is running"
);
uInfo
(
"all server is running"
);
...
...
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
f57151d2
...
@@ -151,7 +151,8 @@ static int32_t mndDbActionDelete(SSdb *pSdb, SDbObj *pDb) {
...
@@ -151,7 +151,8 @@ static int32_t mndDbActionDelete(SSdb *pSdb, SDbObj *pDb) {
static
int32_t
mndDbActionUpdate
(
SSdb
*
pSdb
,
SDbObj
*
pOldDb
,
SDbObj
*
pNewDb
)
{
static
int32_t
mndDbActionUpdate
(
SSdb
*
pSdb
,
SDbObj
*
pOldDb
,
SDbObj
*
pNewDb
)
{
mTrace
(
"db:%s, perform update action"
,
pOldDb
->
name
);
mTrace
(
"db:%s, perform update action"
,
pOldDb
->
name
);
memcpy
(
pOldDb
,
pNewDb
,
sizeof
(
SDbObj
));
pOldDb
->
updateTime
=
pNewDb
->
createdTime
;
memcpy
(
&
pOldDb
->
cfg
,
&
pNewDb
->
cfg
,
sizeof
(
SDbObj
));
return
0
;
return
0
;
}
}
...
...
source/dnode/mnode/impl/src/mndShow.c
浏览文件 @
f57151d2
...
@@ -296,6 +296,8 @@ char *mndShowStr(int32_t showType) {
...
@@ -296,6 +296,8 @@ char *mndShowStr(int32_t showType) {
return
"show streamtables"
;
return
"show streamtables"
;
case
TSDB_MGMT_TABLE_TP
:
case
TSDB_MGMT_TABLE_TP
:
return
"show topics"
;
return
"show topics"
;
case
TSDB_MGMT_TABLE_FUNCTION
:
return
"show functions"
;
default:
default:
return
"undefined"
;
return
"undefined"
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录