diff options
author | Ferenc Szabo <frncmx@gmail.com> | 2018-11-13 14:41:01 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2018-11-13 14:41:01 +0800 |
commit | 8080265f3f591d33e127a924724a8bfe5ced6475 (patch) | |
tree | f5556b59dee64d399d61b6f7cb4e97bde69f29d0 /swarm/storage/localstore.go | |
parent | 1212c7b844e3ef13cbb5476b088eae27782535b4 (diff) | |
download | go-tangerine-8080265f3f591d33e127a924724a8bfe5ced6475.tar go-tangerine-8080265f3f591d33e127a924724a8bfe5ced6475.tar.gz go-tangerine-8080265f3f591d33e127a924724a8bfe5ced6475.tar.bz2 go-tangerine-8080265f3f591d33e127a924724a8bfe5ced6475.tar.lz go-tangerine-8080265f3f591d33e127a924724a8bfe5ced6475.tar.xz go-tangerine-8080265f3f591d33e127a924724a8bfe5ced6475.tar.zst go-tangerine-8080265f3f591d33e127a924724a8bfe5ced6475.zip |
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>
Diffstat (limited to 'swarm/storage/localstore.go')
-rw-r--r-- | swarm/storage/localstore.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/swarm/storage/localstore.go b/swarm/storage/localstore.go index 4fa6fb2f6..6971d759e 100644 --- a/swarm/storage/localstore.go +++ b/swarm/storage/localstore.go @@ -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 } |