From 61b2342b057e0a174289566dc49dffeee0ccb32f Mon Sep 17 00:00:00 2001 From: slguan Date: Thu, 2 Apr 2020 11:00:00 +0800 Subject: [PATCH] [TD-17] fix error while alloc vnodes --- cmake/define.inc | 2 +- src/mnode/src/mgmtBalance.c | 2 +- src/mnode/src/mgmtDnode.c | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/define.inc b/cmake/define.inc index 8d19c19b6d..ba61d3fe9d 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -3,7 +3,7 @@ PROJECT(TDengine) IF (TD_CLUSTER) ADD_DEFINITIONS(-D_CLUSTER) - ADD_DEFINITIONS(-DTSDB_REPLICA_MAX_NUM=3) + ADD_DEFINITIONS(-DTSDB_REPLICA_MAX_NUM=1) ELSE () ADD_DEFINITIONS(-DLITE) ADD_DEFINITIONS(-DTSDB_REPLICA_MAX_NUM=1) diff --git a/src/mnode/src/mgmtBalance.c b/src/mnode/src/mgmtBalance.c index 7d06329a46..fc74075878 100644 --- a/src/mnode/src/mgmtBalance.c +++ b/src/mnode/src/mgmtBalance.c @@ -42,7 +42,7 @@ int32_t mgmtAllocVnodes(SVgObj *pVgroup) { } if (pSelDnode == NULL) { - mError("failed to alloc vnode to vgroup", pDnode->dnodeId); + mError("failed to alloc vnode to vgroup"); return TSDB_CODE_NO_ENOUGH_DNODES; } diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index d7e2270107..53f0a668b4 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -35,7 +35,9 @@ extern int32_t clusterGetDnodesNum(); extern void * clusterGetNextDnode(void *pNode, SDnodeObj **pDnode); extern SDnodeObj* clusterGetDnode(int32_t dnodeId); extern SDnodeObj* clusterGetDnodeByIp(uint32_t ip); +#ifndef _CLUSTER static SDnodeObj tsDnodeObj = {0}; +#endif int32_t mgmtInitDnodes() { mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONFIG_DNODE, mgmtProcessCfgDnodeMsg); @@ -101,7 +103,7 @@ int32_t mgmtGetDnodesNum() { void * mgmtGetNextDnode(void *pNode, SDnodeObj **pDnode) { #ifdef _CLUSTER - return (*clusterGetNextDnode)(pNode, pDnode); + return clusterGetNextDnode(pNode, pDnode); #else if (*pDnode == NULL) { *pDnode = &tsDnodeObj; -- GitLab