MDVA-30112: large number reservation inconsistencies

The MDVA-30112 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 Quality Patches Tool (QPT) 1.0.8 is installed. Please note that the issue was fixed in Adobe Commerce version 2.4.2.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce on cloud infrastructure 2.3.5

Compatible with Adobe Commerce versions:

  • Adobe Commerce on-premises and Adobe Commerce on cloud infrastructure 2.3.4 - 2.3.5-p2, 2.4.0 - 2.4.1
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

The bunch-size value is the value for how many orders to load at once. When there are more orders than this value, Adobe Commerce considers the orders with pending status to be inconsistencies.

NOTE
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: inventory inconsistency issues in our support knowledge base.

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:

  1. Run the following command in the CLI to resolve the inconsistencies:

    code language-none
    bin/magento inventory:reservation:list-inconsistencies -r | bin/magento inventory:reservation:create-compensations
    
  2. Place three orders:

    • Assign each a single product.
    • Use the Check/Money Order payment method, so the order status will be “pending”.
  3. You can see three records with -1 quantity in the inventory_reservation table. Run the following command in the CLI to see any inconsistencies:

    code language-none
    bin/magento inventory:reservation:list-inconsistencies
    

    This returns no results, which is correct.

  4. Run the following command in the CLI:

    code language-none
    Execute bin/magento inventory:reservation:list-inconsistencies      --bunch-size 1
    

    You see the “pending” status orders are shown as inconsistencies.

  5. Run the following command in the CLI:

    code language-none
    bin/magento inventory:reservation:list-inconsistencies      -r --bunch-size 1 | bin/magento inventory:reservation:create-compensations
    

Expected results:

Adobe Commerce 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, Adobe Commerce considers orders with “pending” status as inconsistencies and adds multiple inconsistency resolving records for the same order.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to Patches available in QPT in our developer documentation.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a