lru/applyF: fix ret value

This commit is contained in:
Minglei Jin 2023-06-16 10:00:17 +08:00
parent 2cb6c7af16
commit 968e3cf1ea
2 changed files with 9 additions and 4 deletions

View File

@ -235,6 +235,7 @@ static void rocksMayWrite(STsdb *pTsdb, bool force, bool read, bool lock) {
tsdbError("vgId:%d, %s failed at line %d, count: %d since %s", TD_VID(pTsdb->pVnode), __func__, __LINE__, count,
err);
rocksdb_free(err);
// pTsdb->flushState.flush_count = 0;
}
rocksdb_writebatch_clear(wb);
@ -485,7 +486,9 @@ int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSDBROW *pRow
}
}
pLastCol->dirty = 1;
if (!pLastCol->dirty) {
pLastCol->dirty = 1;
}
/*
char *value = NULL;
size_t vlen = 0;
@ -530,7 +533,9 @@ int32_t tsdbCacheUpdate(STsdb *pTsdb, tb_uid_t suid, tb_uid_t uid, TSDBROW *pRow
}
}
pLastCol->dirty = 1;
if (!pLastCol->dirty) {
pLastCol->dirty = 1;
}
/*
char *value = NULL;
size_t vlen = 0;

View File

@ -156,7 +156,7 @@ static int taosLRUEntryTableApplyF(SLRUEntryTable *table, _taos_lru_functor_t fu
SLRUEntry *n = h->nextHash;
ASSERT(TAOS_LRU_ENTRY_IN_CACHE(h));
ret = functor(h->keyData, h->keyLength, h->value, ud);
if (!ret) {
if (ret) {
return ret;
}
h = n;
@ -758,7 +758,7 @@ void taosLRUCacheErase(SLRUCache *cache, const void *key, size_t keyLen) {
void taosLRUCacheApply(SLRUCache *cache, _taos_lru_functor_t functor, void *ud) {
int numShards = cache->numShards;
for (int i = 0; i < numShards; ++i) {
if (0 != taosLRUCacheShardApply(&cache->shards[i], functor, ud)) {
if (taosLRUCacheShardApply(&cache->shards[i], functor, ud)) {
break;
}
}