Merge pull request #25756 from taosdata/fix/TD-30001-3.0

fix: race condition in dumpConfToDataBlock
This commit is contained in:
Hongze Cheng 2024-05-14 19:07:41 +08:00 committed by GitHub
commit e1555ea2bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -228,6 +228,8 @@ int32_t dumpConfToDataBlock(SSDataBlock* pBlock, int32_t startCol) {
blockDataEnsureCapacity(pBlock, cfgGetSize(pConf)); blockDataEnsureCapacity(pBlock, cfgGetSize(pConf));
SConfigIter* pIter = cfgCreateIter(pConf); SConfigIter* pIter = cfgCreateIter(pConf);
cfgLock(pConf);
while ((pItem = cfgNextIter(pIter)) != NULL) { while ((pItem = cfgNextIter(pIter)) != NULL) {
col = startCol; col = startCol;
@ -253,6 +255,8 @@ int32_t dumpConfToDataBlock(SSDataBlock* pBlock, int32_t startCol) {
numOfRows++; numOfRows++;
} }
cfgUnLock(pConf);
pBlock->info.rows = numOfRows; pBlock->info.rows = numOfRows;
cfgDestroyIter(pIter); cfgDestroyIter(pIter);