diff --git a/source/dnode/mgmt/dnode/inc/dmInt.h b/source/dnode/mgmt/dnode/inc/dmInt.h index 6adfdd545b..dd52aea8c1 100644 --- a/source/dnode/mgmt/dnode/inc/dmInt.h +++ b/source/dnode/mgmt/dnode/inc/dmInt.h @@ -23,18 +23,19 @@ extern "C" { #endif typedef struct SDnodeMgmt { - int64_t dver; - int64_t updateTime; - int8_t statusSent; - SEpSet mnodeEpSet; - SHashObj *dnodeHash; - SArray *dnodeEps; - pthread_t *threadId; - SRWLatch latch; - SDnodeWorker mgmtWorker; - SDnodeWorker statusWorker; - const char *path; - SDnode *pDnode; + int64_t dver; + int64_t updateTime; + int8_t statusSent; + SEpSet mnodeEpSet; + SHashObj *dnodeHash; + SArray *dnodeEps; + pthread_t *threadId; + SRWLatch latch; + SDnodeWorker mgmtWorker; + SDnodeWorker statusWorker; + const char *path; + SDnode *pDnode; + SMgmtWrapper *pWrapper; } SDnodeMgmt; // dmFile.c diff --git a/source/dnode/mgmt/dnode/src/dmInt.c b/source/dnode/mgmt/dnode/src/dmInt.c index 61ca6ac78c..f98c91fc6d 100644 --- a/source/dnode/mgmt/dnode/src/dmInt.c +++ b/source/dnode/mgmt/dnode/src/dmInt.c @@ -92,6 +92,7 @@ int32_t dmInit(SMgmtWrapper *pWrapper) { pDnode->clusterId = 0; pMgmt->path = pWrapper->path; pMgmt->pDnode = pDnode; + pMgmt->pWrapper = pWrapper; taosInitRWLatch(&pMgmt->latch); pMgmt->dnodeHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_NO_LOCK); diff --git a/source/dnode/mgmt/dnode/src/dmMsg.c b/source/dnode/mgmt/dnode/src/dmMsg.c index 79b84acc9b..033543a43e 100644 --- a/source/dnode/mgmt/dnode/src/dmMsg.c +++ b/source/dnode/mgmt/dnode/src/dmMsg.c @@ -53,7 +53,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { pMgmt->statusSent = 1; dTrace("send req:%s to mnode, app:%p", TMSG_INFO(rpcMsg.msgType), rpcMsg.ahandle); - dndSendReqToMnode(pMgmt->pDnode, &rpcMsg); + dndSendReqToMnode(pMgmt->dnodeEps, &rpcMsg); } static void dmUpdateDnodeCfg(SDnodeMgmt *pMgmt, SDnodeCfg *pCfg) { diff --git a/source/dnode/mgmt/vnode/src/vmInt.c b/source/dnode/mgmt/vnode/src/vmInt.c index cbddca13a3..31f66e1a47 100644 --- a/source/dnode/mgmt/vnode/src/vmInt.c +++ b/source/dnode/mgmt/vnode/src/vmInt.c @@ -17,6 +17,7 @@ #include "vmFile.h" #include "vmMsg.h" #include "vmWorker.h" + #include "sync.h" SVnodeObj *vmAcquireVnode(SVnodesMgmt *pMgmt, int32_t vgId) { @@ -317,6 +318,8 @@ static int32_t vmInit(SMgmtWrapper *pWrapper) { return -1; } + code = 0; + _OVER: if (code == 0) { pWrapper->pMgmt = pMgmt; @@ -329,7 +332,10 @@ _OVER: return 0; } -static bool vmRequire(SMgmtWrapper *pWrapper) { return false; } +static bool vmRequire(SMgmtWrapper *pWrapper) { + SDnode *pDnode = pWrapper->pDnode; + return pDnode->numOfSupportVnodes > 0; +} void vmGetMgmtFp(SMgmtWrapper *pWrapper) { SMgmtFp mgmtFp = {0};