msi-core: the MSI that Magento left half-built
In MSI, reservations belong to the stock, not the source, so two stocks sharing a warehouse sell the same unit twice. What breaks, why it was never finished, and how msi-core fixes it.
Across several Magento stores I work with, the same pattern kept coming back: stock never added up. Sometimes the store sold what it didn’t have. Other times there were units in the warehouse the store wouldn’t sell, held by reservations that no longer belonged to any order. It got fixed by hand, and then it happened again.
After enough rounds I stopped treating it as a per-store problem. The problem was in Multi-Source Inventory (MSI), the inventory system Magento has shipped since 2.3. And the conclusion wasn’t to replace it: MSI is a good idea that was left half-built. That is how msi-core started, as a fork that picks up where MSI stopped, with new approaches.
The idea behind MSI is good
Before MSI, Magento kept one quantity per product in cataloginventory_stock_item and decremented it when an order was placed. MSI separates two concepts that model mixed together: the source, a physical place that holds goods, such as a warehouse or a store, and the stock, the sales view a channel has over one or more sources.
MSI also doesn’t decrement stock at order time. It writes a reservation, a row with a negative quantity in inventory_reservation, and the salable quantity is what is on hand minus what is reserved. When the order ships, the source is deducted and a compensation cancels the reservation. Appending rows instead of overwriting a counter records every movement and keeps what is committed apart from what sits in the warehouse.
It is a good design. The trouble lies in two decisions that stopped halfway.
Reservations live on the stock
An MSI reservation stores the SKU, the quantity, and the stock. It does not store which source the goods will leave from. A stock’s salable quantity is the on-hand quantity of its sources minus that stock’s reservations.
That works as long as each source belongs to a single stock. It stops working when two stocks share a warehouse, which is common when two websites sell the same physical goods:
- A warehouse holds 10 units and is assigned to stock A and stock B.
- Stock A sells all 10. Its reservations bring its salable quantity down to 0.
- Stock B doesn’t see those reservations. To B there are still 10 salable units, so it sells another 10.
- When the shipments go out, 20 units have been sold against 10 on hand.
This is not a bug you fix with configuration. It is the data model, and with several stocks over the same sources, the overselling grows with each channel’s traffic.
Reservations that never close
The other half of the symptom was blocked stock. A reservation is only canceled if something writes its compensation, and there are paths where that doesn’t happen, or happens too much:
- An order writes its reservation before it takes the payment and is saved. If the process dies in between, from running out of memory, a PHP-FPM timeout, or a restarted container, the reservation stays behind for an order that doesn’t exist.
- Nothing caps a release at what the order still has reserved. Two releases of the same order that overlap, such as a shipment saved while the order is being canceled, can give the same unit back twice, and that unit stays salable for good.
MSI ships commands to list inconsistencies and create compensations, but someone has to run them by hand, after somebody noticed the numbers were off.
The Default Stock is not a stock
The second finding came from reading the code. In MSI, stock 1, the Default Stock, doesn’t work like the others:
inventory_stock_1is a MySQL view overcataloginventory_stock_status, the table of the previous system.- The MSI indexer skips stock 1 on purpose.
- Composite product availability for that stock is computed by the legacy CatalogInventory indexer.
About fifty if ($stockId === $defaultStockId) branches spread across twenty modules keep the two worlds apart. Two data paths mean a bug fixed on one side of the if stays open on the other, and every new feature gets written and tested twice. No stock is truly independent of the old system either: manage_stock, backorders, and min_qty live in cataloginventory_stock_item for every stock, not just stock 1.
It’s not that nobody knew
The MSI roadmap has a Milestone 4: Remove dependencies to CatalogInventory module. Its tasks include assigning additional sources to the Default Stock, making it switchable, and fully replacing the CatalogInventory index. None of them is marked as done, and the page hasn’t been edited since February 2020. “Reservation on the level of Source” sits further down, in the backlog, with no milestone.
The issues tell the same story from the side of those affected. #2727, opened in November 2019, describes two stores sharing inventory and selling more than they have. It is still open, with 16 comments. #3247, from 2020, asks to move source-level reservations into Milestone 4, links five other issues asking for the same thing, and sums it up in one sentence: “The link between product and source was suddenly lost when MSI added reservations.”
MSI isn’t abandoned. Adobe keeps merging internal fixes, the latest on October 22, 2026. What stopped is building it: at the end of October 2026, the repository has 38 open pull requests, the oldest from March 2020, and four have been merged since January 2025. The part that was missing for MSI to become Magento’s only inventory system never got done.
What msi-core does
msi-core is a fork of magento/inventory based on the MSI of Magento 2.4.9 and synced with its develop branch. It keeps the Magento_Inventory* module names, the namespaces, and the service contracts, and uses Composer to replace the 73 MSI modules that ship with Magento, including under Mage-OS package names.
Source-level reservations
It is opt-in and off by default (cataloginventory/source_reservations/enabled). Each sales reservation is split into one row per source, allocated across the stock’s enabled sources by priority. The reservation then lowers the salable quantity of every stock sharing that source, which is exactly the gap in the example. Shipment, cancellation, and credit memo compensations land on the sources the order reserved at, whichever source actually ships.
Locking changes too. MSI serializes orders per stock; msi-core does it per (sku, source). Two orders on different stocks that share a warehouse wait for each other, and orders with no source in common run in parallel. The lock lasts only as long as writing the reservation takes, 8 to 27 ms in measurements, not the payment or the order save.
A reservation ledger that repairs itself
- Every release is capped at what the order still reserves. That balance is kept per order, SKU, and source, and locked for the length of the transaction, so two releases of the same order can no longer give back the same unit.
- A reconciliation pass, run by hand or by cron, compensates finished orders left with open reservations and releases those of orders that were never saved.
- Oversell detection raises an alert when a source falls below what it has already committed. It never blocks a sale: physical stock stays authoritative.
bin/magento inventory:reservation:reconcile --dry-run
bin/magento inventory:reservation:detect-oversell
One inventory system
Stock 1 is indexed, configured, edited, and deleted like any other. Per-SKU configuration moves to inventory_stock_item_configuration, and MSI stops reading and writing cataloginventory_stock_item and cataloginventory_stock_status. Those tables are kept frozen, because 42 core modules depend on Magento_CatalogInventory, and the legacy read contracts, such as StockRegistryInterface, are served from MSI. Code that goes through them doesn’t change.
What comes on top
On that single code path, msi-core adds salable quantity broken down by source in the admin, a history of every stock change, a storefront availability panel, and detection of writes that still target the frozen tables. It also carries five pull requests that are still open in magento/inventory, crediting their authors.
What it costs
msi-core is not a package swap. It is a schema migration: it adds tables, migrates data, and stops writing two core tables.
- It needs a maintenance window and there is no way back. Going back to MSI means restoring the backup.
- It breaks code that reads
cataloginventory_stock_itemorcataloginventory_stock_statuswith raw SQL. Magento’s own readers are already redirected; an extension that does this has to go through the service contracts. - The
inventory.reservations.updateSalabilityStatusconsumer has to be running. Without it, the index falls behind and the store keeps selling what is already committed. - It supports Magento 2.4.9 and Mage-OS 3.x, on PHP 8.3 to 8.5.
It is a derivative of magento/inventory distributed under AFL-3.0, not affiliated with Adobe.
Try it
composer config repositories.msi-core vcs https://github.com/jeanmarcos-dev/msi-core
composer require "jeanmarcos/msi-core:^1.0"
Before running setup:upgrade on a store with data, read Upgrade from Magento MSI. The full documentation lives at jeanmarcos-dev.github.io/msi-core, and issues and pull requests are welcome in the repository.
Closing
MSI had the right idea: separate where the goods are from who sells them, and record movements instead of overwriting a counter. Building it stopped short of the last stretch, a reservation that knows which source it leaves from and a Default Stock that stops being the exception. msi-core picks up from there and adds approaches that roadmap never had: a reservation ledger that repairs itself, salable quantity broken down by source, and a history of every stock change. It would be a shame to let a good idea die; I would rather keep building it.