From 504860d14c9ba8a54dc5db3658a31602575bffbf Mon Sep 17 00:00:00 2001 From: hzcheng Date: Sat, 2 May 2020 15:33:47 +0800 Subject: [PATCH] fix maxTables problem --- src/mnode/src/mgmtVgroup.c | 2 +- src/tsdb/src/tsdbMain.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mnode/src/mgmtVgroup.c b/src/mnode/src/mgmtVgroup.c index b3260850ad..6e694b9fc1 100644 --- a/src/mnode/src/mgmtVgroup.c +++ b/src/mnode/src/mgmtVgroup.c @@ -549,7 +549,7 @@ SMDCreateVnodeMsg *mgmtBuildCreateVnodeMsg(SVgObj *pVgroup) { pCfg->cfgVersion = htonl(pDb->cfgVersion); pCfg->cacheBlockSize = htonl(pDb->cfg.cacheBlockSize); pCfg->totalBlocks = htonl(pDb->cfg.totalBlocks); - pCfg->maxTables = htonl(pDb->cfg.maxTables); + pCfg->maxTables = htonl(pDb->cfg.maxTables + 1); pCfg->daysPerFile = htonl(pDb->cfg.daysPerFile); pCfg->daysToKeep = htonl(pDb->cfg.daysToKeep); pCfg->daysToKeep1 = htonl(pDb->cfg.daysToKeep1); diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c index c0f6030fa6..fcfbcc9014 100644 --- a/src/tsdb/src/tsdbMain.c +++ b/src/tsdb/src/tsdbMain.c @@ -611,10 +611,6 @@ static int32_t tsdbCheckAndSetDefaultCfg(STsdbCfg *pCfg) { if (pCfg->maxTables < TSDB_MIN_TABLES || pCfg->maxTables > TSDB_MAX_TABLES) return -1; } - // Since tableId starts from 1, we increase maxTables by 1 - // TODO: take a fancier way to do this - pCfg->maxTables++; - // Check daysPerFile if (pCfg->daysPerFile == -1) { pCfg->daysPerFile = TSDB_DEFAULT_DAYS_PER_FILE;