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

SCAN command returns keys of expired objects #151

Closed
cduluCNB opened this issue Mar 26, 2024 · 8 comments · Fixed by #323
Closed

SCAN command returns keys of expired objects #151

cduluCNB opened this issue Mar 26, 2024 · 8 comments · Fixed by #323
Assignees
Labels
bug Something isn't working

Comments

@cduluCNB
Copy link
Contributor

After setting an object and letting it expire, when running the SCAN command, Garnet still lists the key, while Redis does not.

This causes issues with RedisInsight and Another Redis Desktop Manager as they will run the TYPE command on each returned item from the SCAN command. The TYPE command bug is addressed in #150, however, even with this fix, in RedisInsight, the expired keys will show as having "No limit", and it'll show an error saying that the key with that name does not exist.

Using version 1.0.1, compiled in VS2022 in Release/Any CPU mode and using the .NET 8 version.

Garnet:
2024-03-26 Garnet Scan

Redis:
2024-03-26 Redis Scan

RedisInsight error:
2024-03-26 RedisInsight Error

@cduluCNB
Copy link
Contributor Author

My original tests were on Windows 11, using .NET 8.0.3 and VS 2022 Preview 17.10 Preview 1. I'm also able to replicate this using redis-cli with Garnet running on Ubuntu 22.04.3 LTS with .NET 8.0.3 in Release mode.

@TedHartMS TedHartMS self-assigned this Mar 26, 2024
@darrenge darrenge added the bug Something isn't working label Mar 26, 2024
@ClericPy
Copy link

Encountered the same issue, any progress?

is it fixed by #150 ?

@cduluCNB
Copy link
Contributor Author

Hi @ClericPy this issue isn't fixed by #150, this is a different issue related to the SCAN command.

@ClericPy
Copy link

Hi @ClericPy this issue isn't fixed by #150, this is a different issue related to the SCAN command.

So sorry I got a mistake, I used garnet 1.0 and expire not work. Used redispy & redis long time ago, and the code didn't changed. These days I noticed that the keys were not automatically purged according to their expire time when using db0

@cduluCNB
Copy link
Contributor Author

Hi @ClericPy this issue isn't fixed by #150, this is a different issue related to the SCAN command.

So sorry I got a mistake, I used garnet 1.0 and expire not work. Used redispy & redis long time ago, and the code didn't changed. These days I noticed that the keys were not automatically purged according to their expire time when using db0

Yes, this is the same issue, keys aren't automatically purged in the list after their expiry time.

@ClericPy
Copy link

Hi @ClericPy this issue isn't fixed by #150, this is a different issue related to the SCAN command.

So sorry I got a mistake, I used garnet 1.0 and expire not work. Used redispy & redis long time ago, and the code didn't changed. These days I noticed that the keys were not automatically purged according to their expire time when using db0

Yes, this is the same issue, keys aren't automatically purged in the list after their expiry time.

I don't know why this issue hasn't received much attention. Logically, there shouldn't be a shortage of users for this database, and the usage of TTL caching should be quite frequent.

@ClericPy
Copy link

Hi @ClericPy this issue isn't fixed by #150, this is a different issue related to the SCAN command.

So sorry I got a mistake, I used garnet 1.0 and expire not work. Used redispy & redis long time ago, and the code didn't changed. These days I noticed that the keys were not automatically purged according to their expire time when using db0

Yes, this is the same issue, keys aren't automatically purged in the list after their expiry time.

I don't know why this issue hasn't received much attention. Logically, there shouldn't be a shortage of users for this database, and the usage of TTL caching should be quite frequent.

By the way, is there a temporary solution without experimentation that can solve the problem of having 30 million expired keys stored now:

scan all keys and manually determine expire and then manually clear them

@cduluCNB
Copy link
Contributor Author

This has been resolved for strings. Thank you @TedHartMS

@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants