3 # After a server has restarted, this waits for all clients configured
4 # by rpl_init.inc and/or master-slave.inc to reconnect again.
6 # For each connection, it issues this:
8 # --source include/wait_until_connected_again.inc
14 # --let $rpl_server_number= N
15 # [--let $rpl_extra_connections_per_server= 1]
16 # [--let $rpl_debug= 1]
17 # --source include/rpl_reconnect.inc
21 # Number to identify the server that needs to reconnect. 1 is the
22 # master server, 2 the slave server, 3 the 3rd server, and so on.
23 # Cf. include/rpl_init.inc
25 # $rpl_extra_connections_per_server, $rpl_debug
26 # See include/rpl_init.inc
28 --let $include_filename= rpl_reconnect.inc
29 --source include/begin_include_file.inc
31 if (!$rpl_server_number)
33 --die ERROR IN TEST: you must
set $rpl_server_number before you source rpl_connect.inc
36 if ($_rpl_extra_connections_per_server ==
'')
38 --let $_rpl_extra_connections_per_server= 1
44 --echo ---- Enable reconnect ----
47 --let $_rpl_server_number= $rpl_server_number
49 --dec $_rpl_server_number
50 if (!$_rpl_server_number)
52 --let $rpl_connection_name=
default
53 --source include/rpl_connection.inc
56 --let $rpl_connection_name= master
57 --source include/rpl_connection.inc
60 --let $rpl_connection_name= master1
61 --source include/rpl_connection.inc
65 --dec $_rpl_server_number
66 if (!$_rpl_server_number)
68 --let $rpl_connection_name= slave
69 --source include/rpl_connection.inc
72 --let $rpl_connection_name= slave1
73 --source include/rpl_connection.inc
77 --let $rpl_connection_name= server_$rpl_server_number
78 --source include/rpl_connection.inc
81 --let $_rpl_connection_number= 1
82 while ($_rpl_connection_number <= $_rpl_extra_connections_per_server)
84 --let $rpl_connection_name= server_$rpl_server_number$underscore$_rpl_connection_number
85 --source include/rpl_connection.inc
87 --inc $_rpl_connection_number
92 --echo ---- Wait
for reconnect and disable reconnect on all connections ----
95 --let $_rpl_server_number= $rpl_server_number
97 --dec $_rpl_server_number
98 if (!$_rpl_server_number)
100 --let $rpl_connection_name=
default
101 --source include/rpl_connection.inc
102 --source include/wait_until_connected_again.inc
105 --let $rpl_connection_name= master
106 --source include/rpl_connection.inc
107 --source include/wait_until_connected_again.inc
110 --let $rpl_connection_name= master1
111 --source include/rpl_connection.inc
112 --source include/wait_until_connected_again.inc
116 --dec $_rpl_server_number
117 if (!$_rpl_server_number)
119 --let $rpl_connection_name= slave
120 --source include/rpl_connection.inc
121 --source include/wait_until_connected_again.inc
124 --let $rpl_connection_name= slave1
125 --source include/rpl_connection.inc
126 --source include/wait_until_connected_again.inc
130 --let $rpl_connection_name= server_$rpl_server_number
131 --source include/rpl_connection.inc
132 --source include/wait_until_connected_again.inc
135 --let $_rpl_connection_number= 1
136 while ($_rpl_connection_number <= $_rpl_extra_connections_per_server)
138 --let $rpl_connection_name= server_$rpl_server_number$underscore$_rpl_connection_number
139 --source include/rpl_connection.inc
140 --source include/wait_until_connected_again.inc
142 --inc $_rpl_connection_number
146 --let $include_filename= rpl_reconnect.inc
147 --source include/end_include_file.inc