You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All implementations of caches in Go that are trying to be contention-free (ristretto, theine, otter, ccache) currently have problems with maintaining correct operation in the eventual consistency mode.
The most common problem (and the simplest) is the race condition with simultaneous Set operations and removal from the eviction policy, followed by removal from the hash table. This leads to zombie entries in the eviction policy and the absence of the desired entry in the hash table. This is a problem in ristretto and ccache. In theine and otter it is solved.
A much more terrible problem is the incorrect synchronization of the cost of each entry with the eviction policy. For example, theine updates the cost on the spot and then sends an update event, this can lead to a complete failure of the eviction policy when this entry is competitively transferred from one lru queue to another. This problem exists in theine and ristretto (complete loss of the event).
When sending events, they may get mixed up, Delete and Add operations to the eviction policy will be applied in the wrong order and as a result, the eviction policy will be corrupted by the zombie entry. This problem exists in all the mentioned caches.
Goal
We need to get rid of this problem in otter. Most likely, the best solution is to use a finite state machine of two states, live and dead.
Acceptance criteria
Fixed damage to the eviction policy in case of incorrect order of events.
The text was updated successfully, but these errors were encountered:
Clarification and motivation
Description
All implementations of caches in Go that are trying to be contention-free (ristretto, theine, otter, ccache) currently have problems with maintaining correct operation in the eventual consistency mode.
Delete
andAdd
operations to the eviction policy will be applied in the wrong order and as a result, the eviction policy will be corrupted by the zombie entry. This problem exists in all the mentioned caches.Goal
We need to get rid of this problem in otter. Most likely, the best solution is to use a finite state machine of two states,
live
anddead
.Acceptance criteria
The text was updated successfully, but these errors were encountered: