I have been facing issue on checkout page in case of Back Order product. The exception I am getting "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '42438-0-1' for key 'PRIMARY', query was: INSERT INTO catalog_product_index_price_temp
SELECT catalog_product_index_price_final_temp
.entity_id
, catalog_product_index_price_final_temp
.customer_group_id
, catalog_product_index_price_final_temp
.website_id
, catalog_product_index_price_final_temp
.tax_class_id
, catalog_product_index_price_final_temp
.orig_price
AS price
, catalog_product_index_price_final_temp
.price
AS final_price
, catalog_product_index_price_final_temp
.min_price
, catalog_product_index_price_final_temp
.max_price
, catalog_product_index_price_final_temp
.tier_price
FROM catalog_product_index_price_final_temp
"
Followings are my findings :
- Price re-indexing happens to be initiated when "sales_model_service_quote_submit_success" is fired which calls Magento\CatalogInventory\Observer\ReindexQuoteInventoryObserver.
- If you see line number 77, this where it starts price reindxing.
- Also, I am not able to find the existance of key mentioned in exceptioned.
Help me. This is bit of urgent.