diff --git a/src/dnode/src/dnodeMain.c b/src/dnode/src/dnodeMain.c index d95a344058..01e2c4dfcc 100644 --- a/src/dnode/src/dnodeMain.c +++ b/src/dnode/src/dnodeMain.c @@ -220,7 +220,6 @@ static int32_t dnodeInitStorage() { sprintf(tsMnodeDir, "%s/mnode", dataDir); sprintf(tsVnodeDir, "%s/vnode", dataDir); sprintf(tsDnodeDir, "%s/dnode", dataDir); - mkdir(tsMnodeDir, 0755); mkdir(tsVnodeDir, 0755); mkdir(tsDnodeDir, 0755); diff --git a/src/inc/tcluster.h b/src/inc/tcluster.h index 60436ee743..28467ca683 100644 --- a/src/inc/tcluster.h +++ b/src/inc/tcluster.h @@ -26,11 +26,11 @@ extern "C" { struct _dnode_obj; -enum _TSDB_DN_STATUS { - TSDB_DN_STATUS_OFFLINE, - TSDB_DN_STATUS_DROPING, - TSDB_DN_STATUS_BALANCING, - TSDB_DN_STATUS_READY +enum _TAOS_DN_STATUS { + TAOS_DN_STATUS_OFFLINE, + TAOS_DN_STATUS_DROPPING, + TAOS_DN_STATUS_BALANCING, + TAOS_DN_STATUS_READY }; int32_t clusterInit(); diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index b60d1cb0ba..e6d186ac1b 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -48,7 +48,7 @@ int32_t clusterInitDnodes() { tsDnodeObj.publicIp = inet_addr(tsPublicIp); tsDnodeObj.createdTime = taosGetTimestampMs(); tsDnodeObj.numOfTotalVnodes = tsNumOfTotalVnodes; - tsDnodeObj.status = TSDB_DN_STATUS_OFFLINE; + tsDnodeObj.status = TAOS_DN_STATUS_OFFLINE; tsDnodeObj.lastReboot = taosGetTimestampSec(); sprintf(tsDnodeObj.dnodeName, "%d", tsDnodeObj.dnodeId); @@ -203,9 +203,9 @@ void clusterProcessDnodeStatusMsg(SRpcMsg *rpcMsg) { mgmtReleaseVgroup(pVgroup); } - if (pDnode->status != TSDB_DN_STATUS_READY) { + if (pDnode->status == TAOS_DN_STATUS_OFFLINE) { mTrace("dnode:%d, from offline to online", pDnode->dnodeId); - pDnode->status = TSDB_DN_STATUS_READY; + pDnode->status = TAOS_DN_STATUS_READY; balanceNotify(); } @@ -673,10 +673,10 @@ static int32_t clusterRetrieveVnodes(SShowObj *pShow, char *data, int32_t rows, char* clusterGetDnodeStatusStr(int32_t dnodeStatus) { switch (dnodeStatus) { - case TSDB_DN_STATUS_OFFLINE: return "offline"; - case TSDB_DN_STATUS_DROPING: return "dropping"; - case TSDB_DN_STATUS_BALANCING: return "balancing"; - case TSDB_DN_STATUS_READY: return "ready"; + case TAOS_DN_STATUS_OFFLINE: return "offline"; + case TAOS_DN_STATUS_DROPPING: return "dropping"; + case TAOS_DN_STATUS_BALANCING: return "balancing"; + case TAOS_DN_STATUS_READY: return "ready"; default: return "undefined"; } } diff --git a/src/mnode/src/mgmtSdb.c b/src/mnode/src/mgmtSdb.c index 06cb9dca5c..60614157f1 100644 --- a/src/mnode/src/mgmtSdb.c +++ b/src/mnode/src/mgmtSdb.c @@ -435,7 +435,7 @@ void sdbIncRef(void *handle, void *pRow) { SSdbTable *pTable = handle; int32_t *pRefCount = (int32_t *)(pRow + pTable->refCountPos); atomic_add_fetch_32(pRefCount, 1); - if (0) { + if (0 && strcmp(pTable->tableName, "dnodes") == 0) { sdbTrace("table:%s, add ref to record:%s:%s:%d", pTable->tableName, pTable->tableName, sdbGetkeyStr(pTable, pRow), *pRefCount); } } @@ -446,7 +446,7 @@ void sdbDecRef(void *handle, void *pRow) { SSdbTable *pTable = handle; int32_t *pRefCount = (int32_t *)(pRow + pTable->refCountPos); int32_t refCount = atomic_sub_fetch_32(pRefCount, 1); - if (0) { + if (0 && strcmp(pTable->tableName, "dnodes") == 0) { sdbTrace("table:%s, def ref of record:%s:%s:%d", pTable->tableName, pTable->tableName, sdbGetkeyStr(pTable, pRow), *pRefCount); } int8_t* updateEnd = pRow + pTable->refCountPos - 1; diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index a0b80c8ea3..4c969124a0 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -372,7 +372,7 @@ char *mgmtGetVnodeStatus(SVgObj *pVgroup, SVnodeGid *pVnode) { } clusterReleaseDnode(pDnode); - if (pDnode->status == TSDB_DN_STATUS_OFFLINE) { + if (pDnode->status == TAOS_DN_STATUS_OFFLINE) { return "offline"; } diff --git a/src/util/inc/tmodule.h b/src/util/inc/tmodule.h index 9f8ef147f8..f5ad6a6b60 100644 --- a/src/util/inc/tmodule.h +++ b/src/util/inc/tmodule.h @@ -28,8 +28,6 @@ enum _module { TSDB_MOD_MGMT, TSDB_MOD_HTTP, TSDB_MOD_MONITOR, - TSDB_MOD_DCLUSTER, - TSDB_MOD_MSTORAGE, TSDB_MOD_MAX }; diff --git a/src/vnode/main/src/vnodeMain.c b/src/vnode/main/src/vnodeMain.c index 786e6f63a0..4c2d86a518 100644 --- a/src/vnode/main/src/vnodeMain.c +++ b/src/vnode/main/src/vnodeMain.c @@ -266,6 +266,7 @@ static void vnodeBuildVloadMsg(char *pNode, void * param) { pLoad->vgId = htonl(pVnode->vgId); pLoad->vnode = htonl(pVnode->vgId); pLoad->status = pVnode->status; + pLoad->role = pVnode->role; } static void vnodeCleanUp(SVnodeObj *pVnode) {