fix(tsdb/cache): destory brin block with fs loading
This commit is contained in:
parent
3d6818b2f0
commit
d93b4f88b3
|
@ -1955,6 +1955,7 @@ typedef struct SFSNextRowIter {
|
||||||
SArray *pIndexList;
|
SArray *pIndexList;
|
||||||
int32_t iBrinIndex;
|
int32_t iBrinIndex;
|
||||||
SBrinBlock brinBlock;
|
SBrinBlock brinBlock;
|
||||||
|
SBrinBlock *pBrinBlock;
|
||||||
int32_t iBrinRecord;
|
int32_t iBrinRecord;
|
||||||
SBrinRecord brinRecord;
|
SBrinRecord brinRecord;
|
||||||
SBlockData blockData;
|
SBlockData blockData;
|
||||||
|
@ -2143,6 +2144,11 @@ static int32_t getNextRowFromFS(void *iter, TSDBROW **ppRow, bool *pIgnoreEarlie
|
||||||
pBrinBlk = taosArrayGet(state->pIndexList, state->iBrinIndex);
|
pBrinBlk = taosArrayGet(state->pIndexList, state->iBrinIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!state->pBrinBlock) {
|
||||||
|
state->pBrinBlock = &state->brinBlock;
|
||||||
|
} else {
|
||||||
|
tBrinBlockClear(&state->brinBlock);
|
||||||
|
}
|
||||||
code = tsdbDataFileReadBrinBlock(state->pr->pFileReader, pBrinBlk, &state->brinBlock);
|
code = tsdbDataFileReadBrinBlock(state->pr->pFileReader, pBrinBlk, &state->brinBlock);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
goto _err;
|
goto _err;
|
||||||
|
@ -2420,6 +2426,16 @@ int32_t clearNextRowFromFS(void *iter) {
|
||||||
state->pBlockData = NULL;
|
state->pBlockData = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state->pBrinBlock) {
|
||||||
|
tBrinBlockDestroy(state->pBrinBlock);
|
||||||
|
state->pBrinBlock = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state->pIndexList) {
|
||||||
|
taosArrayDestroy(state->pIndexList);
|
||||||
|
state->pIndexList = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (state->pTSRow) {
|
if (state->pTSRow) {
|
||||||
taosMemoryFree(state->pTSRow);
|
taosMemoryFree(state->pTSRow);
|
||||||
state->pTSRow = NULL;
|
state->pTSRow = NULL;
|
||||||
|
|
Loading…
Reference in New Issue