MariaDB 10.3 – How to Drop Partition on Master but Not on Slave

mariadbmariadb-10.3replication

I've read about filtering replication and I only run into information I know already, like you can select only a database or a table to do replication on.

My use case is that I want to have a slim and fast master with main data organized into partitions – one partition per day (each day a new partition is created). The master only keeps most recent 10 days of data and I need the slaves to keep all.

How do I ALTER TABLE ... DROP PARTITION on master without being replicated on slaves?

I seems to me that somehow I have to instruct the master not to write this operation into bin-log, but how do I do it?

Best Answer

You could run SET SESSION sql_log_bin=0 in the session before running the ALTER TABLE...