swarm/storage: fix access count on dbstore after cache hit (#17978)
Access count was not incremented when chunk was retrieved from cache. So the garbage collector might have deleted the most frequently accessed chunk from disk. Co-authored-by: Ferenc Szabo <ferenc.szabo@ethereum.org>
This commit is contained in:
committed by
Viktor Trón
parent
1212c7b844
commit
8080265f3f
@@ -153,6 +153,7 @@ func (ls *LocalStore) get(ctx context.Context, addr Address) (chunk Chunk, err e
|
||||
|
||||
if err == nil {
|
||||
metrics.GetOrRegisterCounter("localstore.get.cachehit", nil).Inc(1)
|
||||
go ls.DbStore.MarkAccessed(addr)
|
||||
return chunk, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user