fix: race condition in dumpConfToDataBlock

This commit is contained in:
Shungang Li 2024-05-14 10:45:13 +08:00
parent 89e4d03751
commit 87f52c88d9
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);