Merge pull request #27642 from taosdata/fix/TD-31845
fix(tsdb/cache): copy entry before transfering to lru
This commit is contained in:
commit
9810df98c6
|
@ -1692,19 +1692,18 @@ static int32_t tsdbCacheLoadFromRocks(STsdb *pTsdb, tb_uid_t uid, SArray *pLastA
|
||||||
goto _exit;
|
goto _exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SLastCol lastCol = *pLastCol;
|
||||||
|
TAOS_CHECK_EXIT(tsdbCacheReallocSLastCol(&lastCol, NULL));
|
||||||
|
|
||||||
LRUStatus status = taosLRUCacheInsert(pCache, &idxKey->key, ROCKS_KEY_LEN, pLastCol, charge, tsdbCacheDeleter,
|
LRUStatus status = taosLRUCacheInsert(pCache, &idxKey->key, ROCKS_KEY_LEN, pLastCol, charge, tsdbCacheDeleter,
|
||||||
NULL, TAOS_LRU_PRIORITY_LOW, &pTsdb->flushState);
|
NULL, TAOS_LRU_PRIORITY_LOW, &pTsdb->flushState);
|
||||||
if (status != TAOS_LRU_STATUS_OK) {
|
if (status != TAOS_LRU_STATUS_OK) {
|
||||||
code = -1;
|
code = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
SLastCol lastCol = *pLastCol;
|
|
||||||
TAOS_CHECK_EXIT(tsdbCacheReallocSLastCol(&lastCol, NULL));
|
|
||||||
|
|
||||||
taosArraySet(pLastArray, idxKey->idx, &lastCol);
|
taosArraySet(pLastArray, idxKey->idx, &lastCol);
|
||||||
taosArrayRemove(remainCols, j);
|
taosArrayRemove(remainCols, j);
|
||||||
taosArrayRemove(ignoreFromRocks, j);
|
taosArrayRemove(ignoreFromRocks, j);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue