Make the cache eviction logic for stale entities more robust

Fixes #12458
This commit is contained in:
Bjørn Erik Pedersen
2024-05-03 11:04:57 +02:00
parent 68e95327f7
commit 503d20954f
12 changed files with 157 additions and 55 deletions

View File

@@ -657,8 +657,9 @@ type resourceAdapterInner struct {
*publishOnce
}
func (r *resourceAdapterInner) IsStale() bool {
return r.Staler.IsStale() || r.target.IsStale()
func (r *resourceAdapterInner) StaleVersion() uint32 {
// Both of these are incremented on change.
return r.Staler.StaleVersion() + r.target.StaleVersion()
}
type resourceTransformations struct {