Closed
Description
This issue is automatically created based on existing pull request: #29885: Prevent flushing same tags several times
Preconditions (*)
- Magento 2.4-develop
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):
root@c119d6a06fcb:/var/www/m2clean$ bin/magento cron:run --group=index --bootstrap=standaloneProcessStarted=1
Array
(
)
Array
(
)
Array
(
<0] => cat*p*1
[1] => cat*c*2
[2] => cat*c*1
[3] => cat*c*2
[4] => cat*c*3
[5] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*c*2
[2] => cat*c*1
[3] => cat*c*2
[4] => cat*c*3
[5] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*c*2
[2] => cat*c*1
[3] => cat*c*2
[4] => cat*c*3
[5] => cat*c*1
)
Array
(
[0] => cat*p*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*c*2
[5] => cat*c*1
[6] => cat*c*2
[7] => cat*c*3
[8] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*c*2
[5] => cat*c*1
[6] => cat*c*2
[7] => cat*c*3
[8] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*p*1
[5] => cat*c*2
[6] => cat*c*1
[7] => cat*c*2
[8] => cat*c*3
[9] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*p*1
[5] => cat*c*2
[6] => cat*c*1
[7] => cat*c*2
[8] => cat*c*3
[9] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*p*1
[5] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[8] => cat*c*2
[9] => cat*c*3
[10] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*p*1
[5] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[8] => cat*c*2
[9] => cat*c*3
[10] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*p*1
[5] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[8] => cat*c*2
[9] => cat*c*3
[10] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*p*1
[5] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[8] => cat*c*2
[9] => cat*c*3
[10] => cat*c*1
)
Array
(
[0] => cat*p*1
[1] => cat*p*1
[2] => cat*p*1
[3] => cat*p*1
[4] => cat*p*1
[5] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[8] => cat*c*2
[9] => cat*c*3
[10] => cat*c*1
)
{code}
Here is the same output with the changes applied:
{code}
root@c119d6a06fcb:/var/www/m2clean$ bin/magento cron:run --group=index --bootstrap=standaloneProcessStarted=1
Array
(
)
Array
(
)
Array
(
[0] => cat*p*1
[1] => cat*c*2
[2] => cat*c*1
[4] => cat*c*3
)
Array
(
[0] => cat*p*1
[1] => cat*c*2
[2] => cat*c*1
[4] => cat*c*3
)
Array
(
[0] => cat*p*1
[1] => cat*c*2
[2] => cat*c*1
[4] => cat*c*3
)
Array
(
[0] => cat*p*1
)
Array
(
[0] => cat*p*1
[4] => cat*c*2
[5] => cat*c*1
[7] => cat*c*3
)
Array
(
[0] => cat*p*1
[4] => cat*c*2
[5] => cat*c*1
[7] => cat*c*3
)
Array
(
[0] => cat*p*1
[5] => cat*c*2
[6] => cat*c*1
[8] => cat*c*3
)
Array
(
[0] => cat*p*1
[5] => cat*c*2
[6] => cat*c*1
[8] => cat*c*3
)
Array
(
[0] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[9] => cat*c*3
)
Array
(
[0] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[9] => cat*c*3
)
Array
(
[0] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[9] => cat*c*3
)
Array
(
[0] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[9] => cat*c*3
)
Array
(
[0] => cat*p*1
[6] => cat*c*2
[7] => cat*c*1
[9> => cat*c*3
)
Steps to reproduce (*)
- 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 return of
\Magento\Framework\Indexer\CacheContext::getIdentities
Expected result (*)
Actual Result (*)
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Failed. Automatic verification of issue format is failedGate 4. Acknowledged. Issue is added to backlog and ready for developmentMay be fixed according to the position in the backlog.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchAffects non-critical data or functionality and does not force users to employ a workaround.
Type
Projects
Status
Done