ACP2E-4603: Catalog Permissions product reindex leave stale permission index rows and MySQL deadlock
The ACP2E-4603 patch fixes the issue where Catalog Permissions product reindexing leaves existing permission index rows unchanged, so updated category permission grants don’t reflect correctly on products. This patch is available when the Quality Patches Tool (QPT) 1.1.79 is installed. The patch ID is ACP2E-4603. Please note that this issue is scheduled to be fixed in Adobe Commerce 2.4.9.
Affected products and versions
The patch is created for Adobe Commerce version:
- Adobe Commerce (all deployment methods) 2.4.7-p3
Compatible with Adobe Commerce versions:
- Adobe Commerce (all deployment methods) 2.4.6 - 2.4.7-p9
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
Catalog Permissions product reindexing leaves existing permission index rows unchanged, so updated category permission grants don’t reflect correctly on products.
Steps to reproduce:
-
Enable Category Permissions:
- Log in to the Admin.
- Go to Stores > Configuration.
- Under Catalog, select Catalog.
- Expand Category Permissions.
- Set Enable to Yes.
- Save the Configuration.
-
Create 50 or more customer groups (Option A or Option B):
- Option A — Admin: Go to Customers > Customer Groups and select Add New. Enter a group name (for example,
ACSD70034_01) and select the default tax class, then Save. Repeat to create 50 or more groups. - Option B (recommended) — REST API: Send a POST request to
/rest/V1/customerGroupswith the request body{"group":{"code":"ACSD70034_01","taxClassId":0}}. Repeat to create 50 groups (ACSD70034_01throughACSD70034_50).
- Option A — Admin: Go to Customers > Customer Groups and select Add New. Enter a group name (for example,
-
Add category permissions in Admin:
- Go to Catalog > Categories.
- Edit 10–20 or more categories to increase reproducibility.
- In each category, scroll to Category Permissions and select Add Permission.
- Select a website (for example, Main Website) and assign one of the previously created customer groups.
- Configure Grant Catalog Category View, Grant Product Price, and Grant Checkout as required.
- Select Save.
- Recommended scale: Create a larger data set (for example, 20 categories and 20–50 customer groups) to generate 400–1,000 permission rows.
-
Ensure a single index table (default):
- Go to Stores > Configuration > Catalog > Catalog > Category Permissions.
- If Dimensions or Indexer Dimensions appears, set it to None (not Customer Group) to use a single index table.
-
Run reindex with parallel threads from the CLI:
- Export
MAGE_INDEXER_THREADS_COUNT=4. - Run
php bin/magento indexer:reset catalogpermissions_category catalogpermissions_product. - Run
php bin/magento indexer:reindex catalogpermissions_category catalogpermissions_product. - Repeat the reset and reindex commands 5–10 times to reproduce the deadlock during parallel execution.
- Export
Expected results:
Reindex completes successfully with parallel threads, and updated category permission grants reflect correctly on products in the magento_catalogpermissions_index_product table.
Actual results:
A MySQL deadlock error (1213) occurs intermittently during reindex, and child processes fail with errors referencing REPLACE INTO on magento_catalogpermissions_index_replica or magento_catalogpermissions_index_product.
Even when reindex completes without errors, it does not update existing permission index rows, so products continue to reflect stale category permission grants.
Apply the patch
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Quality Patches Tool > Usage in the Quality Patches Tool guide.
- Adobe 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.