Ensure slave not running when reseting

With this change it is ensured that you do not see

  ERROR 1198 (HY000) at line 28: This operation cannot be performed
  as you have a running slave ''; run STOP SLAVE '' first

when the slave is reset.
This commit is contained in:
Johan Wikman 2017-12-18 10:58:09 +02:00
parent e45653724e
commit 2c46e2a7ec

View File

@ -376,6 +376,8 @@ int Mariadb_nodes::start_replication()
printf("Starting node %d\n", i);
fflush(stdout);
copy_to_node_legacy(str, "/tmp/master_backup.sql", i);
ssh_node_f(i, true, "mysql --force -u root %s -e \"STOP SLAVE;\"",
socket_cmd[i]);
ssh_node_f(i, true, "mysql --force -u root %s < /tmp/master_backup.sql",
socket_cmd[i]);
ssh_node_f(i, true, "mysql --force -u root %s -e \"CHANGE MASTER TO MASTER_HOST=\\\"%s\\\", MASTER_PORT=%d, "