Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
93153bd2
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看板
提交
93153bd2
编写于
1月 06, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
minor changes
上级
f7769b09
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
100 addition
and
100 deletion
+100
-100
include/common/tmsg.h
include/common/tmsg.h
+4
-4
source/dnode/mgmt/impl/src/dndDnode.c
source/dnode/mgmt/impl/src/dndDnode.c
+4
-4
source/dnode/mgmt/impl/test/mnode/mnode.cpp
source/dnode/mgmt/impl/test/mnode/mnode.cpp
+10
-10
source/dnode/mnode/impl/src/mndDnode.c
source/dnode/mnode/impl/src/mndDnode.c
+47
-47
source/dnode/mnode/impl/test/bnode/bnode.cpp
source/dnode/mnode/impl/test/bnode/bnode.cpp
+2
-2
source/dnode/mnode/impl/test/dnode/dnode.cpp
source/dnode/mnode/impl/test/dnode/dnode.cpp
+12
-12
source/dnode/mnode/impl/test/qnode/qnode.cpp
source/dnode/mnode/impl/test/qnode/qnode.cpp
+2
-2
source/dnode/mnode/impl/test/snode/snode.cpp
source/dnode/mnode/impl/test/snode/snode.cpp
+2
-2
source/dnode/mnode/impl/test/trans/trans.cpp
source/dnode/mnode/impl/test/trans/trans.cpp
+2
-2
source/libs/parser/inc/astToMsg.h
source/libs/parser/inc/astToMsg.h
+2
-2
source/libs/parser/src/astToMsg.c
source/libs/parser/src/astToMsg.c
+6
-6
source/libs/parser/src/astValidate.c
source/libs/parser/src/astValidate.c
+1
-1
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+5
-5
未找到文件。
include/common/tmsg.h
浏览文件 @
93153bd2
...
...
@@ -657,7 +657,7 @@ typedef struct {
char
dnodeEp
[
TSDB_EP_LEN
];
SClusterCfg
clusterCfg
;
SVnodeLoads
vnodeLoads
;
}
SStatus
Msg
;
}
SStatus
Req
;
typedef
struct
{
int32_t
reserved
;
...
...
@@ -833,16 +833,16 @@ typedef struct SShowRsp {
typedef
struct
{
char
fqdn
[
TSDB_FQDN_LEN
];
// end point, hostname:port
int32_t
port
;
}
SCreateDnode
Msg
;
}
SCreateDnode
Req
;
typedef
struct
{
int32_t
dnodeId
;
}
SDropDnode
Msg
;
}
SDropDnode
Req
;
typedef
struct
{
int32_t
dnodeId
;
char
config
[
TSDB_DNODE_CONFIG_LEN
];
}
S
CfgDnodeMsg
;
}
S
MCfgDnodeReq
,
SDCfgDnodeReq
;
typedef
struct
{
int32_t
dnodeId
;
...
...
source/dnode/mgmt/impl/src/dndDnode.c
浏览文件 @
93153bd2
...
...
@@ -355,9 +355,9 @@ static int32_t dndWriteDnodes(SDnode *pDnode) {
}
void
dndSendStatusReq
(
SDnode
*
pDnode
)
{
int32_t
contLen
=
sizeof
(
SStatus
Msg
)
+
TSDB_MAX_VNODES
*
sizeof
(
SVnodeLoad
);
int32_t
contLen
=
sizeof
(
SStatus
Req
)
+
TSDB_MAX_VNODES
*
sizeof
(
SVnodeLoad
);
SStatus
Msg
*
pStatus
=
rpcMallocCont
(
contLen
);
SStatus
Req
*
pStatus
=
rpcMallocCont
(
contLen
);
if
(
pStatus
==
NULL
)
{
dError
(
"failed to malloc status message"
);
return
;
...
...
@@ -385,7 +385,7 @@ void dndSendStatusReq(SDnode *pDnode) {
taosRUnLockLatch
(
&
pMgmt
->
latch
);
dndGetVnodeLoads
(
pDnode
,
&
pStatus
->
vnodeLoads
);
contLen
=
sizeof
(
SStatus
Msg
)
+
pStatus
->
vnodeLoads
.
num
*
sizeof
(
SVnodeLoad
);
contLen
=
sizeof
(
SStatus
Req
)
+
pStatus
->
vnodeLoads
.
num
*
sizeof
(
SVnodeLoad
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pStatus
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_STATUS
,
.
ahandle
=
(
void
*
)
9527
};
pMgmt
->
statusSent
=
1
;
...
...
@@ -464,7 +464,7 @@ static void dndProcessGrantRsp(SDnode *pDnode, SRpcMsg *pMsg) { assert(1); }
static
int32_t
dndProcessConfigDnodeReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
)
{
dError
(
"config msg is received, but not supported yet"
);
S
CfgDnodeMsg
*
pCfg
=
pMsg
->
pCont
;
S
DCfgDnodeReq
*
pCfg
=
pMsg
->
pCont
;
return
TSDB_CODE_OPS_NOT_SUPPORT
;
}
...
...
source/dnode/mgmt/impl/test/mnode/mnode.cpp
浏览文件 @
93153bd2
...
...
@@ -99,9 +99,9 @@ TEST_F(DndTestMnode, 03_Create_Mnode_Invalid_Id) {
TEST_F
(
DndTestMnode
,
04
_Create_Mnode
)
{
{
// create dnode
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9062
);
...
...
@@ -165,9 +165,9 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
}
}
// {
// int32_t contLen = sizeof(SDropDnode
Msg
);
// int32_t contLen = sizeof(SDropDnode
Req
);
// SDropDnode
Msg* pReq = (SDropDnodeMsg
*)rpcMallocCont(contLen);
// SDropDnode
Req* pReq = (SDropDnodeReq
*)rpcMallocCont(contLen);
// pReq->dnodeId = htonl(2);
// SRpcMsg* pRsp = test.SendReq(TDMT_MND_DROP_DNODE, pReq, contLen);
...
...
@@ -189,9 +189,9 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// CheckBinary("", 24);
// {
// int32_t contLen = sizeof(SCreateDnode
Msg
);
// int32_t contLen = sizeof(SCreateDnode
Req
);
// SCreateDnode
Msg* pReq = (SCreateDnodeMsg
*)rpcMallocCont(contLen);
// SCreateDnode
Req* pReq = (SCreateDnodeReq
*)rpcMallocCont(contLen);
// strcpy(pReq->ep, "localhost:9063");
// SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DNODE, pReq, contLen);
...
...
@@ -200,9 +200,9 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// }
// {
// int32_t contLen = sizeof(SCreateDnode
Msg
);
// int32_t contLen = sizeof(SCreateDnode
Req
);
// SCreateDnode
Msg* pReq = (SCreateDnodeMsg
*)rpcMallocCont(contLen);
// SCreateDnode
Req* pReq = (SCreateDnodeReq
*)rpcMallocCont(contLen);
// strcpy(pReq->ep, "localhost:9064");
// SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DNODE, pReq, contLen);
...
...
@@ -211,9 +211,9 @@ TEST_F(DndTestMnode, 04_Create_Mnode) {
// }
// {
// int32_t contLen = sizeof(SCreateDnode
Msg
);
// int32_t contLen = sizeof(SCreateDnode
Req
);
// SCreateDnode
Msg* pReq = (SCreateDnodeMsg
*)rpcMallocCont(contLen);
// SCreateDnode
Req* pReq = (SCreateDnodeReq
*)rpcMallocCont(contLen);
// strcpy(pReq->ep, "localhost:9065");
// SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DNODE, pReq, contLen);
...
...
source/dnode/mnode/impl/src/mndDnode.c
浏览文件 @
93153bd2
...
...
@@ -47,17 +47,17 @@ static int32_t mndDnodeActionInsert(SSdb *pSdb, SDnodeObj *pDnode);
static
int32_t
mndDnodeActionDelete
(
SSdb
*
pSdb
,
SDnodeObj
*
pDnode
);
static
int32_t
mndDnodeActionUpdate
(
SSdb
*
pSdb
,
SDnodeObj
*
pOldDnode
,
SDnodeObj
*
pNewDnode
);
static
int32_t
mndProcessCreateDnode
Msg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mndProcessDropDnode
Msg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mndProcessConfigDnode
Msg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mndProcessConfigDnodeRsp
(
SMnodeMsg
*
p
Msg
);
static
int32_t
mndProcessStatus
Msg
(
SMnodeMsg
*
pMsg
);
static
int32_t
mndGetConfigMeta
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
);
static
int32_t
mndRetrieveConfigs
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndProcessCreateDnode
Req
(
SMnodeMsg
*
pReq
);
static
int32_t
mndProcessDropDnode
Req
(
SMnodeMsg
*
pReq
);
static
int32_t
mndProcessConfigDnode
Req
(
SMnodeMsg
*
pReq
);
static
int32_t
mndProcessConfigDnodeRsp
(
SMnodeMsg
*
p
Rsp
);
static
int32_t
mndProcessStatus
Req
(
SMnodeMsg
*
pReq
);
static
int32_t
mndGetConfigMeta
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
);
static
int32_t
mndRetrieveConfigs
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextConfig
(
SMnode
*
pMnode
,
void
*
pIter
);
static
int32_t
mndGetDnodeMeta
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
);
static
int32_t
mndRetrieveDnodes
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
int32_t
mndGetDnodeMeta
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
);
static
int32_t
mndRetrieveDnodes
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
);
static
void
mndCancelGetNextDnode
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitDnode
(
SMnode
*
pMnode
)
{
...
...
@@ -70,11 +70,11 @@ int32_t mndInitDnode(SMnode *pMnode) {
.
updateFp
=
(
SdbUpdateFp
)
mndDnodeActionUpdate
,
.
deleteFp
=
(
SdbDeleteFp
)
mndDnodeActionDelete
};
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_DNODE
,
mndProcessCreateDnode
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_DNODE
,
mndProcessDropDnode
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CONFIG_DNODE
,
mndProcessConfigDnode
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_DNODE
,
mndProcessCreateDnode
Req
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_DNODE
,
mndProcessDropDnode
Req
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CONFIG_DNODE
,
mndProcessConfigDnode
Req
);
mndSetMsgHandle
(
pMnode
,
TDMT_DND_CONFIG_DNODE_RSP
,
mndProcessConfigDnodeRsp
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_STATUS
,
mndProcessStatus
Msg
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_STATUS
,
mndProcessStatus
Req
);
mndAddShowMetaHandle
(
pMnode
,
TSDB_MGMT_TABLE_VARIABLES
,
mndGetConfigMeta
);
mndAddShowRetrieveHandle
(
pMnode
,
TSDB_MGMT_TABLE_VARIABLES
,
mndRetrieveConfigs
);
...
...
@@ -299,7 +299,7 @@ static int32_t mndCheckClusterCfgPara(SMnode *pMnode, const SClusterCfg *pCfg) {
return
0
;
}
static
void
mndParseStatusMsg
(
SStatus
Msg
*
pStatus
)
{
static
void
mndParseStatusMsg
(
SStatus
Req
*
pStatus
)
{
pStatus
->
sver
=
htonl
(
pStatus
->
sver
);
pStatus
->
dnodeId
=
htonl
(
pStatus
->
dnodeId
);
pStatus
->
clusterId
=
htobe64
(
pStatus
->
clusterId
);
...
...
@@ -311,9 +311,9 @@ static void mndParseStatusMsg(SStatusMsg *pStatus) {
pStatus
->
clusterCfg
.
checkTime
=
htobe64
(
pStatus
->
clusterCfg
.
checkTime
);
}
static
int32_t
mndProcessStatus
Msg
(
SMnodeMsg
*
pMsg
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
SStatus
Msg
*
pStatus
=
pMsg
->
rpcMsg
.
pCont
;
static
int32_t
mndProcessStatus
Req
(
SMnodeMsg
*
pReq
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SStatus
Req
*
pStatus
=
pReq
->
rpcMsg
.
pCont
;
SDnodeObj
*
pDnode
=
NULL
;
int32_t
code
=
-
1
;
...
...
@@ -397,8 +397,8 @@ static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg) {
pRsp
->
dnodeCfg
.
clusterId
=
htobe64
(
pMnode
->
clusterId
);
mndGetDnodeData
(
pMnode
,
&
pRsp
->
dnodeEps
,
numOfEps
);
p
Msg
->
contLen
=
contLen
;
p
Msg
->
pCont
=
pRsp
;
p
Req
->
contLen
=
contLen
;
p
Req
->
pCont
=
pRsp
;
}
pDnode
->
lastAccessTime
=
curMs
;
...
...
@@ -409,7 +409,7 @@ PROCESS_STATUS_MSG_OVER:
return
code
;
}
static
int32_t
mndCreateDnode
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Msg
,
SCreateDnodeMsg
*
pCreate
)
{
static
int32_t
mndCreateDnode
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Req
,
SCreateDnodeReq
*
pCreate
)
{
SDnodeObj
dnodeObj
=
{
0
};
dnodeObj
.
id
=
sdbGetMaxId
(
pMnode
->
pSdb
,
SDB_DNODE
);
dnodeObj
.
createdTime
=
taosGetTimestampMs
();
...
...
@@ -418,7 +418,7 @@ static int32_t mndCreateDnode(SMnode *pMnode, SMnodeMsg *pMsg, SCreateDnodeMsg *
memcpy
(
dnodeObj
.
fqdn
,
pCreate
->
fqdn
,
TSDB_FQDN_LEN
);
snprintf
(
dnodeObj
.
ep
,
TSDB_EP_LEN
,
"%s:%u"
,
dnodeObj
.
fqdn
,
dnodeObj
.
port
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Msg
->
rpcMsg
);
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Req
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
mError
(
"dnode:%s, failed to create since %s"
,
dnodeObj
.
ep
,
terrstr
());
return
-
1
;
...
...
@@ -443,9 +443,9 @@ static int32_t mndCreateDnode(SMnode *pMnode, SMnodeMsg *pMsg, SCreateDnodeMsg *
return
0
;
}
static
int32_t
mndProcessCreateDnode
Msg
(
SMnodeMsg
*
pMsg
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
SCreateDnode
Msg
*
pCreate
=
pMsg
->
rpcMsg
.
pCont
;
static
int32_t
mndProcessCreateDnode
Req
(
SMnodeMsg
*
pReq
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SCreateDnode
Req
*
pCreate
=
pReq
->
rpcMsg
.
pCont
;
pCreate
->
port
=
htonl
(
pCreate
->
port
);
mDebug
(
"dnode:%s:%d, start to create"
,
pCreate
->
fqdn
,
pCreate
->
port
);
...
...
@@ -465,7 +465,7 @@ static int32_t mndProcessCreateDnodeMsg(SMnodeMsg *pMsg) {
return
-
1
;
}
int32_t
code
=
mndCreateDnode
(
pMnode
,
p
Msg
,
pCreate
);
int32_t
code
=
mndCreateDnode
(
pMnode
,
p
Req
,
pCreate
);
if
(
code
!=
0
)
{
mError
(
"dnode:%s:%d, failed to create since %s"
,
pCreate
->
fqdn
,
pCreate
->
port
,
terrstr
());
...
...
@@ -475,8 +475,8 @@ static int32_t mndProcessCreateDnodeMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
static
int32_t
mndDropDnode
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Msg
,
SDnodeObj
*
pDnode
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Msg
->
rpcMsg
);
static
int32_t
mndDropDnode
(
SMnode
*
pMnode
,
SMnodeMsg
*
p
Req
,
SDnodeObj
*
pDnode
)
{
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
&
p
Req
->
rpcMsg
);
if
(
pTrans
==
NULL
)
{
mError
(
"dnode:%d, failed to drop since %s"
,
pDnode
->
id
,
terrstr
());
return
-
1
;
...
...
@@ -501,9 +501,9 @@ static int32_t mndDropDnode(SMnode *pMnode, SMnodeMsg *pMsg, SDnodeObj *pDnode)
return
0
;
}
static
int32_t
mndProcessDropDnode
Msg
(
SMnodeMsg
*
pMsg
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
SDropDnode
Msg
*
pDrop
=
pMsg
->
rpcMsg
.
pCont
;
static
int32_t
mndProcessDropDnode
Req
(
SMnodeMsg
*
pReq
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SDropDnode
Req
*
pDrop
=
pReq
->
rpcMsg
.
pCont
;
pDrop
->
dnodeId
=
htonl
(
pDrop
->
dnodeId
);
mDebug
(
"dnode:%d, start to drop"
,
pDrop
->
dnodeId
);
...
...
@@ -521,7 +521,7 @@ static int32_t mndProcessDropDnodeMsg(SMnodeMsg *pMsg) {
return
-
1
;
}
int32_t
code
=
mndDropDnode
(
pMnode
,
p
Msg
,
pDnode
);
int32_t
code
=
mndDropDnode
(
pMnode
,
p
Req
,
pDnode
);
if
(
code
!=
0
)
{
mndReleaseDnode
(
pMnode
,
pDnode
);
mError
(
"dnode:%d, failed to drop since %s"
,
pDrop
->
dnodeId
,
terrstr
());
...
...
@@ -532,9 +532,9 @@ static int32_t mndProcessDropDnodeMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
static
int32_t
mndProcessConfigDnode
Msg
(
SMnodeMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
pMnode
;
S
CfgDnodeMsg
*
pCfg
=
pMsg
->
rpcMsg
.
pCont
;
static
int32_t
mndProcessConfigDnode
Req
(
SMnodeMsg
*
pReq
)
{
SMnode
*
pMnode
=
pReq
->
pMnode
;
S
MCfgDnodeReq
*
pCfg
=
pReq
->
rpcMsg
.
pCont
;
pCfg
->
dnodeId
=
htonl
(
pCfg
->
dnodeId
);
SDnodeObj
*
pDnode
=
mndAcquireDnode
(
pMnode
,
pCfg
->
dnodeId
);
...
...
@@ -547,14 +547,14 @@ static int32_t mndProcessConfigDnodeMsg(SMnodeMsg *pMsg) {
SEpSet
epSet
=
mndGetDnodeEpset
(
pDnode
);
mndReleaseDnode
(
pMnode
,
pDnode
);
S
CfgDnodeMsg
*
pCfgDnode
=
rpcMallocCont
(
sizeof
(
SCfgDnodeMsg
));
S
DCfgDnodeReq
*
pCfgDnode
=
rpcMallocCont
(
sizeof
(
SDCfgDnodeReq
));
pCfgDnode
->
dnodeId
=
htonl
(
pCfg
->
dnodeId
);
memcpy
(
pCfgDnode
->
config
,
pCfg
->
config
,
TSDB_DNODE_CONFIG_LEN
);
SRpcMsg
rpcMsg
=
{.
msgType
=
TDMT_DND_CONFIG_DNODE
,
.
pCont
=
pCfgDnode
,
.
contLen
=
sizeof
(
S
CfgDnodeMsg
),
.
ahandle
=
p
Msg
->
rpcMsg
.
ahandle
};
.
contLen
=
sizeof
(
S
DCfgDnodeReq
),
.
ahandle
=
p
Req
->
rpcMsg
.
ahandle
};
mInfo
(
"dnode:%d, app:%p config:%s req send to dnode"
,
pCfg
->
dnodeId
,
rpcMsg
.
ahandle
,
pCfg
->
config
);
mndSendReqToDnode
(
pMnode
,
&
epSet
,
&
rpcMsg
);
...
...
@@ -562,11 +562,11 @@ static int32_t mndProcessConfigDnodeMsg(SMnodeMsg *pMsg) {
return
0
;
}
static
int32_t
mndProcessConfigDnodeRsp
(
SMnodeMsg
*
p
Msg
)
{
mInfo
(
"app:%p config rsp from dnode"
,
p
Msg
->
rpcMsg
.
ahandle
);
static
int32_t
mndProcessConfigDnodeRsp
(
SMnodeMsg
*
p
Rsp
)
{
mInfo
(
"app:%p config rsp from dnode"
,
p
Rsp
->
rpcMsg
.
ahandle
);
}
static
int32_t
mndGetConfigMeta
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
)
{
static
int32_t
mndGetConfigMeta
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
)
{
int32_t
cols
=
0
;
SSchema
*
pSchema
=
pMeta
->
pSchema
;
...
...
@@ -597,8 +597,8 @@ static int32_t mndGetConfigMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg
return
0
;
}
static
int32_t
mndRetrieveConfigs
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
static
int32_t
mndRetrieveConfigs
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
int32_t
numOfRows
=
0
;
char
*
cfgOpts
[
TSDB_CONFIG_NUMBER
]
=
{
0
};
char
cfgVals
[
TSDB_CONFIG_NUMBER
][
TSDB_CONIIG_VALUE_LEN
+
1
]
=
{
0
};
...
...
@@ -640,8 +640,8 @@ static int32_t mndRetrieveConfigs(SMnodeMsg *pMsg, SShowObj *pShow, char *data,
static
void
mndCancelGetNextConfig
(
SMnode
*
pMnode
,
void
*
pIter
)
{}
static
int32_t
mndGetDnodeMeta
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
static
int32_t
mndGetDnodeMeta
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
STableMetaMsg
*
pMeta
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
cols
=
0
;
...
...
@@ -704,8 +704,8 @@ static int32_t mndGetDnodeMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *
return
0
;
}
static
int32_t
mndRetrieveDnodes
(
SMnodeMsg
*
p
Msg
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
p
Msg
->
pMnode
;
static
int32_t
mndRetrieveDnodes
(
SMnodeMsg
*
p
Req
,
SShowObj
*
pShow
,
char
*
data
,
int32_t
rows
)
{
SMnode
*
pMnode
=
p
Req
->
pMnode
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
...
...
source/dnode/mnode/impl/test/bnode/bnode.cpp
浏览文件 @
93153bd2
...
...
@@ -96,9 +96,9 @@ TEST_F(MndTestBnode, 02_Create_Bnode) {
TEST_F
(
MndTestBnode
,
03
_Drop_Bnode
)
{
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9019
);
...
...
source/dnode/mnode/impl/test/dnode/dnode.cpp
浏览文件 @
93153bd2
...
...
@@ -75,9 +75,9 @@ TEST_F(MndTestDnode, 01_ShowDnode) {
}
TEST_F
(
MndTestDnode
,
02
_ConfigDnode
)
{
int32_t
contLen
=
sizeof
(
S
CfgDnodeMsg
);
int32_t
contLen
=
sizeof
(
S
MCfgDnodeReq
);
S
CfgDnodeMsg
*
pReq
=
(
SCfgDnodeMsg
*
)
rpcMallocCont
(
contLen
);
S
MCfgDnodeReq
*
pReq
=
(
SMCfgDnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
1
);
strcpy
(
pReq
->
config
,
"ddebugflag 131"
);
...
...
@@ -88,9 +88,9 @@ TEST_F(MndTestDnode, 02_ConfigDnode) {
TEST_F
(
MndTestDnode
,
03
_Create_Drop_Restart_Dnode
)
{
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9024
);
...
...
@@ -122,9 +122,9 @@ TEST_F(MndTestDnode, 03_Create_Drop_Restart_Dnode) {
CheckBinary
(
""
,
24
);
{
int32_t
contLen
=
sizeof
(
SDropDnode
Msg
);
int32_t
contLen
=
sizeof
(
SDropDnode
Req
);
SDropDnode
Msg
*
pReq
=
(
SDropDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SDropDnode
Req
*
pReq
=
(
SDropDnodeReq
*
)
rpcMallocCont
(
contLen
);
pReq
->
dnodeId
=
htonl
(
2
);
SRpcMsg
*
pRsp
=
test
.
SendReq
(
TDMT_MND_DROP_DNODE
,
pReq
,
contLen
);
...
...
@@ -146,9 +146,9 @@ TEST_F(MndTestDnode, 03_Create_Drop_Restart_Dnode) {
CheckBinary
(
""
,
24
);
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9025
);
...
...
@@ -158,9 +158,9 @@ TEST_F(MndTestDnode, 03_Create_Drop_Restart_Dnode) {
}
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9026
);
...
...
@@ -170,9 +170,9 @@ TEST_F(MndTestDnode, 03_Create_Drop_Restart_Dnode) {
}
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9027
);
...
...
source/dnode/mnode/impl/test/qnode/qnode.cpp
浏览文件 @
93153bd2
...
...
@@ -96,9 +96,9 @@ TEST_F(MndTestQnode, 02_Create_Qnode) {
TEST_F
(
MndTestQnode
,
03
_Drop_Qnode
)
{
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9015
);
...
...
source/dnode/mnode/impl/test/snode/snode.cpp
浏览文件 @
93153bd2
...
...
@@ -96,9 +96,9 @@ TEST_F(MndTestSnode, 02_Create_Snode) {
TEST_F
(
MndTestSnode
,
03
_Drop_Snode
)
{
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9017
);
...
...
source/dnode/mnode/impl/test/trans/trans.cpp
浏览文件 @
93153bd2
...
...
@@ -133,9 +133,9 @@ TEST_F(MndTestTrans, 02_Create_Qnode1_Crash) {
TEST_F
(
MndTestTrans
,
03
_Create_Qnode2_Crash
)
{
{
int32_t
contLen
=
sizeof
(
SCreateDnode
Msg
);
int32_t
contLen
=
sizeof
(
SCreateDnode
Req
);
SCreateDnode
Msg
*
pReq
=
(
SCreateDnodeMsg
*
)
rpcMallocCont
(
contLen
);
SCreateDnode
Req
*
pReq
=
(
SCreateDnodeReq
*
)
rpcMallocCont
(
contLen
);
strcpy
(
pReq
->
fqdn
,
"localhost"
);
pReq
->
port
=
htonl
(
9020
);
...
...
source/libs/parser/inc/astToMsg.h
浏览文件 @
93153bd2
...
...
@@ -12,7 +12,7 @@ SShowReq* buildShowMsg(SShowInfo* pShowInfo, SParseBasicCtx* pParseCtx, char* ms
SCreateDbMsg
*
buildCreateDbMsg
(
SCreateDbInfo
*
pCreateDbInfo
,
SParseBasicCtx
*
pCtx
,
SMsgBuf
*
pMsgBuf
);
SCreateStbMsg
*
buildCreateStbMsg
(
SCreateTableSql
*
pCreateTableSql
,
int32_t
*
len
,
SParseBasicCtx
*
pParseCtx
,
SMsgBuf
*
pMsgBuf
);
SDropStbMsg
*
buildDropStableMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SParseBasicCtx
*
pParseCtx
,
SMsgBuf
*
pMsgBuf
);
SCreateDnode
Msg
*
buildCreateDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
);
SDropDnode
Msg
*
buildDropDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
);
SCreateDnode
Req
*
buildCreateDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
);
SDropDnode
Req
*
buildDropDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
);
#endif // TDENGINE_ASTTOMSG_H
source/libs/parser/src/astToMsg.c
浏览文件 @
93153bd2
...
...
@@ -335,7 +335,7 @@ SDropStbMsg* buildDropStableMsg(SSqlInfo* pInfo, int32_t* len, SParseBasicCtx* p
return
pDropTableMsg
;
}
SCreateDnode
Msg
*
buildCreateDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
)
{
SCreateDnode
Req
*
buildCreateDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
)
{
const
char
*
msg1
=
"invalid host name (name too long, maximum length 128)"
;
const
char
*
msg2
=
"dnode name can not be string"
;
const
char
*
msg3
=
"port should be an integer that is less than 65535 and greater than 0"
;
...
...
@@ -367,7 +367,7 @@ SCreateDnodeMsg *buildCreateDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMs
return
NULL
;
}
SCreateDnode
Msg
*
pCreate
=
(
SCreateDnodeMsg
*
)
calloc
(
1
,
sizeof
(
SCreateDnodeMsg
));
SCreateDnode
Req
*
pCreate
=
(
SCreateDnodeReq
*
)
calloc
(
1
,
sizeof
(
SCreateDnodeReq
));
if
(
pCreate
==
NULL
)
{
buildInvalidOperationMsg
(
pMsgBuf
,
msg4
);
return
NULL
;
...
...
@@ -376,18 +376,18 @@ SCreateDnodeMsg *buildCreateDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMs
strncpy
(
pCreate
->
fqdn
,
id
->
z
,
id
->
n
);
pCreate
->
port
=
htonl
(
val
);
*
len
=
sizeof
(
SCreateDnode
Msg
);
*
len
=
sizeof
(
SCreateDnode
Req
);
return
pCreate
;
}
SDropDnode
Msg
*
buildDropDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
)
{
SDropDnode
Req
*
buildDropDnodeMsg
(
SSqlInfo
*
pInfo
,
int32_t
*
len
,
SMsgBuf
*
pMsgBuf
)
{
SToken
*
pzName
=
taosArrayGet
(
pInfo
->
pMiscInfo
->
a
,
0
);
char
*
end
=
NULL
;
SDropDnode
Msg
*
pDrop
=
(
SDropDnodeMsg
*
)
calloc
(
1
,
sizeof
(
SDropDnodeMsg
));
SDropDnode
Req
*
pDrop
=
(
SDropDnodeReq
*
)
calloc
(
1
,
sizeof
(
SDropDnodeReq
));
pDrop
->
dnodeId
=
strtoll
(
pzName
->
z
,
&
end
,
10
);
pDrop
->
dnodeId
=
htonl
(
pDrop
->
dnodeId
);
*
len
=
sizeof
(
SDropDnode
Msg
);
*
len
=
sizeof
(
SDropDnode
Req
);
if
(
end
-
pzName
->
z
!=
pzName
->
n
)
{
buildInvalidOperationMsg
(
pMsgBuf
,
"invalid dnode id"
);
...
...
source/libs/parser/src/astValidate.c
浏览文件 @
93153bd2
...
...
@@ -3819,7 +3819,7 @@ int32_t qParserValidateSqlNode(struct SCatalog* pCatalog, SSqlInfo* pInfo, SQuer
char* pMsg = pCmd->payload;
S
CfgDnodeMsg* pCfg = (SCfgDnodeMsg
*)pMsg;
S
MCfgDnodeReq* pCfg = (SMCfgDnodeReq
*)pMsg;
SToken* t0 = taosArrayGet(pMiscInfo->a, 0);
SToken* t1 = taosArrayGet(pMiscInfo->a, 1);
...
...
src/client/src/tscSQLParser.c
浏览文件 @
93153bd2
...
...
@@ -776,7 +776,7 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
char
*
pMsg
=
pCmd
->
payload
;
S
CfgDnodeMsg
*
pCfg
=
(
SCfgDnodeMsg
*
)
pMsg
;
S
MCfgDnodeReq
*
pCfg
=
(
SMCfgDnodeReq
*
)
pMsg
;
SStrToken
*
t0
=
taosArrayGet
(
pMiscInfo
->
a
,
0
);
SStrToken
*
t1
=
taosArrayGet
(
pMiscInfo
->
a
,
1
);
...
...
src/client/src/tscServer.c
浏览文件 @
93153bd2
...
...
@@ -1192,13 +1192,13 @@ int32_t tscBuildCreateFuncMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t
tscBuildCreateDnodeMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
pCmd
->
payloadLen
=
sizeof
(
SCreateDnode
Msg
);
pCmd
->
payloadLen
=
sizeof
(
SCreateDnode
Req
);
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
pCmd
,
pCmd
->
payloadLen
))
{
tscError
(
"0x%"
PRIx64
" failed to malloc for query msg"
,
pSql
->
self
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
SCreateDnode
Msg
*
pCreate
=
(
SCreateDnodeMsg
*
)
pCmd
->
payload
;
SCreateDnode
Req
*
pCreate
=
(
SCreateDnodeReq
*
)
pCmd
->
payload
;
SStrToken
*
t0
=
taosArrayGet
(
pInfo
->
pMiscInfo
->
a
,
0
);
strncpy
(
pCreate
->
ep
,
t0
->
z
,
t0
->
n
);
...
...
@@ -1287,7 +1287,7 @@ int32_t tscBuildUserMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t
tscBuildCfgDnodeMsg
(
SSqlObj
*
pSql
,
SSqlInfo
*
pInfo
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
pCmd
->
payloadLen
=
sizeof
(
S
CfgDnodeMsg
);
pCmd
->
payloadLen
=
sizeof
(
S
MCfgDnodeReq
);
pCmd
->
msgType
=
TDMT_MND_CONFIG_DNODE
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1350,13 +1350,13 @@ int32_t tscBuildDropDnodeMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
char
dnodeEp
[
TSDB_EP_LEN
]
=
{
0
};
tstrncpy
(
dnodeEp
,
pCmd
->
payload
,
TSDB_EP_LEN
);
pCmd
->
payloadLen
=
sizeof
(
SDropDnode
Msg
);
pCmd
->
payloadLen
=
sizeof
(
SDropDnode
Req
);
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
pCmd
,
pCmd
->
payloadLen
))
{
tscError
(
"0x%"
PRIx64
" failed to malloc for query msg"
,
pSql
->
self
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
SDropDnode
Msg
*
pDrop
=
(
SDropDnodeMsg
*
)
pCmd
->
payload
;
SDropDnode
Req
*
pDrop
=
(
SDropDnodeReq
*
)
pCmd
->
payload
;
tstrncpy
(
pDrop
->
ep
,
dnodeEp
,
tListLen
(
pDrop
->
ep
));
pCmd
->
msgType
=
TDMT_MND_DROP_DNODE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录