From bd660a5b2d03873be7d23a0b6bc08a09fcdef0bf Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 15 Mar 2022 11:34:42 +0800 Subject: [PATCH] shm --- source/dnode/mgmt/container/inc/dndInt.h | 2 +- source/dnode/mgmt/container/src/dndNode.c | 6 +++--- source/dnode/mgmt/dnode/src/dmInt.c | 3 ++- source/dnode/mgmt/dnode/src/dmMsg.c | 2 +- source/dnode/mgmt/dnode/src/dmWorker.c | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/source/dnode/mgmt/container/inc/dndInt.h b/source/dnode/mgmt/container/inc/dndInt.h index 5b42ccffe6..8c85d67d37 100644 --- a/source/dnode/mgmt/container/inc/dndInt.h +++ b/source/dnode/mgmt/container/inc/dndInt.h @@ -56,7 +56,7 @@ extern "C" { #define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }} #define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }} -typedef enum { DNODE, MNODE, NODE_MAX, VNODES, QNODE, SNODE, BNODE } ENodeType; +typedef enum { MNODE, VNODES, QNODE, SNODE, BNODE, DNODE, NODE_MAX } ENodeType; typedef enum { PROC_SINGLE, PROC_CHILD, PROC_PARENT } EProcType; typedef enum { DND_STAT_INIT, DND_STAT_RUNNING, DND_STAT_STOPPED } EDndStatus; typedef enum { DND_WORKER_SINGLE, DND_WORKER_MULTI } EWorkerType; diff --git a/source/dnode/mgmt/container/src/dndNode.c b/source/dnode/mgmt/container/src/dndNode.c index 2e2d9d4bad..ea198bd42d 100644 --- a/source/dnode/mgmt/container/src/dndNode.c +++ b/source/dnode/mgmt/container/src/dndNode.c @@ -36,9 +36,9 @@ static void dndResetLog(SMgmtWrapper *pMgmt) { static bool dndRequireNode(SMgmtWrapper *pMgmt) { bool required = (*pMgmt->fp.requiredFp)(pMgmt); if (!required) { - dDebug("node:%s, no need to start on this dnode", pMgmt->name); + dDebug("node:%s, no need to start", pMgmt->name); } else { - dDebug("node:%s, need to start on this dnode", pMgmt->name); + dDebug("node:%s, need to start", pMgmt->name); } return required; } @@ -242,7 +242,7 @@ int32_t dndRun(SDnode *pDnode) { } while (1) { - if (pDnode->event != DND_EVENT_STOP) { + if (pDnode->event == DND_EVENT_STOP) { dInfo("dnode object receive stop event"); break; } diff --git a/source/dnode/mgmt/dnode/src/dmInt.c b/source/dnode/mgmt/dnode/src/dmInt.c index e895e2c8e0..092280345e 100644 --- a/source/dnode/mgmt/dnode/src/dmInt.c +++ b/source/dnode/mgmt/dnode/src/dmInt.c @@ -16,7 +16,7 @@ #define _DEFAULT_SOURCE #include "dmInt.h" #include "dmFile.h" -#include "dmHandle.h" +#include "dmMsg.h" #include "dmWorker.h" int32_t dmGetDnodeId(SDnode *pDnode) { @@ -140,6 +140,7 @@ int32_t dmInit(SMgmtWrapper *pWrapper) { return -1; } + pWrapper->pMgmt = pMgmt; dndSetStatus(pDnode, DND_STAT_RUNNING); dmSendStatusReq(pMgmt); dndReportStartup(pDnode, "TDengine", "initialized successfully"); diff --git a/source/dnode/mgmt/dnode/src/dmMsg.c b/source/dnode/mgmt/dnode/src/dmMsg.c index c04f4ef7fe..d7b75545aa 100644 --- a/source/dnode/mgmt/dnode/src/dmMsg.c +++ b/source/dnode/mgmt/dnode/src/dmMsg.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include "dmHandle.h" +#include "dmMsg.h" #include "dmFile.h" #include "dmWorker.h" #include "vmInt.h" diff --git a/source/dnode/mgmt/dnode/src/dmWorker.c b/source/dnode/mgmt/dnode/src/dmWorker.c index 81215ae729..97da028ba0 100644 --- a/source/dnode/mgmt/dnode/src/dmWorker.c +++ b/source/dnode/mgmt/dnode/src/dmWorker.c @@ -15,7 +15,7 @@ #define _DEFAULT_SOURCE #include "dmWorker.h" -#include "dmHandle.h" +#include "dmMsg.h" #include "bmInt.h" #include "mmInt.h" @@ -131,12 +131,12 @@ static void dndProcessMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) { } int32_t dmStartWorker(SDnodeMgmt *pMgmt) { - if (dndInitWorker(NULL, &pMgmt->mgmtWorker, DND_WORKER_SINGLE, "dnode-mgmt", 1, 1, dndProcessMgmtQueue) != 0) { + if (dndInitWorker(pMgmt->pDnode, &pMgmt->mgmtWorker, DND_WORKER_SINGLE, "dnode-mgmt", 1, 1, dndProcessMgmtQueue) != 0) { dError("failed to start dnode mgmt worker since %s", terrstr()); return -1; } - if (dndInitWorker(NULL, &pMgmt->statusWorker, DND_WORKER_SINGLE, "dnode-status", 1, 1, dndProcessMgmtQueue) != 0) { + if (dndInitWorker(pMgmt->pDnode, &pMgmt->statusWorker, DND_WORKER_SINGLE, "dnode-status", 1, 1, dndProcessMgmtQueue) != 0) { dError("failed to start dnode mgmt worker since %s", terrstr()); return -1; }