Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4f2e8bb3
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
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看板
提交
4f2e8bb3
编写于
12月 05, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-10431 dnode test01
上级
7d3a09c5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
36 addition
and
5 deletion
+36
-5
source/dnode/mgmt/impl/test/test01/dndTest01.cpp
source/dnode/mgmt/impl/test/test01/dndTest01.cpp
+3
-3
source/dnode/mgmt/impl/test/util/dndTestDeploy.cpp
source/dnode/mgmt/impl/test/util/dndTestDeploy.cpp
+1
-1
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+21
-1
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+1
-0
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+10
-0
未找到文件。
source/dnode/mgmt/impl/test/test01/dndTest01.cpp
浏览文件 @
4f2e8bb3
...
...
@@ -43,16 +43,16 @@ TEST_F(DndTest01, connectMsg) {
sendMsg
(
pClient
,
&
rpcMsg
);
SConnectRsp
*
pRsp
=
(
SConnectRsp
*
)
pClient
->
pRsp
;
SConnectRsp
*
pRsp
=
(
SConnectRsp
*
)
pClient
->
pRsp
->
pCont
;
ASSERT
(
pRsp
);
pRsp
->
acctId
=
htonl
(
pRsp
->
acctId
);
pRsp
->
clusterId
=
htonl
(
pRsp
->
clusterId
);
pRsp
->
connId
=
htonl
(
pRsp
->
connId
);
pRsp
->
epSet
.
port
[
0
]
=
hton
l
(
pRsp
->
epSet
.
port
[
0
]);
pRsp
->
epSet
.
port
[
0
]
=
hton
s
(
pRsp
->
epSet
.
port
[
0
]);
EXPECT_EQ
(
pRsp
->
acctId
,
1
);
EXPECT_GT
(
pRsp
->
clusterId
,
0
);
EXPECT_
GT
(
pRsp
->
connId
,
1
);
EXPECT_
EQ
(
pRsp
->
connId
,
1
);
EXPECT_EQ
(
pRsp
->
superAuth
,
1
);
EXPECT_EQ
(
pRsp
->
readAuth
,
1
);
EXPECT_EQ
(
pRsp
->
writeAuth
,
1
);
...
...
source/dnode/mgmt/impl/test/util/dndTestDeploy.cpp
浏览文件 @
4f2e8bb3
...
...
@@ -80,7 +80,7 @@ void dropServer(SServer* pServer) {
void
processClientRsp
(
void
*
parent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SClient
*
pClient
=
(
SClient
*
)
parent
;
pClient
->
pRsp
=
pMsg
;
taosMsleep
(
1
00000
);
//taosMsleep(10
00000);
tsem_post
(
&
pClient
->
sem
);
}
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
4f2e8bb3
...
...
@@ -137,4 +137,24 @@ bool mndIsMnode(SMnode *pMnode, int32_t dnodeId) {
return
true
;
}
void
mndGetMnodeEpSet
(
SMnode
*
pMnode
,
SEpSet
*
pEpSet
)
{}
\ No newline at end of file
void
mndGetMnodeEpSet
(
SMnode
*
pMnode
,
SEpSet
*
pEpSet
)
{
SSdb
*
pSdb
=
pMnode
->
pSdb
;
pEpSet
->
numOfEps
=
0
;
void
*
pIter
=
NULL
;
while
(
1
)
{
SMnodeObj
*
pMnodeObj
=
NULL
;
pIter
=
sdbFetch
(
pSdb
,
SDB_MNODE
,
pIter
,
(
void
**
)
&
pMnodeObj
);
if
(
pIter
==
NULL
)
break
;
if
(
pMnodeObj
->
pDnode
==
NULL
)
break
;
pEpSet
->
port
[
pEpSet
->
numOfEps
]
=
htons
(
pMnodeObj
->
pDnode
->
port
);
tstrncpy
(
pEpSet
->
fqdn
[
pEpSet
->
numOfEps
],
pMnodeObj
->
pDnode
->
fqdn
,
TSDB_FQDN_LEN
);
if
(
pMnodeObj
->
role
==
TAOS_SYNC_STATE_LEADER
)
{
pEpSet
->
inUse
=
pEpSet
->
numOfEps
;
}
pEpSet
->
numOfEps
++
;
}
}
\ No newline at end of file
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
4f2e8bb3
...
...
@@ -130,6 +130,7 @@ static SConnObj *mndCreateConn(SMnode *pMnode, char *user, uint32_t ip, uint16_t
static
void
mndFreeConn
(
SConnObj
*
pConn
)
{
tfree
(
pConn
->
pQueries
);
tfree
(
pConn
->
pStreams
);
tfree
(
pConn
);
mDebug
(
"conn:%d, is destroyed"
,
pConn
->
connId
);
}
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
4f2e8bb3
...
...
@@ -59,6 +59,8 @@ static int32_t mndCreateDefaultUser(SMnode *pMnode, char *acct, char *user, char
taosEncryptPass
((
uint8_t
*
)
pass
,
strlen
(
pass
),
userObj
.
pass
);
userObj
.
createdTime
=
taosGetTimestampMs
();
userObj
.
updateTime
=
userObj
.
createdTime
;
userObj
.
readAuth
=
1
;
userObj
.
writeAuth
=
1
;
if
(
strcmp
(
user
,
TSDB_DEFAULT_USER
)
==
0
)
{
userObj
.
superAuth
=
1
;
...
...
@@ -95,6 +97,8 @@ static SSdbRaw *mndUserActionEncode(SUserObj *pUser) {
SDB_SET_INT64
(
pRaw
,
dataPos
,
pUser
->
createdTime
)
SDB_SET_INT64
(
pRaw
,
dataPos
,
pUser
->
updateTime
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pUser
->
superAuth
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pUser
->
readAuth
)
SDB_SET_INT8
(
pRaw
,
dataPos
,
pUser
->
writeAuth
)
SDB_SET_DATALEN
(
pRaw
,
dataPos
);
return
pRaw
;
...
...
@@ -121,6 +125,8 @@ static SSdbRow *mndUserActionDecode(SSdbRaw *pRaw) {
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pUser
->
createdTime
)
SDB_GET_INT64
(
pRaw
,
pRow
,
dataPos
,
&
pUser
->
updateTime
)
SDB_GET_INT8
(
pRaw
,
pRow
,
dataPos
,
&
pUser
->
superAuth
)
SDB_GET_INT8
(
pRaw
,
pRow
,
dataPos
,
&
pUser
->
readAuth
)
SDB_GET_INT8
(
pRaw
,
pRow
,
dataPos
,
&
pUser
->
writeAuth
)
return
pRow
;
}
...
...
@@ -164,6 +170,8 @@ static int32_t mndUserActionUpdate(SSdb *pSdb, SUserObj *pSrcUser, SUserObj *pDs
pSrcUser
->
createdTime
=
pDstUser
->
createdTime
;
pSrcUser
->
updateTime
=
pDstUser
->
updateTime
;
pSrcUser
->
superAuth
=
pDstUser
->
superAuth
;
pSrcUser
->
readAuth
=
pDstUser
->
readAuth
;
pSrcUser
->
writeAuth
=
pDstUser
->
writeAuth
;
return
0
;
}
...
...
@@ -185,6 +193,8 @@ static int32_t mndCreateUser(SMnode *pMnode, char *acct, char *user, char *pass,
userObj
.
createdTime
=
taosGetTimestampMs
();
userObj
.
updateTime
=
userObj
.
createdTime
;
userObj
.
superAuth
=
0
;
userObj
.
readAuth
=
1
;
userObj
.
writeAuth
=
1
;
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
pMsg
->
rpcMsg
.
handle
);
if
(
pTrans
==
NULL
)
return
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录