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
The KEYS command is only used to implement explicit invalidation, as far as I can tell. I'm not sure how often that is used, but probably not terribly often. That said, using SCAN would clearly be better than KEYS. There is higher risk of a race, but that risk is already present, so there wouldn't be a semantic change.
Sorry. I should have mentioned that. Yes when we use @InvalidateAll as you said this happens.
We can actually work around it, but I though I should at least mention it here.
Ah I didn't notice that this API is also used for annotation-based invalidation. That is of course a lot more often used. I'll take a look today, shouldn't be a big deal to fix.
Description
At the moment the Redis Cache implementation uses the KEYS command.
That is maybe not the best approach. See for example: https://docs.keydb.dev/blog/2020/08/10/blog-post/#:~:text=KEYS%20vs%20SCAN&text=The%20KEYS%20command%20and%20SCAN,the%20length%20of%20the%20query.
Implementation ideas
Instead the SCAN command should be used and maybe also it should be configurable regarding the COUNT part.
Using KEYS also creates issues using Quarkus Redis with AWS ElastiCache Serverless, which does not allow the KEYS command.
E.g.:
SCAN 0 MATCH cache:...* COUNT x
The text was updated successfully, but these errors were encountered: