3 # Shut down replication initialized by include/rpl_init.inc.
5 # This syncs all servers, executes STOP SLAVE on all servers, executes
6 # CHANGE MASTER on all servers, and disconnects all connections
7 # configured by rpl_init.inc.
9 # It does not execute RESET MASTER or RESET SLAVE, because that would
10 # remove binlogs which are possibly useful debug information in case
11 # the test case later fails with a result mismatch. If you need that,
12 # source include/rpl_reset.inc before you source this file.
17 # [--let $rpl_only_running_threads= 1]
18 # [--let $rpl_debug= 1]
19 # --source include/rpl_end.inc
22 # $rpl_only_running_threads
23 # If one or both of the IO and SQL threads is stopped, sync and
24 # stop only the threads that are running. See
25 # include/rpl_sync.inc and include/stop_slave.inc for details.
28 # See include/rpl_init.inc
31 # This script will fail if Last_SQL_Error or Last_IO_Error is
32 # nonempty. If you expect an error in the SQL thread, you should
33 # normally call this script as follows:
35 # --source include/wait_for_slave_sql_error.inc
36 # --source include/stop_slave_io.inc
38 # --let $rpl_only_running_threads= 1
39 # --source include/rpl_end.inc
42 # ==== Side effects ====
44 # Changes the current connection to 'default'.
47 --let $include_filename= rpl_end.inc
48 --source include/begin_include_file.inc
53 --die ERROR IN TEST: rpl_end.inc was sourced when replication was not configured. Most likely, rpl_end.inc was sourced twice or rpl_init.inc has not been sourced.
59 --echo ----
Check that no slave thread has an error ----
62 --let $_rpl_server= $rpl_server_count
65 --let $rpl_connection_name= server_$_rpl_server
66 --source include/rpl_connection.inc
68 # Only check slave threads for error on hosts that were at some
69 # point configured as slave.
70 --let $_tmp= query_get_value(SHOW SLAVE
STATUS, Master_Host, 1)
71 if ($_tmp != 'No such row')
73 --source include/check_slave_no_error.inc
79 --source include/rpl_sync.inc
80 --source include/rpl_stop_slaves.inc
82 # mtr configures server 2 to be a slave before it runs the test. We
83 # have to restore that state now, so we change topology to 1->2.
84 --let $rpl_topology= none
85 --source include/rpl_change_topology.inc
89 --let $_rpl_server= $rpl_server_count
93 --disconnect server_$_rpl_server
94 --disconnect server_$_rpl_server$_rpl_one
100 # Do not restore connection, because we have disconnected it.
101 --let $skip_restore_connection= 1
102 --let $include_filename= rpl_end.inc
103 --source include/end_include_file.inc