diff --git a/include/common/tmsg.h b/include/common/tmsg.h index aa36754368fbe6551ebe9afef35dbde49f352ccc..a697ecb4a78137d7d350c7d5302ebdb728122f2e 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -657,7 +657,7 @@ typedef struct { char dnodeEp[TSDB_EP_LEN]; SClusterCfg clusterCfg; SVnodeLoads vnodeLoads; -} SStatusMsg; +} SStatusReq; 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; -} SCreateDnodeMsg; +} SCreateDnodeReq; typedef struct { int32_t dnodeId; -} SDropDnodeMsg; +} SDropDnodeReq; typedef struct { int32_t dnodeId; char config[TSDB_DNODE_CONFIG_LEN]; -} SCfgDnodeMsg; +} SMCfgDnodeReq, SDCfgDnodeReq; typedef struct { int32_t dnodeId; diff --git a/source/dnode/mgmt/impl/src/dndDnode.c b/source/dnode/mgmt/impl/src/dndDnode.c index f5f9bbf1b84367100b07e4c3216cbb3361a941c9..5e30c4f041d6170248029b302bae52d9bee32273 100644 --- a/source/dnode/mgmt/impl/src/dndDnode.c +++ b/source/dnode/mgmt/impl/src/dndDnode.c @@ -355,9 +355,9 @@ static int32_t dndWriteDnodes(SDnode *pDnode) { } void dndSendStatusReq(SDnode *pDnode) { - int32_t contLen = sizeof(SStatusMsg) + TSDB_MAX_VNODES * sizeof(SVnodeLoad); + int32_t contLen = sizeof(SStatusReq) + TSDB_MAX_VNODES * sizeof(SVnodeLoad); - SStatusMsg *pStatus = rpcMallocCont(contLen); + SStatusReq *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(SStatusMsg) + pStatus->vnodeLoads.num * sizeof(SVnodeLoad); + contLen = sizeof(SStatusReq) + 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"); - SCfgDnodeMsg *pCfg = pMsg->pCont; + SDCfgDnodeReq *pCfg = pMsg->pCont; return TSDB_CODE_OPS_NOT_SUPPORT; } diff --git a/source/dnode/mgmt/impl/test/mnode/mnode.cpp b/source/dnode/mgmt/impl/test/mnode/mnode.cpp index 9a725c20d380ea3cc2917e1546651c28cf59344b..468d8dc0c6fe88b0c3eb4d3e2c4dec368a20e1bf 100644 --- a/source/dnode/mgmt/impl/test/mnode/mnode.cpp +++ b/source/dnode/mgmt/impl/test/mnode/mnode.cpp @@ -99,9 +99,9 @@ TEST_F(DndTestMnode, 03_Create_Mnode_Invalid_Id) { TEST_F(DndTestMnode, 04_Create_Mnode) { { // create dnode - int32_t contLen = sizeof(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* 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(SDropDnodeMsg); +// int32_t contLen = sizeof(SDropDnodeReq); -// SDropDnodeMsg* pReq = (SDropDnodeMsg*)rpcMallocCont(contLen); +// SDropDnodeReq* 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(SCreateDnodeMsg); +// int32_t contLen = sizeof(SCreateDnodeReq); -// SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); +// SCreateDnodeReq* 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(SCreateDnodeMsg); +// int32_t contLen = sizeof(SCreateDnodeReq); -// SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); +// SCreateDnodeReq* 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(SCreateDnodeMsg); +// int32_t contLen = sizeof(SCreateDnodeReq); -// SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); +// SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen); // strcpy(pReq->ep, "localhost:9065"); // SRpcMsg* pRsp = test.SendReq(TDMT_MND_CREATE_DNODE, pReq, contLen); diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 2cca70b04ecb10ec4dc3cf43f2044fbd9dc2b41c..91cb5ec77f603c95b50b95414fc3b24316784cec 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -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 mndProcessCreateDnodeMsg(SMnodeMsg *pMsg); -static int32_t mndProcessDropDnodeMsg(SMnodeMsg *pMsg); -static int32_t mndProcessConfigDnodeMsg(SMnodeMsg *pMsg); -static int32_t mndProcessConfigDnodeRsp(SMnodeMsg *pMsg); -static int32_t mndProcessStatusMsg(SMnodeMsg *pMsg); - -static int32_t mndGetConfigMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *pMeta); -static int32_t mndRetrieveConfigs(SMnodeMsg *pMsg, SShowObj *pShow, char *data, int32_t rows); +static int32_t mndProcessCreateDnodeReq(SMnodeMsg *pReq); +static int32_t mndProcessDropDnodeReq(SMnodeMsg *pReq); +static int32_t mndProcessConfigDnodeReq(SMnodeMsg *pReq); +static int32_t mndProcessConfigDnodeRsp(SMnodeMsg *pRsp); +static int32_t mndProcessStatusReq(SMnodeMsg *pReq); + +static int32_t mndGetConfigMeta(SMnodeMsg *pReq, SShowObj *pShow, STableMetaMsg *pMeta); +static int32_t mndRetrieveConfigs(SMnodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows); static void mndCancelGetNextConfig(SMnode *pMnode, void *pIter); -static int32_t mndGetDnodeMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *pMeta); -static int32_t mndRetrieveDnodes(SMnodeMsg *pMsg, SShowObj *pShow, char *data, int32_t rows); +static int32_t mndGetDnodeMeta(SMnodeMsg *pReq, SShowObj *pShow, STableMetaMsg *pMeta); +static int32_t mndRetrieveDnodes(SMnodeMsg *pReq, 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, mndProcessCreateDnodeMsg); - mndSetMsgHandle(pMnode, TDMT_MND_DROP_DNODE, mndProcessDropDnodeMsg); - mndSetMsgHandle(pMnode, TDMT_MND_CONFIG_DNODE, mndProcessConfigDnodeMsg); + mndSetMsgHandle(pMnode, TDMT_MND_CREATE_DNODE, mndProcessCreateDnodeReq); + mndSetMsgHandle(pMnode, TDMT_MND_DROP_DNODE, mndProcessDropDnodeReq); + mndSetMsgHandle(pMnode, TDMT_MND_CONFIG_DNODE, mndProcessConfigDnodeReq); mndSetMsgHandle(pMnode, TDMT_DND_CONFIG_DNODE_RSP, mndProcessConfigDnodeRsp); - mndSetMsgHandle(pMnode, TDMT_MND_STATUS, mndProcessStatusMsg); + mndSetMsgHandle(pMnode, TDMT_MND_STATUS, mndProcessStatusReq); 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(SStatusMsg *pStatus) { +static void mndParseStatusMsg(SStatusReq *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 mndProcessStatusMsg(SMnodeMsg *pMsg) { - SMnode *pMnode = pMsg->pMnode; - SStatusMsg *pStatus = pMsg->rpcMsg.pCont; +static int32_t mndProcessStatusReq(SMnodeMsg *pReq) { + SMnode *pMnode = pReq->pMnode; + SStatusReq *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); - pMsg->contLen = contLen; - pMsg->pCont = pRsp; + pReq->contLen = contLen; + pReq->pCont = pRsp; } pDnode->lastAccessTime = curMs; @@ -409,7 +409,7 @@ PROCESS_STATUS_MSG_OVER: return code; } -static int32_t mndCreateDnode(SMnode *pMnode, SMnodeMsg *pMsg, SCreateDnodeMsg *pCreate) { +static int32_t mndCreateDnode(SMnode *pMnode, SMnodeMsg *pReq, 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, &pMsg->rpcMsg); + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, &pReq->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 mndProcessCreateDnodeMsg(SMnodeMsg *pMsg) { - SMnode *pMnode = pMsg->pMnode; - SCreateDnodeMsg *pCreate = pMsg->rpcMsg.pCont; +static int32_t mndProcessCreateDnodeReq(SMnodeMsg *pReq) { + SMnode *pMnode = pReq->pMnode; + SCreateDnodeReq *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, pMsg, pCreate); + int32_t code = mndCreateDnode(pMnode, pReq, 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 *pMsg, SDnodeObj *pDnode) { - STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, &pMsg->rpcMsg); +static int32_t mndDropDnode(SMnode *pMnode, SMnodeMsg *pReq, SDnodeObj *pDnode) { + STrans *pTrans = mndTransCreate(pMnode, TRN_POLICY_ROLLBACK, &pReq->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 mndProcessDropDnodeMsg(SMnodeMsg *pMsg) { - SMnode *pMnode = pMsg->pMnode; - SDropDnodeMsg *pDrop = pMsg->rpcMsg.pCont; +static int32_t mndProcessDropDnodeReq(SMnodeMsg *pReq) { + SMnode *pMnode = pReq->pMnode; + SDropDnodeReq *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, pMsg, pDnode); + int32_t code = mndDropDnode(pMnode, pReq, 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 mndProcessConfigDnodeMsg(SMnodeMsg *pMsg) { - SMnode *pMnode = pMsg->pMnode; - SCfgDnodeMsg *pCfg = pMsg->rpcMsg.pCont; +static int32_t mndProcessConfigDnodeReq(SMnodeMsg *pReq) { + SMnode *pMnode = pReq->pMnode; + SMCfgDnodeReq *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); - SCfgDnodeMsg *pCfgDnode = rpcMallocCont(sizeof(SCfgDnodeMsg)); + SDCfgDnodeReq *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(SCfgDnodeMsg), - .ahandle = pMsg->rpcMsg.ahandle}; + .contLen = sizeof(SDCfgDnodeReq), + .ahandle = pReq->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 *pMsg) { - mInfo("app:%p config rsp from dnode", pMsg->rpcMsg.ahandle); +static int32_t mndProcessConfigDnodeRsp(SMnodeMsg *pRsp) { + mInfo("app:%p config rsp from dnode", pRsp->rpcMsg.ahandle); } -static int32_t mndGetConfigMeta(SMnodeMsg *pMsg, SShowObj *pShow, STableMetaMsg *pMeta) { +static int32_t mndGetConfigMeta(SMnodeMsg *pReq, 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 *pMsg, SShowObj *pShow, char *data, int32_t rows) { - SMnode *pMnode = pMsg->pMnode; +static int32_t mndRetrieveConfigs(SMnodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) { + SMnode *pMnode = pReq->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 *pMsg, SShowObj *pShow, STableMetaMsg *pMeta) { - SMnode *pMnode = pMsg->pMnode; +static int32_t mndGetDnodeMeta(SMnodeMsg *pReq, SShowObj *pShow, STableMetaMsg *pMeta) { + SMnode *pMnode = pReq->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 *pMsg, SShowObj *pShow, char *data, int32_t rows) { - SMnode *pMnode = pMsg->pMnode; +static int32_t mndRetrieveDnodes(SMnodeMsg *pReq, SShowObj *pShow, char *data, int32_t rows) { + SMnode *pMnode = pReq->pMnode; SSdb *pSdb = pMnode->pSdb; int32_t numOfRows = 0; int32_t cols = 0; diff --git a/source/dnode/mnode/impl/test/bnode/bnode.cpp b/source/dnode/mnode/impl/test/bnode/bnode.cpp index c33776fd1be3dbeb062592d6463365065e971c55..0b54a9bf4a7d1088e6ea833b3841ec4b635b043d 100644 --- a/source/dnode/mnode/impl/test/bnode/bnode.cpp +++ b/source/dnode/mnode/impl/test/bnode/bnode.cpp @@ -96,9 +96,9 @@ TEST_F(MndTestBnode, 02_Create_Bnode) { TEST_F(MndTestBnode, 03_Drop_Bnode) { { - int32_t contLen = sizeof(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); pReq->port = htonl(9019); diff --git a/source/dnode/mnode/impl/test/dnode/dnode.cpp b/source/dnode/mnode/impl/test/dnode/dnode.cpp index c5f29183e93b00fcde1c619182b1bb1c57660832..fbfc3ee7bc6cbbb52cf8fcf088fe64020a6ac6bb 100644 --- a/source/dnode/mnode/impl/test/dnode/dnode.cpp +++ b/source/dnode/mnode/impl/test/dnode/dnode.cpp @@ -75,9 +75,9 @@ TEST_F(MndTestDnode, 01_ShowDnode) { } TEST_F(MndTestDnode, 02_ConfigDnode) { - int32_t contLen = sizeof(SCfgDnodeMsg); + int32_t contLen = sizeof(SMCfgDnodeReq); - SCfgDnodeMsg* pReq = (SCfgDnodeMsg*)rpcMallocCont(contLen); + SMCfgDnodeReq* 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(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* 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(SDropDnodeMsg); + int32_t contLen = sizeof(SDropDnodeReq); - SDropDnodeMsg* pReq = (SDropDnodeMsg*)rpcMallocCont(contLen); + SDropDnodeReq* 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(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* 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(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* 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(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); pReq->port = htonl(9027); diff --git a/source/dnode/mnode/impl/test/qnode/qnode.cpp b/source/dnode/mnode/impl/test/qnode/qnode.cpp index 9aa41ca1771ce3c621c957da7a3d04db7aa7afe6..8a9e087e7feb8531067340e33b6484a8d091f900 100644 --- a/source/dnode/mnode/impl/test/qnode/qnode.cpp +++ b/source/dnode/mnode/impl/test/qnode/qnode.cpp @@ -96,9 +96,9 @@ TEST_F(MndTestQnode, 02_Create_Qnode) { TEST_F(MndTestQnode, 03_Drop_Qnode) { { - int32_t contLen = sizeof(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); pReq->port = htonl(9015); diff --git a/source/dnode/mnode/impl/test/snode/snode.cpp b/source/dnode/mnode/impl/test/snode/snode.cpp index 2dcfc658a4c2ddf2bfceebb4ade8ef0132c16c9f..3a38b9ede60b649b1199e1a797900615256827b9 100644 --- a/source/dnode/mnode/impl/test/snode/snode.cpp +++ b/source/dnode/mnode/impl/test/snode/snode.cpp @@ -96,9 +96,9 @@ TEST_F(MndTestSnode, 02_Create_Snode) { TEST_F(MndTestSnode, 03_Drop_Snode) { { - int32_t contLen = sizeof(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); pReq->port = htonl(9017); diff --git a/source/dnode/mnode/impl/test/trans/trans.cpp b/source/dnode/mnode/impl/test/trans/trans.cpp index e2ed707a99d540bb8e6bf168516cc9c77ed7dd7c..a0c4c539fb3c98cca2958fa057c2a7b1f4e855b3 100644 --- a/source/dnode/mnode/impl/test/trans/trans.cpp +++ b/source/dnode/mnode/impl/test/trans/trans.cpp @@ -133,9 +133,9 @@ TEST_F(MndTestTrans, 02_Create_Qnode1_Crash) { TEST_F(MndTestTrans, 03_Create_Qnode2_Crash) { { - int32_t contLen = sizeof(SCreateDnodeMsg); + int32_t contLen = sizeof(SCreateDnodeReq); - SCreateDnodeMsg* pReq = (SCreateDnodeMsg*)rpcMallocCont(contLen); + SCreateDnodeReq* pReq = (SCreateDnodeReq*)rpcMallocCont(contLen); strcpy(pReq->fqdn, "localhost"); pReq->port = htonl(9020); diff --git a/source/libs/parser/inc/astToMsg.h b/source/libs/parser/inc/astToMsg.h index 0d0769a040f660322bdf7c3d699ba7bd30be74e1..1b7fe5ebc5aadd52a67c769241f272cff74ebcad 100644 --- a/source/libs/parser/inc/astToMsg.h +++ b/source/libs/parser/inc/astToMsg.h @@ -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); -SCreateDnodeMsg *buildCreateDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMsgBuf); -SDropDnodeMsg *buildDropDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMsgBuf); +SCreateDnodeReq *buildCreateDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMsgBuf); +SDropDnodeReq *buildDropDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMsgBuf); #endif // TDENGINE_ASTTOMSG_H diff --git a/source/libs/parser/src/astToMsg.c b/source/libs/parser/src/astToMsg.c index 0c1af8dc3cbbcec8ac1d8208213888c1c1c18fa9..1ae45556b456decc14e92a8840728efdb1f0d6ac 100644 --- a/source/libs/parser/src/astToMsg.c +++ b/source/libs/parser/src/astToMsg.c @@ -335,7 +335,7 @@ SDropStbMsg* buildDropStableMsg(SSqlInfo* pInfo, int32_t* len, SParseBasicCtx* p return pDropTableMsg; } -SCreateDnodeMsg *buildCreateDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMsgBuf) { +SCreateDnodeReq *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; } - SCreateDnodeMsg *pCreate = (SCreateDnodeMsg *) calloc(1, sizeof(SCreateDnodeMsg)); + SCreateDnodeReq *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(SCreateDnodeMsg); + *len = sizeof(SCreateDnodeReq); return pCreate; } -SDropDnodeMsg *buildDropDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMsgBuf) { +SDropDnodeReq *buildDropDnodeMsg(SSqlInfo* pInfo, int32_t* len, SMsgBuf* pMsgBuf) { SToken* pzName = taosArrayGet(pInfo->pMiscInfo->a, 0); char* end = NULL; - SDropDnodeMsg * pDrop = (SDropDnodeMsg *)calloc(1, sizeof(SDropDnodeMsg)); + SDropDnodeReq * pDrop = (SDropDnodeReq *)calloc(1, sizeof(SDropDnodeReq)); pDrop->dnodeId = strtoll(pzName->z, &end, 10); pDrop->dnodeId = htonl(pDrop->dnodeId); - *len = sizeof(SDropDnodeMsg); + *len = sizeof(SDropDnodeReq); if (end - pzName->z != pzName->n) { buildInvalidOperationMsg(pMsgBuf, "invalid dnode id"); diff --git a/source/libs/parser/src/astValidate.c b/source/libs/parser/src/astValidate.c index b2466fd2dcccb2938ef060991c2696f29916ccf2..daa960c17a867aa32e11939a8b699bfaed89b467 100644 --- a/source/libs/parser/src/astValidate.c +++ b/source/libs/parser/src/astValidate.c @@ -3819,7 +3819,7 @@ int32_t qParserValidateSqlNode(struct SCatalog* pCatalog, SSqlInfo* pInfo, SQuer char* pMsg = pCmd->payload; - SCfgDnodeMsg* pCfg = (SCfgDnodeMsg*)pMsg; + SMCfgDnodeReq* pCfg = (SMCfgDnodeReq*)pMsg; SToken* t0 = taosArrayGet(pMiscInfo->a, 0); SToken* t1 = taosArrayGet(pMiscInfo->a, 1); diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index eb3f8be25abd87e611179262bf4be8e998ef0c0c..c68d7cef06e98319c173964fb365f35ea7b37665 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -776,7 +776,7 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { char* pMsg = pCmd->payload; - SCfgDnodeMsg* pCfg = (SCfgDnodeMsg*)pMsg; + SMCfgDnodeReq* pCfg = (SMCfgDnodeReq*)pMsg; SStrToken* t0 = taosArrayGet(pMiscInfo->a, 0); SStrToken* t1 = taosArrayGet(pMiscInfo->a, 1); diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index a5431ea3997c3f42fd8b23e872f018d8f5ccec0b..41a55869e6ec3a9223ab6849c8324d1aebc23a8a 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -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(SCreateDnodeMsg); + pCmd->payloadLen = sizeof(SCreateDnodeReq); 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; } - SCreateDnodeMsg *pCreate = (SCreateDnodeMsg *)pCmd->payload; + SCreateDnodeReq *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(SCfgDnodeMsg); + pCmd->payloadLen = sizeof(SMCfgDnodeReq); 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(SDropDnodeMsg); + pCmd->payloadLen = sizeof(SDropDnodeReq); 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; } - SDropDnodeMsg * pDrop = (SDropDnodeMsg *)pCmd->payload; + SDropDnodeReq * pDrop = (SDropDnodeReq *)pCmd->payload; tstrncpy(pDrop->ep, dnodeEp, tListLen(pDrop->ep)); pCmd->msgType = TDMT_MND_DROP_DNODE;