diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 68abaf1487f0c210629d85c269a7a6d69f798f5c..e90dfa94c2b75d0eec12bc48ace832c9a28bada2 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -600,7 +600,7 @@ static void doInitGlobalConfig() { taosInitConfigOption(cfg); // database configs - cfg.option = "maxtablesPerVnode"; + cfg.option = "maxTablesPerVnode"; cfg.ptr = &tsMaxTablePerVnode; cfg.valType = TAOS_CFG_VTYPE_INT32; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index 9cf024ba83cccb97fc196ae38eaace9f3e03917e..a51a495017e79446c0b9ffda7e6edaab60630509 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -681,10 +681,12 @@ static void dnodeSendStatusMsg(void *handle, void *tmrId) { pStatus->alternativeRole = (uint8_t) tsAlternativeRole; // fill cluster cfg parameters - pStatus->clusterCfg.numOfMnodes = tsNumOfMnodes; - pStatus->clusterCfg.mnodeEqualVnodeNum = tsMnodeEqualVnodeNum; - pStatus->clusterCfg.offlineThreshold = tsOfflineThreshold; - pStatus->clusterCfg.statusInterval = tsStatusInterval; + pStatus->clusterCfg.numOfMnodes = htonl(tsNumOfMnodes); + pStatus->clusterCfg.mnodeEqualVnodeNum = htonl(tsMnodeEqualVnodeNum); + pStatus->clusterCfg.offlineThreshold = htonl(tsOfflineThreshold); + pStatus->clusterCfg.statusInterval = htonl(tsStatusInterval); + pStatus->clusterCfg.maxtablesPerVnode = htonl(tsMaxTablePerVnode); + pStatus->clusterCfg.maxVgroupsPerDb = htonl(tsMaxVgroupsPerDb); strcpy(pStatus->clusterCfg.arbitrator, tsArbitrator); strcpy(pStatus->clusterCfg.timezone, tsTimezone); strcpy(pStatus->clusterCfg.locale, tsLocale); diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index cb25242d27d3f8e50af643df3c447c7aaae76484..ed86aba54f6bba3eae31a3398ff089f29fa86711 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -568,6 +568,8 @@ typedef struct { char timezone[64]; // tsTimezone char locale[TSDB_LOCALE_LEN]; // tsLocale char charset[TSDB_LOCALE_LEN]; // tsCharset + int32_t maxtablesPerVnode; + int32_t maxVgroupsPerDb; } SClusterCfg; typedef struct { diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index a8abddc967b9d2f2e0186e30cd0d9f65a2898c30..28bd368c741c685ae4a9cb9be870f1c9841253f3 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -302,10 +302,12 @@ static void mnodeProcessCfgDnodeMsgRsp(SRpcMsg *rpcMsg) { } static bool mnodeCheckClusterCfgPara(const SClusterCfg *clusterCfg) { - if (clusterCfg->numOfMnodes != tsNumOfMnodes) return false; - if (clusterCfg->mnodeEqualVnodeNum != tsMnodeEqualVnodeNum) return false; - if (clusterCfg->offlineThreshold != tsOfflineThreshold) return false; - if (clusterCfg->statusInterval != tsStatusInterval) return false; + if (clusterCfg->numOfMnodes != htonl(tsNumOfMnodes)) return false; + if (clusterCfg->mnodeEqualVnodeNum != htonl(tsMnodeEqualVnodeNum)) return false; + if (clusterCfg->offlineThreshold != htonl(tsOfflineThreshold)) return false; + if (clusterCfg->statusInterval != htonl(tsStatusInterval)) return false; + if (clusterCfg->maxtablesPerVnode != htonl(tsMaxTablePerVnode)) return false; + if (clusterCfg->maxVgroupsPerDb != htonl(tsMaxVgroupsPerDb)) return false; if (0 != strncasecmp(clusterCfg->arbitrator, tsArbitrator, strlen(tsArbitrator))) return false; if (0 != strncasecmp(clusterCfg->timezone, tsTimezone, strlen(tsTimezone))) return false; diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index d2c177e92221aca89a9fc354f8e8f76eeb327ce2..a85864c18e927988e7ba2f2990f3b18d2a391eec 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1552,8 +1552,8 @@ static int32_t mnodeDoCreateChildTableCb(SMnodeMsg *pMsg, int32_t code) { SChildTableObj *pTable = (SChildTableObj *)pMsg->pTable; assert(pTable); - mDebug("app:%p:%p, table:%s, create table in id:%d, uid:%" PRIu64 ", result:%s", pMsg->rpcMsg.ahandle, pMsg, - pTable->info.tableId, pTable->sid, pTable->uid, tstrerror(code)); + mDebug("app:%p:%p, table:%s, created in mnode, vgId:%d sid:%d, uid:%" PRIu64 ", result:%s", pMsg->rpcMsg.ahandle, + pMsg, pTable->info.tableId, pTable->vgId, pTable->sid, pTable->uid, tstrerror(code)); if (code != TSDB_CODE_SUCCESS) return code; @@ -1693,7 +1693,7 @@ static int32_t mnodeProcessCreateChildTableMsg(SMnodeMsg *pMsg) { mnodeIncVgroupRef(pVgroup); } - mDebug("app:%p:%p, table:%s, create table in vgroup, vgId:%d sid:%d", pMsg->rpcMsg.ahandle, pMsg, pCreate->tableId, + mDebug("app:%p:%p, table:%s, allocated in vgroup, vgId:%d sid:%d", pMsg->rpcMsg.ahandle, pMsg, pCreate->tableId, pVgroup->vgId, sid); return mnodeDoCreateChildTable(pMsg, sid); diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index c86d9ad2506c7995ac6f679056f2a987235e7680..01ed82c67cc6241d2876f51520d7f4be1b6bd410 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -332,7 +332,7 @@ static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) { // realloc all vgroups in db int32_t newIdPoolSize; - if (minIdPoolSize < TSDB_TABLES_STEP) { + if (minIdPoolSize * 2 < TSDB_TABLES_STEP) { newIdPoolSize = minIdPoolSize * 2; } else { newIdPoolSize = ((minIdPoolSize / TSDB_TABLES_STEP) + 1) * TSDB_TABLES_STEP;