diff --git a/source/dnode/vnode/src/tsdb/tsdbMemTable.c b/source/dnode/vnode/src/tsdb/tsdbMemTable.c index 26fb39f523c4c9ef2fd868ebb523419cb12c9ff8..8d756618573e50b8161230d69e4b1d271f84ea82 100644 --- a/source/dnode/vnode/src/tsdb/tsdbMemTable.c +++ b/source/dnode/vnode/src/tsdb/tsdbMemTable.c @@ -750,7 +750,7 @@ int32_t tsdbRefMemTable(SMemTable *pMemTable, void *pQHandle, _tsdb_reseek_func_ int32_t nRef = atomic_fetch_add_32(&pMemTable->nRef, 1); ASSERT(nRef > 0); - + /* // register handle (todo: take concurrency in consideration) *ppNode = taosMemoryMalloc(sizeof(SQueryNode)); if (*ppNode == NULL) { @@ -763,21 +763,21 @@ int32_t tsdbRefMemTable(SMemTable *pMemTable, void *pQHandle, _tsdb_reseek_func_ (*ppNode)->ppNext = &pMemTable->qList.pNext; pMemTable->qList.pNext->ppNext = &(*ppNode)->pNext; pMemTable->qList.pNext = *ppNode; - + */ _exit: return code; } int32_t tsdbUnrefMemTable(SMemTable *pMemTable, SQueryNode *pNode) { int32_t code = 0; - + /* // unregister handle (todo: take concurrency in consideration) if (pNode) { pNode->pNext->ppNext = pNode->ppNext; *pNode->ppNext = pNode->pNext; taosMemoryFree(pNode); } - + */ int32_t nRef = atomic_sub_fetch_32(&pMemTable->nRef, 1); if (nRef == 0) { tsdbMemTableDestroy(pMemTable); diff --git a/source/dnode/vnode/src/tsdb/tsdbRead.c b/source/dnode/vnode/src/tsdb/tsdbRead.c index 841396c515ebd4e33386f27c7bd53204ebeab2d8..d8ecaf98323633cba0fe503bf7936294dc178f51 100644 --- a/source/dnode/vnode/src/tsdb/tsdbRead.c +++ b/source/dnode/vnode/src/tsdb/tsdbRead.c @@ -3927,6 +3927,7 @@ void tsdbReaderClose(STsdbReader* pReader) { pReader->pDelIdx = NULL; } + qTrace("tsdb/reader: %p, untake snapshot", pReader); tsdbUntakeReadSnap(pReader, pReader->pReadSnap); taosThreadMutexDestroy(&pReader->readerMutex); @@ -4065,6 +4066,7 @@ int32_t tsdbReaderResume(STsdbReader* pReader) { // task snapshot int32_t numOfTables = taosHashGetSize(pReader->status.pTableMap); if (numOfTables > 0) { + qTrace("tsdb/reader: %p, take snapshot", pReader); code = tsdbTakeReadSnap(pReader, tsdbSetQueryReseek, &pReader->pReadSnap); if (code != TSDB_CODE_SUCCESS) { goto _err; @@ -4392,6 +4394,7 @@ SSDataBlock* tsdbRetrieveDataBlock(STsdbReader* pReader, SArray* pIdList) { SSDataBlock* ret = doRetrieveDataBlock(pTReader); + qTrace("tsdb/read-retrieve: %p, unlock read mutex", pReader); taosThreadMutexUnlock(&pReader->readerMutex); return ret; diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 923b535e63aef06b38364848ba627456b9519292..6dd5341b2e109d0f3fffcfb6233edf6bfe8968ae 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2554,6 +2554,7 @@ static SSDataBlock* getTableDataBlockImpl(void* param) { } STsdbReader* reader = pInfo->base.dataReader; + qTrace("tsdb/read-table-data: %p, enter next reader", reader); while (tsdbNextDataBlock(reader)) { if (isTaskKilled(pTaskInfo)) { T_LONG_JMP(pTaskInfo->env, pTaskInfo->code); @@ -2588,6 +2589,7 @@ static SSDataBlock* getTableDataBlockImpl(void* param) { pOperator->resultInfo.totalRows += pBlock->info.rows; pInfo->base.readRecorder.elapsedTime += (taosGetTimestampUs() - st) / 1000.0; + qTrace("tsdb/read-table-data: %p, close reader", reader); tsdbReaderClose(pInfo->base.dataReader); pInfo->base.dataReader = NULL; return pBlock;