ACSD-64118: Concurrent product save requests for same product cause data inconsistency and duplicate entries
The ACSD-64118 patch fixes the issue where concurrent requests to save and update the same product result in data inconsistency or duplicated products. This patch is available when the Quality Patches Tool (QPT) 1.1.65 is installed. The patch ID is ACSD-64118. Please note that this issue is scheduled to be fixed in ÃÛ¶¹ÊÓÆµ Commerce 2.4.9.
Affected products and versions
The patch is created for ÃÛ¶¹ÊÓÆµ Commerce version:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.5-p7
Compatible with ÃÛ¶¹ÊÓÆµ Commerce versions:
- ÃÛ¶¹ÊÓÆµ Commerce (all deployment methods) 2.4.4 - 2.4.6-p10
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
Concurrent requests to save and update the same product result in data inconsistency or duplicated products.
Steps to reproduce:
-
Set up multi-process for consumers in
env.php
:code language-none 'multiple_processes' => array ( 'async.operations.all' => 4, ),
-
Add an additional store and a new storeview to the main website.
-
Send a bulk API request to the default storeview endpoint
/rest/default/async/bulk/V1/products
with the following payload to create a product:code language-none [ { "product": { "sku": "Test_Prod", "name": "Test Product", "attribute_set_id": 4 } } ]
-
Use the same payload to send a bulk API request to the new storeview endpoint
/rest/store/async/bulk/V1/products
to update the product. -
Flush cache.
-
Run cron jobs.
-
Check the
catalog_product_entity
table for entries of the product from the previous steps.
Expected results:
- A single entry for the product SKU should be present in the
catalog_product_entity
table. - The first REST API request should create one database entry, and all subsequent requests should update that database entry.
Actual results:
Multiple entries for the same SKU are present in the catalog_product_entity
table.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- ÃÛ¶¹ÊÓÆµ Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- ÃÛ¶¹ÊÓÆµ Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in the Commerce on Cloud Infrastructure guide.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool: A self-service tool for quality patches in the Tools guide.