-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Prevent flushing same tags several times #29885
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
Conversation
Hi @siimm. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
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. 🕙 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 |
@magento create issue |
Hi @siimm. Thank you for your collaboration. Nice catch! Thank you! |
@magento run all tests |
lib/internal/Magento/Framework/Indexer/Test/Unit/CacheContextTest.php
Outdated
Show resolved
Hide resolved
The risk was set to |
@magento run all tests |
@magento run all tests |
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.
❌ QA Failed
Hello @siimm
Looks like the changes provided in this PR do not solve the original issue. I'm getting the same Output before and after switching to the PR
Please, see the Manual testing scenario
- Go to System - Index Management
- Select All Indexers and change the Actions to Update by Schedule
- Go to Catalog - Categories, and change the Category Name for at least two Categories, for example
- Go to Catalog - Products and change the Price, Quantity, Weight for at least two Products
- Run
bin/magento cron:run --group=index --bootstrap=standaloneProcessStarted=1
- Observe the output of
\Magento\Framework\Indexer\CacheContext::getIdentities
Pull Request state was updated. Re-review required.
@engcom-Bravo |
✔️ QA Passed Further investigation discovered that the changes provided in this PR, fix the original issue Manual Testing scenario
|
@rogyar @BarnyShergold Can you please review the PR again? Thank you |
* @param array $expected | ||
* @dataProvider getTagsDataProvider | ||
*/ | ||
public function testUniqueTags($tagsData, $expected) |
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.
Just a recommendation for the future to use type hinting whenever it's possible. It's a very useful habit in PHP 7.x
Hi @rogyar, thank you for the review. |
Hi @siimm, thank you for your contribution! |
Description (*)
If a product is saved in admin - changed name, price, stock, weight, added category to product. Then after indexing, the same tags are flushed several times.
Here is an example of default Magento behaviour on cleaning cache tags during indexing (different arrays belong to different indexers cleaning the cache):
Here is the same output with the changes applied:
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Together with #29699 it will probably reduce the amount of cache flushing significatly
Contribution checklist (*)
Resolved issues: