[#441] cmd/neofs-node: Don't update access time in ttlNetCache

ttlNetCache should evict records after TTL duration. However if
data is often accessed and there are no LRU eviction (cache used
with small number of keys), then data will not be evicted ever.

This is a invalid behaviour for mutable data such as eACL.

Solution is to not update access time on every get, so the data
will be guarantee evicted after TTL duration.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Alex Vanin 2021-03-23 19:03:36 +03:00 committed by Leonard Lyubich
parent 8d5c17facd
commit 518f375dfd
1 changed files with 0 additions and 1 deletions

View File

@ -60,7 +60,6 @@ func (c *ttlNetCache) get(key interface{}) (interface{}, error) {
valWithTime := val.(*valueWithTime)
if time.Since(valWithTime.t) < c.ttl {
valWithTime.t = time.Now()
return valWithTime.v, nil
}