node: Refactor TTL cache #831
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#831
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "achuprov/frostfs-node:ttl_cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrate from internal to external TTL implementation
Closes: #639
Signed-off-by: Alexander Chuprov a.chuprov@yadro.com
@ -0,0 +27,4 @@
cache.set(key, ti, nil)
time.Sleep(2 * ttlDuration)
val, err := cache.get(key)
assert.Nil(t, err)
->
assert.NoError
? :)require.NoError
betterfixed
@ -0,0 +28,4 @@
time.Sleep(2 * ttlDuration)
val, err := cache.get(key)
assert.Nil(t, err)
assert.NotEqual(t, val, ti)
Am I right that values are not equeal because the entry is expired after
time.Sleep(2 * ttlDuration)
?Yes, you are correct. The values are not equal because the entry has expired after the
time.Sleep(2 * ttl Duration)
interval@ -33,3 +29,1 @@
netRdr netValueReader[K, V]
cache *expirable.LRU[K, *valueWithTime[V]]
If it is expireable, why do we use
*valueWithTime[V]
instead of*V
?Approved by accident, please disregard.
fixed
ac06af2940
tob9441b3479
b9441b3479
to30b237e176