fix: use stable stats cache to get ctbNum

This commit is contained in:
Minglei Jin 2022-10-11 17:50:42 +08:00
parent 25b279dd7a
commit de113ccf5f
2 changed files with 8 additions and 2 deletions

View File

@ -362,6 +362,8 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
// update uid index
metaUpdateUidIdx(pMeta, &nStbEntry);
metaStatsCacheDrop(pMeta, nStbEntry.uid);
metaULock(pMeta);
if (oStbEntry.pBuf) taosMemoryFree(oStbEntry.pBuf);
@ -615,6 +617,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) {
tdbTbDelete(pMeta->pSuidIdx, &e.uid, sizeof(tb_uid_t), &pMeta->txn);
// drop schema.db (todo)
metaStatsCacheDrop(pMeta, uid);
--pMeta->pVnode->config.vndStats.numOfSTables;
}

View File

@ -495,8 +495,11 @@ int32_t vnodeGetTimeSeriesNum(SVnode *pVnode, int64_t *num) {
break;
}
int64_t ctbNum = 0;
vnodeGetCtbNum(pVnode, id, &ctbNum);
SMetaStbStats stats = {0};
metaGetStbStats(pVnode->pMeta, id, &stats);
int64_t ctbNum = stats.ctbNum;
// vnodeGetCtbNum(pVnode, id, &ctbNum);
int numOfCols = 0;
vnodeGetStbColumnNum(pVnode, id, &numOfCols);