diff --git a/source/libs/sync/src/syncRaftLog.c b/source/libs/sync/src/syncRaftLog.c index 2b1cee51d70840466ae60779f407b5aaf53df07c..955ecf9c296dc97335a7037fa0eedc4b73ed29f8 100644 --- a/source/libs/sync/src/syncRaftLog.c +++ b/source/libs/sync/src/syncRaftLog.c @@ -38,7 +38,7 @@ SSyncLogStore* logStoreCreate(SSyncNode* pSyncNode) { } // pLogStore->pCache = taosLRUCacheInit(10 * 1024 * 1024, 1, .5); - pLogStore->pCache = taosLRUCacheInit(100 * 1024 * 1024, 1, .5); + pLogStore->pCache = taosLRUCacheInit(30 * 1024 * 1024, 1, .5); if (pLogStore->pCache == NULL) { taosMemoryFree(pLogStore); terrno = TSDB_CODE_WAL_OUT_OF_MEMORY; @@ -325,12 +325,15 @@ static int32_t raftLogTruncate(struct SSyncLogStore* pLogStore, SyncIndex fromIn // delete from cache for (SyncIndex index = fromIndex; index <= wallastVer; ++index) { SLRUCache* pCache = pData->pSyncNode->pLogStore->pCache; + taosLRUCacheErase(pData->pSyncNode->pLogStore->pCache, &index, sizeof(index)); +#if 0 LRUHandle* h = taosLRUCacheLookup(pCache, &index, sizeof(index)); if (h) { sNTrace(pData->pSyncNode, "cache delete index:%" PRId64, index); taosLRUCacheRelease(pData->pSyncNode->pLogStore->pCache, h, true); } +#endif } int32_t code = walRollback(pWal, fromIndex);