When parametering replication on mySQL, you can setup the slave to only replicate transactions on a specific set of tables. Generally speaking, this could apply in a scenario where you have several big tables on a back end database and want only populate several smaller ones to a web front.
- Master tables
- Table1
- Table2
- Table3
- Slave tables
- Table1
- Table2
This scenario works pretty well except in one case. When you run a query on the master using the data of the Table 3
INSERT INTO Table2 (SELECT * FROM Table3 WHERE a=X)
The query will be transferred and run on the slave. But as Table3 does not exist on the slave, this will generate an error and pause the replication.
To make it work back, you will need to « skip » the query, this is done by running these queries on the slave
stop slave; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; start slave;
This will enable you slave back.
ATTENTION : Skipping the transaction will make the new lines inserted on the master not replicated, you will need to replicate these lines manually, ideally deleting the lines and re-inserting them in a way it is « replicable »