From 32f7a2728b2a5feb375ce758a23dd84a66168433 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 18 Jun 2020 05:56:59 +0000 Subject: [PATCH] TD-353 --- src/tsdb/src/tsdbBuffer.c | 4 ++-- src/tsdb/src/tsdbMeta.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tsdb/src/tsdbBuffer.c b/src/tsdb/src/tsdbBuffer.c index 95136454a0..0da0df9aa0 100644 --- a/src/tsdb/src/tsdbBuffer.c +++ b/src/tsdb/src/tsdbBuffer.c @@ -67,13 +67,13 @@ int tsdbOpenBufPool(STsdbRepo *pRepo) { ASSERT(pPool != NULL); - pPool->bufBlockSize = pCfg->cacheBlockSize; + pPool->bufBlockSize = pCfg->cacheBlockSize * 1024 * 1024; pPool->tBufBlocks = pCfg->totalBlocks; pPool->nBufBlocks = 0; pPool->index = 0; for (int i = 0; i < pCfg->totalBlocks; i++) { - STsdbBufBlock *pBufBlock = tsdbNewBufBlock(pCfg->cacheBlockSize); + STsdbBufBlock *pBufBlock = tsdbNewBufBlock(pPool->bufBlockSize); if (pBufBlock == NULL) goto _err; if (tdListAppend(pPool->bufBlockList, (void *)(&pBufBlock)) < 0) { diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index a0a3aebfd4..1bcc444628 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -98,7 +98,7 @@ int tsdbCreateTable(TSDB_REPO_T *repo, STableCfg *pCfg) { ASSERT(POINTER_DISTANCE(pBuf, buf) == tlen1); buf = pBuf; } - tsdbInsertTableAct(pRepo, TSDB_UPDATE_META, buf, super); + tsdbInsertTableAct(pRepo, TSDB_UPDATE_META, buf, table); return 0; @@ -722,7 +722,7 @@ static int tsdbAddTableToMeta(STsdbRepo *pRepo, STable *pTable, bool addIdx) { goto _err; } } else { - if (TABLE_TID(pTable) == TSDB_CHILD_TABLE && addIdx) { // add STABLE to the index + if (TABLE_TYPE(pTable) == TSDB_CHILD_TABLE && addIdx) { // add STABLE to the index if (tsdbAddTableIntoIndex(pMeta, pTable) < 0) { tsdbTrace("vgId:%d failed to add table %s to meta while add table to index since %s", REPO_ID(pRepo), TABLE_CHAR_NAME(pTable), tstrerror(terrno));