Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpFoundation][Cache][Messenger] Replace redis "DEL" commands with "UNLINK"#37993
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedAug 31, 2020
The method is also used insrc/Symfony/Component/Cache/Traits/RedisTrait.php and insrc/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php Would you advise updating these also? If yes, can you please update the PR? Can you please add a note in the UPGRADE-5.2 file, in each component's section? |
fabpot commentedSep 6, 2020
@jonashrem Still interested in finishing this PR? |
jonashrem commentedSep 6, 2020
@fabpot yes, I was just a bit busy the last days. I still plan looking into this. |
nicolas-grekas commentedSep 9, 2020
/cc@andrerom btw, any opinion about the proposed bump to Redis >= 4? |
andrerom commentedSep 11, 2020
For master that should be ok from my POV 👍 Make sure to mention it clearly in release notes though, not everyone expect bumps in requirements in minor releases. |
jonashrem commentedSep 13, 2020
I replaced the other occurrences. For the failing auto-tests, is it possible the test instance is still using redis 3? |
nicolas-grekas commentedSep 14, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The CI runs Redis 6 apparently, but the failures are helpful: Would you like to send a PR there to add the command? Also, can't we add a command "manually" on our side in order to teach Predis about it? Last note here: don't forget to add a note in the UPGRADE-5.2 file, in each component's section. Thanks. |
nicolas-grekas commentedSep 24, 2020
@jonashrem friendly ping. Are you OK with my previous comment? |
jonashrem commentedSep 24, 2020
yes, that's fine. I will look into this further if it's possible to set this manually. |
nicolas-grekas left a comment
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.
I updated the code to fallback to DEL when UNLINK is not available.
I also submittedpredis/predis#666 to add UNLINK to Predis.
Ready on my side.
jonashrem commentedSep 27, 2020
oh, that's a very good idea. In this case we don't even loose backwards compatibility with redis 3.x. Very nice. So for my understanding when the Integration tests run through there is nothing left to do here? |
nicolas-grekas commentedSep 27, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Correct, there should be nothing else to do here. Now waiting for the CI to be green for the components. |
nicolas-grekas commentedSep 27, 2020
Thank you@jonashrem. |
jonashrem commentedSep 27, 2020
Thanks, as well. And sorry you had to do so much in the end by yourself. |
Uh oh!
There was an error while loading.Please reload this page.
This PR replaces DEL Command with UNLINK command.
Details about UNLINK can be found herehttps://redis.io/commands/unlink .
As noticed hereredis/redis#1748 (comment) this will not change the behavior.
As there is no check of Redis version included, it will break Redis Versions < 4.0 through.
As Redis 4.0 was released on 2017-07-14 and Redis 3 went EOL with the Redis 5 on 2018-10-17, I don't expect this being an issue.
With redis 4.0 there is a new unlink command intruded (https://redis.io/commands/unlink ) with is a smarter version of del() as it deletes keys in O(1) and frees the memory in background.
See alsohttp://antirez.com/news/93 andredis/redis#1748
This won't change the behavior but only the memory usage as clarified here:redis/redis#1748 (comment) which shouldn't be an issue with most Magento instances
With this, I recommend replacing DEL operations with UNLINK operations.