The MDVA-30112 Magento patch solves the issue where you have an unexpectedly large number of reservation inconsistencies in the inventory_reservation
table. Reservation inconsistencies include unregistered open orders and complete orders that are not registered. This patch is available when the Magento Quality Patch (MQP) tool v.1.0.8 is installed. Please note that the issue will be fixed in Magento version 2.4.2.
Affected products and versions
- The patch was designed for Magento Commerce Cloud 2.3.5.
- The patch is also compatible with Magento Commerce and Magento Commerce Cloud 2.3.4 - 2.3.5-p2, 2.4.0 - 2.4.1.
Note: the patch can be applicable to other versions. To check if the patch is compatible with your Magento version, run ./vendor/bin/magento-patches status
.
Issue
The bunch-size value is the value for how many orders to load at once. When there are more orders than this value, Magento considers the orders with pending status to be inconsistencies.
There is a patch MDVA-33281 that fixes three other inventory inconsistency issues. This includes a PHP Fatal error when running bin/magento inventory:reservation:list-inconsistencies
in the CLI. Another issue that is fixed is duplicate data in the inconsistencies list. Also, the issue where a reservation is created before order placed (previous realization based on reservation after order placed). For the solution, refer to MDVA-33281 Magento patch: inventory inconsistency issues.
Prerequisites:
You run the following command in the CLI to list reservation inconsistencies in the inventory_reservation
table:
magento inventory:reservation:list-inconsistencies
You see an unexpectedly large number of reservation inconsistencies and/or the command never completes.
Steps to reproduce:
- Run the following command in the CLI to resolve the inconsistencies:
bin/magento inventory:reservation:list-inconsistencies -r | bin/magento inventory:reservation:create-compensations
- Place three orders:
- Assign each a single product.
- Use the Check/Money Order payment method, so the order status will be "pending".
- You can see three records with -1 quantity in the
inventory_reservation
table. Run the following command in the CLI to see any inconsistencies:bin/magento inventory:reservation:list-inconsistencies
This returns no results, which is correct.
- Run the following command in the CLI:
Execute bin/magento inventory:reservation:list-inconsistencies --bunch-size 1
You see the "pending" status orders are shown as inconsistencies.
- Run the following command in the CLI:
bin/magento inventory:reservation:list-inconsistencies -r --bunch-size 1 | bin/magento inventory:reservation:create-compensations
Expected results:
Magento should not resolve inconsistencies of "pending" status orders. The stocks inconsistencies should be resolved for orders with 'complete', 'closed', and 'canceled' statuses.
Actual results:
When there are orders more than the specified bunch-size value, Magento considers orders with "pending" status as inconsistencies and Magento adds multiple inconsistency resolving records for same order.
Apply the patch
For instructions on how to apply an MQP patch, use the following links depending on your Magento product:
- Magento Commerce: DevDocs Apply patches using Magento Quality Patches Tool.
- Magento Commerce Cloud: DevDocs Upgrades and Patches > Apply patches.
Related reading
To learn more about Magento Quality Patches, refer to:
- Magento Quality Patches released: a new tool to self-serve quality patches.
- Check if patch is available for your Magento issue using Magento Quality Patches.
For info about other patches available in MQP tool, refer to the Patches available in MQP tool section.