Open adarshkhatri opened 1 year ago
Hi @adarshkhatri. Thank you for your report.
To speed up processing of this issue, make sure that you provided sufficient information.
Add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
Preconditions (*)
magento/module-inventory-cache
What is happening?
MSI has this function in place as
around
method. Which gets the product IDs frominventory_stock_ID
table before and after. Pay attention toaround
method here. https://github.com/magento/inventory/blob/790c7ff267be04be6cc57f4502e005bec560a2b3/InventoryCache/Plugin/InventoryIndexer/Indexer/Stock/Strategy/Sync/CacheFlush.php#L51Then, it also has this function as
after
method to index grouped products, which happens after the above function (around) runs, meaning at this time, the system has already sent all the grouped product IDs to clear the cache. https://github.com/magento/inventory/blob/790c7ff267be04be6cc57f4502e005bec560a2b3/InventoryGroupedProductIndexer/Plugin/InventoryIndexer/Indexer/Stock/Strategy/Sync/ReindexFullPlugin.php#L43Explanation
What this means?
If I have 200 grouped products in my system, every time a single product's (not related to grouped whatsoever) sources deleted/added, then it will send the cache clear request for this product PLUS that 200 grouped products.
Steps to reproduce (*)
bin/magento indexer:reindex inventory
Expected result (*)
Actual result (*)
Proposed solution:
https://github.com/magento/inventory/pull/3402