Merge pull request #4362 from taosdata/hotfix/TD-2184

fix TD-2184
This commit is contained in:
Shengliang Guan 2020-11-27 10:22:59 +08:00 committed by GitHub
commit 12bee358c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -871,10 +871,10 @@ static void tsdbFreeRows(STsdbRepo *pRepo, void **rows, int rowCounter) {
listNEles(pRepo->mem->bufBlockList), pBufBlock->offset, pBufBlock->remain); listNEles(pRepo->mem->bufBlockList), pBufBlock->offset, pBufBlock->remain);
if (pBufBlock->offset == 0) { // return the block to buffer pool if (pBufBlock->offset == 0) { // return the block to buffer pool
tsdbLockRepo(pRepo); if (tsdbLockRepo(pRepo) < 0) return;
SListNode *pNode = tdListPopTail(pRepo->mem->bufBlockList); SListNode *pNode = tdListPopTail(pRepo->mem->bufBlockList);
tdListPrependNode(pBufPool->bufBlockList, pNode); tdListPrependNode(pBufPool->bufBlockList, pNode);
tsdbUnlockRepo(pRepo); if (tsdbUnlockRepo(pRepo) < 0) return;
} }
} else { } else {
ASSERT(listNEles(pRepo->mem->extraBuffList) > 0); ASSERT(listNEles(pRepo->mem->extraBuffList) > 0);

View File

@ -291,7 +291,10 @@ bool tSkipListIterNext(SSkipListIterator *iter) {
iter->next = SL_NODE_GET_FORWARD_POINTER(iter->cur, 0); iter->next = SL_NODE_GET_FORWARD_POINTER(iter->cur, 0);
iter->step++; iter->step++;
} else { } else {
if (iter->cur == pSkipList->pHead) return false; if (iter->cur == pSkipList->pHead) {
tSkipListUnlock(pSkipList);
return false;
}
iter->cur = SL_NODE_GET_BACKWARD_POINTER(iter->cur, 0); iter->cur = SL_NODE_GET_BACKWARD_POINTER(iter->cur, 0);
// a new node is inserted into between iter->cur and iter->next, ignore it // a new node is inserted into between iter->cur and iter->next, ignore it