提交 893fb646 编写于 作者: S Shengliang Guan

refactor: enable multi-process mode

上级 23432573
......@@ -34,7 +34,7 @@ typedef struct SMgmtWrapper SMgmtWrapper;
#define OnlyInSingleProc(ptype) (ptype == SINGLE_PROC)
#define OnlyInChildProc(ptype) (ptype == CHILD_PROC)
#define OnlyInParentProc(ptype) (ptype == PARENT_PROC)
#define OnlyInTestProc(ptype) (ptype & TEST_PROC)
#define OnlyInTestProc(ptype) (ptype == TEST_PROC)
#define InChildProc(ptype) (ptype & CHILD_PROC)
#define InParentProc(ptype) (ptype & PARENT_PROC)
......@@ -60,7 +60,7 @@ typedef struct {
TdThread cthread;
SShm shm;
int32_t pid;
int8_t ptype;
EDndProcType ptype;
bool stop;
} SProc;
......@@ -110,7 +110,7 @@ typedef struct SUdfdData {
} SUdfdData;
typedef struct SDnode {
int8_t ptype;
EDndProcType ptype;
EDndNodeType rtype;
EDndEvent event;
EDndRunStatus status;
......
......@@ -267,7 +267,7 @@ int32_t dmMarkWrapper(SMgmtWrapper *pWrapper) {
int32_t code = 0;
taosRLockLatch(&pWrapper->latch);
if (pWrapper->deployed /* || (OnlyInParentProc(pWrapper->proc.ptype) && pWrapper->required) */) {
if (pWrapper->deployed || (InParentProc(pWrapper->proc.ptype) && pWrapper->required)) {
int32_t refCount = atomic_add_fetch_32(&pWrapper->refCount, 1);
dTrace("node:%s, is marked, ref:%d", pWrapper->name, refCount);
} else {
......
......@@ -96,7 +96,7 @@ int32_t dmOpenNode(SMgmtWrapper *pWrapper) {
return -1;
}
if (!OnlyInTestProc(pWrapper->proc.ptype)) {
if (OnlyInParentProc(pWrapper->proc.ptype)) {
if (dmInitProc(pWrapper) != 0) {
dError("node:%s, failed to init proc since %s", pWrapper->name, terrstr());
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册