aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/localstore.go
diff options
context:
space:
mode:
authorFerenc Szabo <frncmx@gmail.com>2018-11-13 14:41:01 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2018-11-13 14:41:01 +0800
commit8080265f3f591d33e127a924724a8bfe5ced6475 (patch)
treef5556b59dee64d399d61b6f7cb4e97bde69f29d0 /swarm/storage/localstore.go
parent1212c7b844e3ef13cbb5476b088eae27782535b4 (diff)
downloadgo-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.go1
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
}