mysql-operator
mysql-operator copied to clipboard
Lock the slave while taking the backup.
If i got unexpected high number of insert requests and innodb_log_file_size is small for the amount of load server is getting, then my backup will fail. Can we lock the slave pod so that atleast we can take the backup of the data already present at that time?
@AMecea I added the new field Backup mode under MysqlClusterSpec. Now i need to run the mysql query STOP SLAVE SQL_THREAD just before taking the backup on the server from which we will take the backup and once the backup is finished whether it fails or success i need to run sql query START SLAVE SQL_THREAD. I wan't able to fully understand the code flow of how we are taking the backup. Can you please help me in understanding the flow?
Awesome! So the backup is taken from a job that runs the code from here and through an HTTP request, it connects to a slave node and runs this code.
What you should do it to pass the value of backupModeto the pod through an environment variable and add a new field into config struct. Base on that config you run or not the STOP SLAVE SQL_THREAD before starting xtrabackup. Using a defer statement you restart the replication. To run an SQL query use this function.
Please start your PR from dev3.0 branch because a lot of code is already under refactorization and to avoid some code conflicts it's better to use the dev branch.
Thank you!