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.53k stars 9.31k forks source link

Magento2 don't work with redis in cluster mode #35140

Closed ByJacob closed 1 year ago

ByJacob commented 2 years ago

Preconditions (*)

  1. Magento 2.4.3
  2. Redis 6 configured in cluster mode (or use AWS ElastiCache in cluster mode with 3 masters)

Steps to reproduce (*)

  1. Run magento
  2. Configure redis config and cache (redis is configured in cluster mode)

Expected result (*)

  1. All ./bin/magento comands works correct and return status code 0
  2. Cache in redis works

Actual result (*)

  1. magento command returns status code 1 with error text, example MOVED 2482 122[IP:PORT]
  2. Cache don't work

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

Hi @ByJacob. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 2 years ago

Hi @engcom-Delta. 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:

magenx commented 2 years ago

this page explain everything

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.Redis-RedisCluster.html

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/GettingStarted.ConnectToCacheNode.html

m2-assistant[bot] commented 2 years 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 2 years ago

Hello @ByJacob,

I hope your problem has been solved by going through the documentation link in this comment.

Thanks

ByJacob commented 2 years ago

Unfortunately, that does not solve the problem. The documentation only shows the different methods for configuring ElastiCache and how to connect to it when Cluster Mode is turned off and on. My probleme is that I cannot configure redis backend when redis is running with cluster mode enabled.

Without special cluster handling, the master switches during writing, which the current php code interprets as an error. For example, in the redis-cli command, use the special -c flag so that it can properly communicate with the redis cluster.

engcom-Hotel commented 2 years ago

Hello @ByJacob,

Thanks for the confirmation!

We have tried to reproduce the issue by following the Redis cluster documentation here. And after setting up the Redis cache by following the Magento docs, we are able to reproduce the issue in the latest Magento 2.4-develop branch.

Please have a look at the below screenshot for reference:

image

Hence confirming this issue.

Thanks

github-jira-sync-bot commented 2 years ago

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

m2-assistant[bot] commented 2 years 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.

engcom-Hotel commented 2 years ago

Hello @ByJacob,

We have further investigated this issue and we have integrated the Redis cluster in app/etc/env.php. (Attached is the screenshot for the same):

image

Below are the points that come up in the investigation:

image image image

Hence the issue is not related to the Magento core library.

Thanks

ByJacob commented 2 years ago

Hello, So one question, why was colinmollenhour/Cm_Cache_Backend_Redis used instead of the more elaboratepredis/predis, since predis supports almost all redis functionality? And another question, what does Component: Bundled Extension mean. Waiting as the library to have this functionality? If so, why not use predis which has php 8.1 support already (https://github.com/predis/predis/commit/acb2460f4c023cef319afe9a68bb12d391707912)?

engcom-Hotel commented 2 years ago

Hello @ByJacob,

Hence this issue is not related to Magento core code, so I suggest you refer to the Community Forums or Magento Stack Exchange for technical questions, feature requests, etc.

Thanks

robsoned commented 2 years ago

As on the way it's implemented right now, it causes an issue to integrate with redis, a system requirement to run the application on production with good performance. With that said, why this issue would not be related to Magento core code?

engcom-Hotel commented 1 year ago

Hello,

The related issue has been fixed now and is unable to reproduce on the latest development branch i.e. 2.4-develop. Hence closing this ticket.

Thanks

vishwanathkharabe commented 1 year ago

Hi @engcom-Hotel , Earlier you were able to reproduce this issue, https://github.com/magento/magento2/issues/35140#issuecomment-1060242326 but in your latest comment https://github.com/magento/magento2/issues/35140#issuecomment-1343940398 you said it is fixed. Can we know what changes you made to fix this, is there any PR ? Thanks!

devops-digitalsilk commented 1 month ago

I still have the same issue, version 2.4.3-p3. Configuration the cluster always returning MOVED in the first line of magento bin composer.