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

[BUG] Redis key present in cache even after deleted by first thread and reading around same point of time by other thread. #13232

Open
ParasGH opened this issue Apr 23, 2024 · 4 comments

Comments

@ParasGH
Copy link

ParasGH commented Apr 23, 2024

When one thread deleted the cached key and around same point of time another thread doing following task Redis responded incorrectly:
Retrieving remaining time to live response is null.
Checking whether key exist or not: key present in cache even after deleted by first thread.
Checking value of key: value present in cache even after deleted by first thread.

To reproduce

Delete the key by a thread.
With other thread at same time check key exist or not after deleted by first thread.
Result: Key exists

Expected behavior
Key should not exist after deleted.

@mgravell
Copy link

"around same point of time" is vague, and doesn't give enough information to know whether the server is doing anything incorrect here. Delays and overtakes are possible at pretty much every point unless you are talking about two messages on the same connection being processed out of order, so for close events: it becomes very hard to say which cam first - the GET or the DEL/UNLINK, i.e. what evidence do you have for the "after" in the sentence "after deleted by first thread"?

@ParasGH
Copy link
Author

ParasGH commented Apr 23, 2024

"around the same point" means first thread deleted the key then after few mill/microseconds second thread check key existence. The evidence for "after" based on retrieving remaining time to live for key as NULL after deleted by first thread even key having enough remaining time to live before deleting the key.

@ParasGH
Copy link
Author

ParasGH commented May 2, 2024

Looking forward for fixes of issue, is any progress?

@sundb
Copy link
Collaborator

sundb commented May 6, 2024

@ParasGH did you confirm that the messages of the two threads are delivered in the order you expect?
could you try to use MONITOR to verify it?

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

No branches or pull requests

3 participants