Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow add on expired keys #2568

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

allow add on expired keys #2568

wants to merge 2 commits into from

Conversation

kmpm
Copy link

@kmpm kmpm commented May 7, 2024

Closes #1993

This is very useful when using dedupe on fairly static keys which otherwise would only trigger compaction when new keys are added.

This change simulate compaction by checking if TTL expired on an existing key, much like the Get function.
If expired, but no compaction is done (because of compaction_interval) the value is only updated.

Since the Add operation technically is a write I don't see a reason to change the documentation The compaction interval determines how often the cache is cleared of expired items, and this process is only triggered on writes to the cache. Access to the cache is blocked during this process.

@kmpm kmpm requested a review from Jeffail as a code owner May 7, 2024 13:21
kmpm added 2 commits May 8, 2024 07:49
Signed-off-by: kmpm <me@kmpm.se>
Signed-off-by: kmpm <me@kmpm.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory cache never compacts expired keys with a stable set of cache keys
1 participant