Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
nicolas-grekas merged 1 commit intosymfony:masterfromjonashrem:patch-1
Sep 27, 2020

Conversation

@jonashrem
Copy link
Contributor

@jonashremjonashrem commentedAug 30, 2020
edited by nicolas-grekas
Loading

QA
Branch?master
Bug fix?no
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

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.

@nicolas-grekas
Copy link
Member

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?
I'm fine with dropping support for Redis 3 on 5.2.

Can you please add a note in the UPGRADE-5.2 file, in each component's section?

@fabpot
Copy link
Member

@jonashrem Still interested in finishing this PR?

@jonashrem
Copy link
ContributorAuthor

@fabpot yes, I was just a bit busy the last days. I still plan looking into this.

@nicolas-grekasnicolas-grekas changed the titlereplace redis "DEL" Commands with "UNLINK"[HttpFoundation][Cache][Messenger]replace redis "DEL" Commands with "UNLINK"Sep 8, 2020
@nicolas-grekasnicolas-grekas changed the title[HttpFoundation][Cache][Messenger]replace redis "DEL" Commands with "UNLINK"[HttpFoundation][Cache][Messenger] Replace redis "DEL" Commands with "UNLINK"Sep 8, 2020
@nicolas-grekasnicolas-grekas changed the title[HttpFoundation][Cache][Messenger] Replace redis "DEL" Commands with "UNLINK"[HttpFoundation][Cache][Messenger] Replace redis "DEL" commands with "UNLINK"Sep 8, 2020
@nicolas-grekas
Copy link
Member

/cc@andrerom btw, any opinion about the proposed bump to Redis >= 4?

@andrerom
Copy link

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 reacted with thumbs up emoji

@jonashrem
Copy link
ContributorAuthor

I replaced the other occurrences.

For the failing auto-tests, is it possible the test instance is still using redis 3?

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedSep 14, 2020
edited
Loading

For the failing auto-tests, is it possible the test instance is still using redis 3?

The CI runs Redis 6 apparently, but the failures are helpful:Predis doesn't know about the unlink command. Looking at the code, that's the case:https://github.com/predis/predis/tree/main/src/Command/Redis

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
Copy link
Member

@jonashrem friendly ping. Are you OK with my previous comment?

@jonashrem
Copy link
ContributorAuthor

@jonashrem friendly ping. Are you OK with my previous comment?

yes, that's fine. I will look into this further if it's possible to set this manually.

Copy link
Member

@nicolas-grekasnicolas-grekas left a 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 reacted with thumbs up emoji
@jonashrem
Copy link
ContributorAuthor

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
Copy link
Member

nicolas-grekas commentedSep 27, 2020
edited
Loading

So for my understanding when the Integration tests run through there is nothing left to do here?

Correct, there should be nothing else to do here. Now waiting for the CI to be green for the components.

jonashrem reacted with thumbs up emoji

@nicolas-grekas
Copy link
Member

Thank you@jonashrem.

@nicolas-grekasnicolas-grekas merged commitd8d90b0 intosymfony:masterSep 27, 2020
@jonashrem
Copy link
ContributorAuthor

Thanks, as well. And sorry you had to do so much in the end by yourself.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@srozesrozeAwaiting requested review from sroze

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

6 participants

@jonashrem@nicolas-grekas@fabpot@andrerom@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp