Merge pull request #16953 from taosdata/fix/TD-19129
fix: wlock for meta update tag value
This commit is contained in:
commit
0b645f5010
|
@ -362,8 +362,9 @@ int metaAlterSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
|
||||||
// update uid index
|
// update uid index
|
||||||
metaUpdateUidIdx(pMeta, &nStbEntry);
|
metaUpdateUidIdx(pMeta, &nStbEntry);
|
||||||
|
|
||||||
if (oStbEntry.pBuf) taosMemoryFree(oStbEntry.pBuf);
|
|
||||||
metaULock(pMeta);
|
metaULock(pMeta);
|
||||||
|
|
||||||
|
if (oStbEntry.pBuf) taosMemoryFree(oStbEntry.pBuf);
|
||||||
tDecoderClear(&dc);
|
tDecoderClear(&dc);
|
||||||
tdbTbcClose(pTbDbc);
|
tdbTbcClose(pTbDbc);
|
||||||
tdbTbcClose(pUidIdxc);
|
tdbTbcClose(pUidIdxc);
|
||||||
|
@ -922,6 +923,8 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
taosArrayDestroy(pTagArray);
|
taosArrayDestroy(pTagArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
metaWLock(pMeta);
|
||||||
|
|
||||||
// save to table.db
|
// save to table.db
|
||||||
metaSaveToTbDb(pMeta, &ctbEntry);
|
metaSaveToTbDb(pMeta, &ctbEntry);
|
||||||
|
|
||||||
|
@ -936,6 +939,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);
|
||||||
|
|
||||||
|
metaULock(pMeta);
|
||||||
|
|
||||||
tDecoderClear(&dc1);
|
tDecoderClear(&dc1);
|
||||||
tDecoderClear(&dc2);
|
tDecoderClear(&dc2);
|
||||||
if (ctbEntry.ctbEntry.pTags) taosMemoryFree((void *)ctbEntry.ctbEntry.pTags);
|
if (ctbEntry.ctbEntry.pTags) taosMemoryFree((void *)ctbEntry.ctbEntry.pTags);
|
||||||
|
|
Loading…
Reference in New Issue