Merge pull request #24236 from taosdata/fix/TD-28061
fix(tsdb/cache): erase entry from lru if deleted
This commit is contained in:
commit
2ada7d455e
|
@ -1183,8 +1183,10 @@ int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKE
|
||||||
LRUHandle *h = taosLRUCacheLookup(pTsdb->lruCache, keys_list[i], klen);
|
LRUHandle *h = taosLRUCacheLookup(pTsdb->lruCache, keys_list[i], klen);
|
||||||
if (h) {
|
if (h) {
|
||||||
SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pTsdb->lruCache, h);
|
SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pTsdb->lruCache, h);
|
||||||
if (pLastCol->dirty && (pLastCol->ts <= eKey && pLastCol->ts >= sKey)) {
|
if (pLastCol->dirty) {
|
||||||
pLastCol->dirty = 0;
|
pLastCol->dirty = 0;
|
||||||
|
}
|
||||||
|
if (pLastCol->ts <= eKey && pLastCol->ts >= sKey) {
|
||||||
erase = true;
|
erase = true;
|
||||||
}
|
}
|
||||||
taosLRUCacheRelease(pTsdb->lruCache, h, erase);
|
taosLRUCacheRelease(pTsdb->lruCache, h, erase);
|
||||||
|
@ -1197,8 +1199,10 @@ int32_t tsdbCacheDel(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSKEY sKey, TSKE
|
||||||
h = taosLRUCacheLookup(pTsdb->lruCache, keys_list[num_keys + i], klen);
|
h = taosLRUCacheLookup(pTsdb->lruCache, keys_list[num_keys + i], klen);
|
||||||
if (h) {
|
if (h) {
|
||||||
SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pTsdb->lruCache, h);
|
SLastCol *pLastCol = (SLastCol *)taosLRUCacheValue(pTsdb->lruCache, h);
|
||||||
if (pLastCol->dirty && (pLastCol->ts <= eKey && pLastCol->ts >= sKey)) {
|
if (pLastCol->dirty) {
|
||||||
pLastCol->dirty = 0;
|
pLastCol->dirty = 0;
|
||||||
|
}
|
||||||
|
if (pLastCol->ts <= eKey && pLastCol->ts >= sKey) {
|
||||||
erase = true;
|
erase = true;
|
||||||
}
|
}
|
||||||
taosLRUCacheRelease(pTsdb->lruCache, h, erase);
|
taosLRUCacheRelease(pTsdb->lruCache, h, erase);
|
||||||
|
|
Loading…
Reference in New Issue