1# ==== Purpose ====
2#
3# Waits until the slave IO thread has been synced, i.e., all events
4# have been copied over to slave.  Does not care if the SQL thread is
5# in sync (or even running).
6#
7#
8# ==== Usage ====
9#
10# [--let $sync_slave_connection= <connection_name>]
11# [--let $slave_timeout= NUMBER]
12# [--let $rpl_debug= 1]
13# --source include/sync_slave_io_with_master.inc
14#
15# Syncs slave to the current position on master, as found by SHOW
16# MASTER STATUS.
17#
18# Must be called on the master. Will change connection to the slave.
19#
20# Parameters:
21#   $sync_slave_connection
22#     By default, this script switches connection to 'slave'. If
23#     $sync_slave_connection is set, then '$sync_slave_connection' is
24#     used instead of 'slave'.
25#
26#   $slave_timeout
27#      See include/wait_for_slave_param.inc.
28#
29#   $rpl_debug
30#      See include/rpl_init.inc
31
32--let $include_filename= sync_slave_io_with_master.inc
33--source include/begin_include_file.inc
34
35
36--source include/save_master_pos.inc
37
38--let $rpl_connection_name= slave
39if ($sync_slave_connection)
40{
41  --let $rpl_connection_name= $sync_slave_connection
42}
43--source include/rpl_connection.inc
44
45--source include/sync_io_with_master.inc
46
47
48--let $include_filename= sync_slave_io_with_master.inc
49--let $skip_restore_connection= 1
50--source include/end_include_file.inc
51