~ubuntu-branches/ubuntu/natty/mysql-5.1/natty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/include/rpl_reset.inc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# ==== Purpose ====
 
2
#
 
3
# Reset all replication servers to a clean state:
 
4
#
 
5
#  - sync all slaves,
 
6
#  - stop all slaves (STOP SLAVE),
 
7
#  - remove all binlogs and relay logs (RESET MASTER and RESET SLAVE),
 
8
#  - start all slaves again (START SLAVE).
 
9
#
 
10
# It does not execute CHANGE MASTER, so the replication topology is
 
11
# kept intact.
 
12
#
 
13
#
 
14
# ==== Usage ====
 
15
#
 
16
# [--let $rpl_only_running_threads= 1]
 
17
# [--let $rpl_debug= 1]
 
18
# [--let $slave_timeout= NUMBER]
 
19
# --source include/rpl_end.inc
 
20
#
 
21
# Parameters:
 
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.
 
26
#
 
27
#   $rpl_debug
 
28
#     See include/rpl_init.inc
 
29
#
 
30
#   $slave_timeout
 
31
#     Set the timeout when waiting for slave threads to stop and
 
32
#     start, respectively.  See include/wait_for_slave_param.inc
 
33
#
 
34
# Note:
 
35
#   This script will fail if Last_SQL_Error or Last_IO_Error is
 
36
#   nonempty.  If you expect an error in the SQL thread, you should
 
37
#   normally do this before you source include/rpl_reset.inc:
 
38
#
 
39
#     --source include/wait_for_slave_sql_error.inc
 
40
#     --source include/stop_slave_io.inc
 
41
#     RESET SLAVE;
 
42
 
 
43
--let $include_filename= rpl_reset.inc
 
44
--source include/begin_include_file.inc
 
45
 
 
46
 
 
47
if (!$rpl_debug)
 
48
{
 
49
  --disable_query_log
 
50
}
 
51
 
 
52
 
 
53
--source include/rpl_sync.inc
 
54
 
 
55
 
 
56
if ($rpl_debug)
 
57
{
 
58
  --echo ---- Stop and reset all servers ----
 
59
}
 
60
--let $_rpl_server= $rpl_server_count
 
61
while ($_rpl_server)
 
62
{
 
63
  --let $rpl_connection_name= server_$_rpl_server
 
64
  --source include/rpl_connection.inc
 
65
 
 
66
  # Check if this server is configured to have a master
 
67
  if (`SELECT SUBSTRING('$rpl_master_list', 1 + ($_rpl_server - 1) * $rpl_server_count_length, $rpl_server_count_length) != ''`)
 
68
  {
 
69
    --source include/stop_slave.inc
 
70
    RESET SLAVE;
 
71
  }
 
72
  RESET MASTER;
 
73
  --dec $_rpl_server
 
74
}
 
75
 
 
76
 
 
77
--source include/rpl_start_slaves.inc
 
78
 
 
79
 
 
80
--let $include_filename= rpl_reset.inc
 
81
--source include/end_include_file.inc