Inventory indexer triggers Price re-indexation
Open
Nobody has claimed this yet.
Bug
Performance
- Dominant language
- PHP
- Stars
- 357
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Description
The deadlock might be related to this one:
https://github.com/magento/inventory/blob/1.2-develop/InventoryCatalog/etc/di.xml#L25
Any idea why the price gets reindexed after every inventory update?
That means that the price indexer will run after the placement of each order, in sync.
<type name="Magento\InventoryIndexer\Indexer\SourceItem\SourceItemIndexer">
<plugin name="priceIndexUpdater" type="Magento\InventoryCatalog\Plugin\InventoryIndexer\Indexer\SourceItem\PriceIndexUpdater"/>
</type>
The change was added in the scope of the Bundle product support story.
The existence of this plugin looks excessive and should be investigated. Dependencies between inventory and price indexes should be avoided.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with InventoryCatalog/etc/di.xml at the SourceItemIndexer declaration and inspect the PriceIndexUpdater plugin referenced there. Trace why inventory updates invoke price reindexing, then verify that inventory updates no longer trigger unnecessary synchronous price indexing and that the indexer dependency is removed or justified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100