magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.57k stars 9.32k forks source link

Magento doesn't work with Redis in cluster mode #39224

Open speller opened 1 month ago

speller commented 1 month ago

Preconditions and environment

Steps to reproduce

Run cache clean command

Expected result

It works properly

Actual result

Error

Error cleaning cache by mode matchingTag: CROSSSLOT Keys in request don't hash to the same slot
#0 /magento/vendor/colinmollenhour/cache-backend-redis/Cm/Cache/Backend/Redis.php(1010): Zend_Cache::throwException('Error cleaning ...', Object(CredisException))
#1 /magento/vendor/magento/zend-cache/library/Zend/Cache/Core.php(465): Cm_Cache_Backend_Redis->clean('matchingTag', Array)\n#2 /magento/vendor/magento/framework/Cache/Core.php(92): Zend_Cache_Core->clean('matchingTag', Array)
#3 /magento/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(103): Magento\\Framework\\Cache\\Core->clean('matchingTag', Array)\n#4 /magento/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(89): Magento\\Framework\\Cache\\Frontend\\Adapter\\Zend->clean('matchingTag', Array)
#5 /magento/vendor/magento/framework/Cache/Frontend/Decorator/TagScope.php(76): Magento\\Framework\\Cache\\Frontend\\Decorator\\Bare->clean('matchingTag', Array)
#6 /magento/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(89): Magento\\Framework\\Cache\\Frontend\\Decorator\\TagScope->clean('matchingTag', Array)
#7 /magento/vendor/magento/framework/Cache/Frontend/Decorator/Logger.php(47): Magento\\Framework\\Cache\\Frontend\\Decorator\\Bare->clean('matchingTag', Array)
#8 /magento/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(89): Magento\\Framework\\Cache\\Frontend\\Decorator\\Logger->clean('matchingTag', Array)
#9 /magento/vendor/magento/framework/App/Cache/Type/AccessProxy.php(107): Magento\\Framework\\Cache\\Frontend\\Decorator\\Bare->clean('matchingTag', Array)
#10 /magento/vendor/magento/framework/Cache/Frontend/Decorator/Bare.php(89): Magento\\Framework\\App\\Cache\\Type\\AccessProxy->clean('matchingTag', Array)
#11 /magento/vendor/magento/framework/Cache/Frontend/Decorator/TagScope.php(76): Magento\\Framework\\Cache\\Frontend\\Decorator\\Bare->clean('matchingTag', Array)
#12 /magento/vendor/magento/module-page-cache/Model/Cache/Type.php(52): Magento\\Framework\\Cache\\Frontend\\Decorator\\TagScope->clean('matchingTag', Array)
#13 /magento/vendor/magento/module-page-cache/Observer/FlushAllCache.php(66): Magento\\PageCache\\Model\\Cache\\Type->clean()

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 month ago

Hi @speller. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.

hostep commented 1 month ago

I'm not sure this should be reported to Magento, maybe a better place to report it would be to one of the colinmollenhour redis repo's that deal with the communication from Magento to Redis.

I think there are already some (old) attempts at adding that functionality, just posting some links, I'm not familiar with the technology so no idea if these make sense for your request:

speller commented 1 month ago

@hostep the referenced PR suggests adding a new client class and Magento should also add support for it. So some work on the Magento side is also required.

JacobBrownAustin commented 1 month ago

FYI, I'm already working on a pull request for the session part of it of it (not the cache backend). It's a simple PR from the Magento side since it just exposes the new configuration options for clusters to the PR I've made to the php-redis-session-abstract. I'm not working at all on the cache part at all, so I can't comment on that.

m2-assistant[bot] commented 3 weeks ago

Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Hotel commented 3 weeks ago

Hello @speller,

Thanks for the report and collaboration!

We have tried to reproduce the issue in the vanilla Magento 2.4-develop branch with Redis in cluster mode. The issue seems reproducible for us.

Hence confirming the issue.

Thanks

github-jira-sync-bot commented 3 weeks ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13291 is successfully created for this GitHub issue.

m2-assistant[bot] commented 3 weeks ago

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

devops-digitalsilk commented 5 days ago

We have the same issue with Cluster mode enabled, doesn't even to be serverless.