Skip to content
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

Fix usage of EAV cache type #31264

Merged

Conversation

ilnytskyi
Copy link
Contributor

@ilnytskyi ilnytskyi commented Dec 11, 2020

Description (*)

This PR fixes usage of EAV cache type in some places

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Different frontend type can be set to EAV cache type without defining additional eav frontend type introduced by configured_eav_cache virtual type
    UPD: looks like it's bigger problem I see many other classes do not use \Magento\Eav\Model\Cache\Type and they can't be fixed due to Magento\Framework\App\CacheInterface and Magento\Framework\Cache\FrontendInterface incompatibilities.
    It should be figured out and fixed in different PR/issue.
  2. Class \Magento\Catalog\Plugin\Model\ResourceModel\Config checks if EAV cache enabled but store data in default cache type. This PR fixes missed configuration

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Fix usage of EAV cache type #32322: Fix usage of EAV cache type

@m2-assistant
Copy link

m2-assistant bot commented Dec 11, 2020

Hi @ilnytskyi. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

@ilnytskyi
Copy link
Contributor Author

@magento run all tests

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 I don't see any critical issues there.
Let's wait for Static Tests to finish, but the only issue is code style to adjust.

app/code/Magento/Eav/Model/Cache/Type.php Outdated Show resolved Hide resolved
@lbajsarowicz
Copy link
Contributor

@magento run all tests

@ilnytskyi
Copy link
Contributor Author

I think that in
\Magento\Catalog\Plugin\Model\ResourceModel\Config
Wrong cache interface used or something
will try to figure out how to fix it.

@ilnytskyi ilnytskyi force-pushed the fix-eav-cache-type branch 2 times, most recently from 5f17403 to fc04ddb Compare December 12, 2020 08:25
@ilnytskyi
Copy link
Contributor Author

@magento run all tests

@ilnytskyi
Copy link
Contributor Author

ilnytskyi commented Dec 12, 2020

I decided to open PR after I saw this change. But now i see it's a bit bigger problem.

4b66b00#diff-b3fae67f1de2de925eb945c0dac8213f1f6f817053039c4d15eb698a338a3ac3

@vzabaznov could you take a look at this issue and help us figure out what to do?

I our project we use different cache backends for different cache types. Mainly to reduce data transfer from redis, and isolate containers in ASG and with 2.4.1 magento we faced the issue, that in RemoteSynchronized cache not all EAV keys were stored in containers. The first issue was the necessity to use a separate frontend with the name eav. And the other issue that, some classes still did not use proper cache types to store the date, e.g. Magento\Catalog\Plugin\Model\ResourceModel\Config

Probably the issue was not noticed since devs don't usually use this approach to point some caches to different storages, or do not debug if the keys actually come from proper storage.

This is serious issue because these docs pages do not really represent what actually going inside the app.
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/cache/partial-caching/database-caching.html and
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/cache/partial-caching/database-caching.html#mage-cache-db-env

@ilnytskyi
Copy link
Contributor Author

@maghamed could you explain some differences between
Magento\Framework\Cache\FrontendInterface and Magento\Framework\App\CacheInterface and why configured_eav_cache virtual type used for EAV cache instead of Magento\Eav\Model\Cache\Type ?

As a dev I do not see point to define EAV cache type in XML https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Eav/etc/cache.xml and then use different classes that implement different interfaces to actually work with the cache storage.

@gabrieldagama gabrieldagama added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Dec 15, 2020
@engcom-Hotel engcom-Hotel self-assigned this Dec 23, 2020
@engcom-Hotel
Copy link
Contributor

@magento run WebAPI Tests

1 similar comment
@engcom-Hotel
Copy link
Contributor

@magento run WebAPI Tests

@lbajsarowicz
Copy link
Contributor

Sorry, @engcom-Hotel - I'm no longer Maintainer.
@ihor-sviziev might be able to help

@engcom-Dash
Copy link
Contributor

@magento run all tests

@lbajsarowicz lbajsarowicz removed their assignment Nov 12, 2024
@engcom-Dash
Copy link
Contributor

@magento run all tests

@hostep hostep removed their assignment Nov 12, 2024
@engcom-Dash engcom-Dash self-assigned this Nov 12, 2024
@engcom-Dash
Copy link
Contributor

@magento run Functional Tests B2B

@engcom-Dash
Copy link
Contributor

engcom-Dash commented Nov 13, 2024

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 830a2ad into magento:2.4-develop Dec 4, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Catalog Component: Eav Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept Project: Community Picked PRs upvoted by the community Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Status: Recently Merged
Development

Successfully merging this pull request may close these issues.

[Issue] Fix usage of EAV cache type