fix(meta/cache): invalidate suid cache when create/drop ctb & update tag
This commit is contained in:
parent
f8bc4df4af
commit
59a1571945
|
@ -458,6 +458,7 @@ int metaCreateTable(SMeta *pMeta, int64_t version, SVCreateTbReq *pReq, STableMe
|
||||||
|
|
||||||
metaWLock(pMeta);
|
metaWLock(pMeta);
|
||||||
metaUpdateStbStats(pMeta, me.ctbEntry.suid, 1);
|
metaUpdateStbStats(pMeta, me.ctbEntry.suid, 1);
|
||||||
|
metaUidCacheClear(pMeta, me.ctbEntry.suid);
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
} else {
|
} else {
|
||||||
me.ntbEntry.ctime = pReq->ctime;
|
me.ntbEntry.ctime = pReq->ctime;
|
||||||
|
@ -681,6 +682,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) {
|
||||||
--pMeta->pVnode->config.vndStats.numOfCTables;
|
--pMeta->pVnode->config.vndStats.numOfCTables;
|
||||||
|
|
||||||
metaUpdateStbStats(pMeta, e.ctbEntry.suid, -1);
|
metaUpdateStbStats(pMeta, e.ctbEntry.suid, -1);
|
||||||
|
metaUidCacheClear(pMeta, e.ctbEntry.suid);
|
||||||
} else if (e.type == TSDB_NORMAL_TABLE) {
|
} else if (e.type == TSDB_NORMAL_TABLE) {
|
||||||
// drop schema.db (todo)
|
// drop schema.db (todo)
|
||||||
|
|
||||||
|
@ -691,6 +693,7 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) {
|
||||||
// drop schema.db (todo)
|
// drop schema.db (todo)
|
||||||
|
|
||||||
metaStatsCacheDrop(pMeta, uid);
|
metaStatsCacheDrop(pMeta, uid);
|
||||||
|
metaUidCacheClear(pMeta, uid);
|
||||||
--pMeta->pVnode->config.vndStats.numOfSTables;
|
--pMeta->pVnode->config.vndStats.numOfSTables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1069,6 +1072,8 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
tdbTbUpsert(pMeta->pCtbIdx, &ctbIdxKey, sizeof(ctbIdxKey), ctbEntry.ctbEntry.pTags,
|
tdbTbUpsert(pMeta->pCtbIdx, &ctbIdxKey, sizeof(ctbIdxKey), ctbEntry.ctbEntry.pTags,
|
||||||
((STag *)(ctbEntry.ctbEntry.pTags))->len, &pMeta->txn);
|
((STag *)(ctbEntry.ctbEntry.pTags))->len, &pMeta->txn);
|
||||||
|
|
||||||
|
metaUidCacheClear(pMeta, ctbEntry.ctbEntry.suid);
|
||||||
|
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
|
|
||||||
tDecoderClear(&dc1);
|
tDecoderClear(&dc1);
|
||||||
|
|
Loading…
Reference in New Issue