TD-353
This commit is contained in:
parent
2e3ae87f47
commit
32f7a2728b
|
@ -67,13 +67,13 @@ int tsdbOpenBufPool(STsdbRepo *pRepo) {
|
||||||
|
|
||||||
ASSERT(pPool != NULL);
|
ASSERT(pPool != NULL);
|
||||||
|
|
||||||
pPool->bufBlockSize = pCfg->cacheBlockSize;
|
pPool->bufBlockSize = pCfg->cacheBlockSize * 1024 * 1024;
|
||||||
pPool->tBufBlocks = pCfg->totalBlocks;
|
pPool->tBufBlocks = pCfg->totalBlocks;
|
||||||
pPool->nBufBlocks = 0;
|
pPool->nBufBlocks = 0;
|
||||||
pPool->index = 0;
|
pPool->index = 0;
|
||||||
|
|
||||||
for (int i = 0; i < pCfg->totalBlocks; i++) {
|
for (int i = 0; i < pCfg->totalBlocks; i++) {
|
||||||
STsdbBufBlock *pBufBlock = tsdbNewBufBlock(pCfg->cacheBlockSize);
|
STsdbBufBlock *pBufBlock = tsdbNewBufBlock(pPool->bufBlockSize);
|
||||||
if (pBufBlock == NULL) goto _err;
|
if (pBufBlock == NULL) goto _err;
|
||||||
|
|
||||||
if (tdListAppend(pPool->bufBlockList, (void *)(&pBufBlock)) < 0) {
|
if (tdListAppend(pPool->bufBlockList, (void *)(&pBufBlock)) < 0) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ int tsdbCreateTable(TSDB_REPO_T *repo, STableCfg *pCfg) {
|
||||||
ASSERT(POINTER_DISTANCE(pBuf, buf) == tlen1);
|
ASSERT(POINTER_DISTANCE(pBuf, buf) == tlen1);
|
||||||
buf = pBuf;
|
buf = pBuf;
|
||||||
}
|
}
|
||||||
tsdbInsertTableAct(pRepo, TSDB_UPDATE_META, buf, super);
|
tsdbInsertTableAct(pRepo, TSDB_UPDATE_META, buf, table);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -722,7 +722,7 @@ static int tsdbAddTableToMeta(STsdbRepo *pRepo, STable *pTable, bool addIdx) {
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
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),
|
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));
|
TABLE_CHAR_NAME(pTable), tstrerror(terrno));
|
||||||
|
|
Loading…
Reference in New Issue