diff --git a/src/inc/tcluster.h b/src/inc/tcluster.h index 28467ca6837fb9579881972525ac9b3601e82650..769a819b90fcb915b01f9a81740d02cda6c7f7de 100644 --- a/src/inc/tcluster.h +++ b/src/inc/tcluster.h @@ -36,6 +36,7 @@ enum _TAOS_DN_STATUS { int32_t clusterInit(); void clusterCleanUp(); char* clusterGetDnodeStatusStr(int32_t dnodeStatus); +bool clusterCheckModuleInDnode(struct _dnode_obj *pDnode, int moduleType); int32_t clusterInitDnodes(); void clusterCleanupDnodes(); diff --git a/src/mnode/src/mgmtDnode.c b/src/mnode/src/mgmtDnode.c index e6d186ac1bbac5ccc829485df0d1c298caed80ab..e4ab1140909f1a5fc892ab38075cda809e744bab 100644 --- a/src/mnode/src/mgmtDnode.c +++ b/src/mnode/src/mgmtDnode.c @@ -323,8 +323,7 @@ static int32_t clusterRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, char ipstr[32]; while (numOfRows < rows) { - clusterReleaseDnode(pDnode); - pShow->pNode = clusterGetNextDnode(pShow->pNode, (SDnodeObj **)&pDnode); + pShow->pNode = clusterGetNextDnode(pShow->pNode, &pDnode); if (pDnode == NULL) break; cols = 0; @@ -366,13 +365,14 @@ static int32_t clusterRetrieveDnodes(SShowObj *pShow, char *data, int32_t rows, #endif numOfRows++; + clusterReleaseDnode(pDnode); } pShow->numOfReads += numOfRows; return numOfRows; } -static bool clusterCheckModuleInDnode(SDnodeObj *pDnode, int32_t moduleType) { +bool clusterCheckModuleInDnode(SDnodeObj *pDnode, int32_t moduleType) { uint32_t status = pDnode->moduleStatus & (1 << moduleType); return status > 0; } diff --git a/src/mnode/src/mgmtSdb.c b/src/mnode/src/mgmtSdb.c index 60614157f19f15082208722e6cbb9d3dd7d88ddd..ef2a23cd12ff309ef234defeefd2d624f0f2c9e4 100644 --- a/src/mnode/src/mgmtSdb.c +++ b/src/mnode/src/mgmtSdb.c @@ -520,6 +520,11 @@ int32_t sdbInsertRow(SSdbOperDesc *pOper) { if (pTable->keyType == SDB_KEY_TYPE_AUTO) { *((uint32_t *)pOper->pObj) = ++pTable->autoIndex; + + // let vgId increase from 2 + if (pTable->autoIndex == 1 && strcmp(pTable->tableName, "vgroups") == 0) { + *((uint32_t *)pOper->pObj) = ++pTable->autoIndex; + } } pTable->version++; sdbVersion++; diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 8a0d66068e92e5823788f8104885205e19de6708..88a3be0e02750a780b2c2b65fca152444b3c7578 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -111,7 +111,12 @@ short tsDaysPerFile = 10; int tsDaysToKeep = 3650; int tsReplications = TSDB_REPLICA_MIN_NUM; +#ifdef _MPEER int tsNumOfMPeers = 3; +#else +int tsNumOfMPeers = 1; +#endif + int tsMaxShellConns = 2000; int tsMaxTables = 100000; @@ -552,9 +557,11 @@ static void doInitGlobalConfig() { tsInitConfigOption(cfg++, "tblocks", &tsNumOfBlocksPerMeter, TSDB_CFG_VTYPE_SHORT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW, 32, 4096, 0, TSDB_CFG_UTYPE_NONE); +#ifdef _MPEER tsInitConfigOption(cfg++, "numOfMPeers", &tsNumOfMPeers, TSDB_CFG_VTYPE_INT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLUSTER, 1, 3, 0, TSDB_CFG_UTYPE_NONE); +#endif tsInitConfigOption(cfg++, "balanceInterval", &tsBalanceStartInterval, TSDB_CFG_VTYPE_INT, TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLUSTER, 1, 30000, 0, TSDB_CFG_UTYPE_NONE);