We are on Magento 1.14.2.0, and MySQL 5.6.25
Our MySQL replication stopped working 3 time in the last month due the following error on the Slave Server:
Error 'Can't DROP 'FK_CAT_CTGR_FLAT_STORE_1_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID';
check that column/key exists' on query.
Default database: 'sanitized'.
Query: 'ALTER TABLE `catalog_category_flat_store_1`
DROP FOREIGN KEY `FK_CAT_CTGR_FLAT_STORE_1_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID`'
A review of the bin-log show the offending SQL to be:
RENAME TABLE catalog_category_flat_store_1 TO catalog_category_flat_store_1_old,
catalog_category_flat_store_1_tmp TO catalog_category_flat_store_1'
Our Replication filter excludes tables like %_tmp, which I understand are sometimes memory tables and can not reliably be replicated. So the RENAME fails because the _tmp table is not on the slave.
Each instance of the problem is fixed by skipping that statement in replication, and then it catches up. But that requires manually intervention.
It was suggested we change the _tmp table to an inodb table and call it something else - so that it gets replicated. However I am unable to find any reference to the tablename in the code.
What is the sql statement used for?
Has anyone else experienced this problem, or know a solution?
Thanks, David Link