提交 bd660a5b 编写于 作者: S Shengliang Guan

shm

上级 33fe9fa2
......@@ -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;
......
......@@ -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;
}
......
......@@ -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");
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include "dmHandle.h"
#include "dmMsg.h"
#include "dmFile.h"
#include "dmWorker.h"
#include "vmInt.h"
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册