blob: 9438c7744617ebda5f618967eb4205a1f5794f65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
# ==== Purpose ====
#
# After a server has restarted, this waits for all clients configured
# by rpl_init.inc and/or master-slave.inc to reconnect again.
#
# For each connection, it issues this:
# --enable_reconnect
# --source include/wait_until_connected_again.inc
# --disable_reconnect
#
#
# ==== Usage ====
#
# --let $rpl_server_number= N
# [--let $rpl_debug= 1]
# --source include/rpl_reconnect.inc
#
# Parameters:
# $rpl_server_number
# Number to identify the server that needs to reconnect. 1 is the
# master server, 2 the slave server, 3 the 3rd server, and so on.
# Cf. include/rpl_init.inc
#
# $rpl_debug
# See include/rpl_init.inc
--let $include_filename= rpl_reconnect.inc
--source include/begin_include_file.inc
if (!$rpl_server_number)
{
--die ERROR IN TEST: you must set $rpl_server_number before you source rpl_connect.inc
}
if ($rpl_debug)
{
--echo ---- Enable reconnect ----
}
--let $_rpl_server_number= $rpl_server_number
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= default
--source include/rpl_connection.inc
--enable_reconnect
--let $rpl_connection_name= master
--source include/rpl_connection.inc
--enable_reconnect
--let $rpl_connection_name= master1
--source include/rpl_connection.inc
--enable_reconnect
}
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= slave
--source include/rpl_connection.inc
--enable_reconnect
--let $rpl_connection_name= slave1
--source include/rpl_connection.inc
--enable_reconnect
}
--let $rpl_connection_name= server_$rpl_server_number
--source include/rpl_connection.inc
--enable_reconnect
if ($rpl_debug)
{
--echo ---- Wait for reconnect and disable reconnect on all connections ----
}
--let $_rpl_server_number= $rpl_server_number
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= default
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $rpl_connection_name= master
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $rpl_connection_name= master1
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
}
--dec $_rpl_server_number
if (!$_rpl_server_number)
{
--let $rpl_connection_name= slave
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $rpl_connection_name= slave1
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
}
--let $rpl_connection_name= server_$rpl_server_number
--source include/rpl_connection.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
--let $include_filename= rpl_reconnect.inc
--source include/end_include_file.inc
|