-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Fix invalidating tags on Redis <5 #43158
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
Conversation
<5 instead of <3? What about doDeleteYieldTags()? |
7539aea
to
64784d2
Compare
This new replication method is only required when the commands are non deterministic. It seems like the I've also updated the PR to handle any exception better. Currently, users get a PHP Error: "Cannot use object of type RedisException as array". After this PR, they'll get the actual redis exception. |
64784d2
to
61e00cd
Compare
61e00cd
to
dbe0cf7
Compare
For my understanding, when did you encounter |
We had this occur when invalidating caches in production. I'm not sure what would be the best way forward. If there is an error, nothing is invalidated. So simply logging the exception and retuning would probably not be correct either. |
Do you know what the |
Yeah, it was about the error in the lua script that is fixed in this PR:
So in theory, you will not get this exception. But I don't know anything about Redis, so I guess maybe there is something else in this script that breaks for e.g. Redis 4 or Redis 6 in the future? |
Can we call |
method more info https://redis.io/commands/eval#replicating-commands-instead-of-scripts and https://redis.io/commands/EVAL#scripts-with-deterministic-writes |
dbe0cf7
to
eb09827
Compare
Oh, didn't know about this helper method. I've updated the PR with your suggestions: any exception is now logged and not thrown, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(once psalm failure is fixed)
eb09827
to
fda7e7e
Compare
Thank you @wouterj. |
https://redis.io/commands/eval#replicating-commands-instead-of-scripts