简体   繁体   中英

Magento 2.4.5 - Deadlock on table catalog_category_product_index_store1_replica and index stuck

The index "catalog_product_category" is stuck and the table "catalog_category_product_index_store1" is locked.

This is crashing down our website.

What we should do to have our indexes running correctly again and identify why it got stuck.

Index stuck

Locked table

The paliative solution until now is: Reboot our application and RDS.

Find out why Magento is TRUNCATEing a table. If possible, avoid using whatever is involved. If that is not possible, then jettison Magento.

A possible situation is "replacing" the contents of a table. For example, if you get a new set of values for catelog...replica , you could use TRUNCATE , but this is much better:

CREATE TABLE new LIKE catelog...replica;
load the new data into `new`
RENAME TABLE catelog...replica TO old,
             new TO catelog...replica;
DROP TABLE old;

No TRUNCATE , no downtime (except a tiny amount for the RENAME ), no time during which the table is empty (and being refilled), etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM