diff --git a/include/common/tmsg.h b/include/common/tmsg.h index 331188c264..07eb8a461a 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -1568,9 +1568,7 @@ typedef struct { typedef struct { int32_t id; int8_t isMnode; -#ifdef TD_GRANT_HB_OPTIMIZE int8_t offlineReason; -#endif SEp ep; char active[TSDB_ACTIVE_KEY_LEN]; char connActive[TSDB_CONN_ACTIVE_KEY_LEN]; diff --git a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h index b04d336c51..36097438a2 100644 --- a/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h +++ b/source/dnode/mgmt/node_mgmt/inc/dmMgmt.h @@ -97,11 +97,7 @@ int32_t dmMarkWrapper(SMgmtWrapper *pWrapper); void dmReleaseWrapper(SMgmtWrapper *pWrapper); int32_t dmInitVars(SDnode *pDnode); void dmClearVars(SDnode *pDnode); -#if defined(TD_MODULE_OPTIMIZE) || !defined(TD_ENTERPRISE) int32_t dmInitModule(SDnode *pDnode, SMgmtWrapper *wrappers); -#else -int32_t dmInitModule(SDnode *pDnode); -#endif bool dmRequireNode(SDnode *pDnode, SMgmtWrapper *pWrapper); SMgmtInputOpt dmBuildMgmtInputOpt(SMgmtWrapper *pWrapper); void dmSetStatus(SDnode *pDnode, EDndRunStatus stype); @@ -123,11 +119,7 @@ int32_t dmInitStatusClient(SDnode *pDnode); void dmCleanupClient(SDnode *pDnode); void dmCleanupStatusClient(SDnode *pDnode); SMsgCb dmGetMsgcb(SDnode *pDnode); -#if defined(TD_MODULE_OPTIMIZE) || !defined(TD_ENTERPRISE) int32_t dmInitMsgHandle(SDnode *pDnode, SMgmtWrapper *wrappers); -#else -int32_t dmInitMsgHandle(SDnode *pDnode); -#endif int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg); // dmMonitor.c diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index e9ce4c4f89..409ee45cd3 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -66,15 +66,9 @@ int32_t dmInitDnode(SDnode *pDnode) { goto _OVER; } -#if defined(TD_MODULE_OPTIMIZE) || !defined(TD_ENTERPRISE) if (dmInitModule(pDnode, pDnode->wrappers) != 0) { goto _OVER; } -#else - if (dmInitModule(pDnode) != 0) { - goto _OVER; - } -#endif indexInit(tsNumOfCommitThreads); streamMetaInit(); @@ -113,7 +107,6 @@ void dmCleanupDnode(SDnode *pDnode) { dDebug("dnode is closed, ptr:%p", pDnode); } -#if defined(TD_MODULE_OPTIMIZE) || !defined(TD_ENTERPRISE) int32_t dmInitVars(SDnode *pDnode) { SDnodeData *pData = &pDnode->data; pData->dnodeId = 0; @@ -182,7 +175,6 @@ void dmClearVars(SDnode *pDnode) { taosThreadMutexDestroy(&pDnode->mutex); memset(&pDnode->mutex, 0, sizeof(pDnode->mutex)); } -#endif void dmSetStatus(SDnode *pDnode, EDndRunStatus status) { if (pDnode->status != status) { diff --git a/source/dnode/mgmt/node_mgmt/src/dmTransport.c b/source/dnode/mgmt/node_mgmt/src/dmTransport.c index b7381891d1..ad5ca2cecf 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmTransport.c +++ b/source/dnode/mgmt/node_mgmt/src/dmTransport.c @@ -251,7 +251,6 @@ _OVER: dmReleaseWrapper(pWrapper); } -#if defined(TD_MODULE_OPTIMIZE) || !defined(TD_ENTERPRISE) int32_t dmInitMsgHandle(SDnode *pDnode, SMgmtWrapper *wrappers) { SDnodeTrans *pTrans = &pDnode->trans; @@ -277,33 +276,6 @@ int32_t dmInitMsgHandle(SDnode *pDnode, SMgmtWrapper *wrappers) { return 0; } -#else -int32_t dmInitMsgHandle(SDnode *pDnode) { - SDnodeTrans *pTrans = &pDnode->trans; - - for (EDndNodeType ntype = DNODE; ntype < NODE_END; ++ntype) { - SMgmtWrapper *pWrapper = &pDnode->wrappers[ntype]; - SArray *pArray = (*pWrapper->func.getHandlesFp)(); - if (pArray == NULL) return -1; - - for (int32_t i = 0; i < taosArrayGetSize(pArray); ++i) { - SMgmtHandle *pMgmt = taosArrayGet(pArray, i); - SDnodeHandle *pHandle = &pTrans->msgHandles[TMSG_INDEX(pMgmt->msgType)]; - if (pMgmt->needCheckVgId) { - pHandle->needCheckVgId = pMgmt->needCheckVgId; - } - if (!pMgmt->needCheckVgId) { - pHandle->defaultNtype = ntype; - } - pWrapper->msgFps[TMSG_INDEX(pMgmt->msgType)] = pMgmt->msgFp; - } - - taosArrayDestroy(pArray); - } - - return 0; -} -#endif static inline int32_t dmSendReq(const SEpSet *pEpSet, SRpcMsg *pMsg) { SDnode *pDnode = dmInstance(); diff --git a/source/dnode/mnode/impl/src/mndDnode.c b/source/dnode/mnode/impl/src/mndDnode.c index 4e93bcdbe7..a9aa96720c 100644 --- a/source/dnode/mnode/impl/src/mndDnode.c +++ b/source/dnode/mnode/impl/src/mndDnode.c @@ -397,9 +397,7 @@ void mndGetDnodeData(SMnode *pMnode, SArray *pDnodeInfo) { SDnodeInfo dInfo; dInfo.id = pDnode->id; dInfo.ep.port = pDnode->port; -#ifdef TD_GRANT_HB_OPTIMIZE dInfo.offlineReason = pDnode->offlineReason; -#endif tstrncpy(dInfo.ep.fqdn, pDnode->fqdn, TSDB_FQDN_LEN); tstrncpy(dInfo.active, pDnode->active, TSDB_ACTIVE_KEY_LEN); tstrncpy(dInfo.connActive, pDnode->connActive, TSDB_CONN_ACTIVE_KEY_LEN);