We have a mysql 5.6 cluster, 1 master 5 slaves.
Requirements:- We have to modify the size of a column varchar from 20 to 35 for 2 databases. What is the best approach for doing this accross the cluster?
Approach i tried:- make changes in 1 slave, take its backup and restore it across all slaves and then do a master switch.
issue:- When i made the changes in 1 of the slaves the replication broke for that slave.
command used:- alter table test_table modify LastName varchar(35);
Column 1 of table 'db1.test_table' cannot be converted from type 'varchar(20)' to type 'varchar(35)' : synchronized with replication@master_ip:3306
The table size is 450Gb each. While testing on slave, It took 2+ hours for the alter statement to complete for 1 table. In total there are 2 tables. So the downtime will be massive if I do it on the master directly.
What could be the best approach in this case to avoid the downtime as much as possible?
ALTER
on the Primary and let it replicate to the Replicas.