-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] invalidating tags breaks after updating to symfony/cache 5.3.3 with Redis versions below 5.x #42126
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
Labels
Comments
Upgrading from which version that was not affected ? |
Would you mind sending a fix @jordikroon? |
fabpot
added a commit
that referenced
this issue
Sep 26, 2021
This PR was merged into the 4.4 branch. Discussion ---------- [Cache] Fix invalidating tags on Redis <5 | Q | A | ------------- | --- | Branch? | 5.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #42126 | License | MIT | Doc PR | - https://redis.io/commands/eval#replicating-commands-instead-of-scripts > Note: starting with Redis 5, the replication method described in this section (scripts effects replication) is the default and does not need to be explicitly enabled. > > Starting with Redis 3.2, it is possible to select an alternative replication method. Instead of replicating whole scripts, we can just replicate single write commands generated by the script. We call this script effects replication. > > To enable script effects replication you need to issue the following Lua command before the script performs a write: > > ``` > redis.replicate_commands() > ``` Commits ------- fda7e7e Fix Redis replication on Redis <5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
symfony/cache: 5.3.3
Description
We are using a Redis version prior to Redis 5.x, Redis 3.2 to be precise. After upgrading the symfony/cache package to 5.3.3 we are experiencing a problem with flushing tags.
How to reproduce
This will trigger an error.
To reveal the real exception, add to
symfony/cache/Adapter/RedisTagAwareAdapter.php:244
(afterEOLUA;
):Possible Solution
In order to enable script effects replication, you need to issue the following Lua command before any write operated by the script:
redis.replicate_commands()
The function returns true if the script effects replication was enabled, otherwise if the function was called after the script already called some write command, it returns false, and normal whole script replication is used
Another possible solution is to update ext-redis requirements to 5.x. Though this will be a BC break
Additional context
https://redis.io/commands/eval#replicating-commands-instead-of-scripts
The text was updated successfully, but these errors were encountered: