MySQL replication whoops

James

Expert Member
Joined
May 26, 2004
Messages
2,617
Reaction score
3
I was building a staging environment, a rough scenario is this.

It is 6 servers, 4 slaves and 2 in a master-slave setup (with HB). I needed to upgrade a table from MyISAM to InnoDB so I stopped the slaves and altered the tables. The table in question contains around 20mil rows.

After starting this I realised that when I start replication again, it will replicate the alter table again on all the slaves. Although this will cause no damage I don't have the time to wait another 4+ hours while it alters it again.

What I now want to know does anyone know if it is possible to alter a binlog to remove the alter table row, or is it possible to restart the slaves from the current master binlog position (so it will miss the alter table query). I am not worried about the servers becoming out of sync as it is just me accessing the staging server right now and there is nothing that has happened since I became the alter table queries.

TIA
 
you can start the slaves at binlog(0)+1 (set_slave_skip_counter before slave start. ) ... and afai understand... those slaves will already be innodb's... so that alter command will just return with nothing and carry on with replication.
 
Last edited:
thanks, will give that a bash. I was going to try something like that, alternatively was going to do a bin-log reset.
 
Top
Sign up to the MyBroadband newsletter
X