magento / inventory

Magento Inventory Project (a.k.a MSI)
Open Software License 3.0
337 stars 248 forks source link

`ReindexAfterSourceItemsDeletePlugin` triggers a full stock reindex for a single source removal #2936

Open cmacdonald-au opened 4 years ago

cmacdonald-au commented 4 years ago

Summary

When removing products from sources, a full stock reindex is triggered, courtesy of ReindexAfterSourceItemsDeletePlugin.

This may make sense when doing a mass import ("Delete"), but causes performance issues and table contention during standard product maintenance, (reindexing all stocks for a source when one product has changed does not make sense).

Examples

Proposed solution

Convert ReindexAfterSourceItemsDeletePlugin to call the sourceItemIndexer

cmacdonald-au commented 4 years ago

Related to https://github.com/magento/inventory/issues/2933 . This issue causes excessive pressure on the indexing tables/processes and when subjected to a high change rate of source-item assignments