File: rpl_start_slave_after_restart_initialized_slave.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (90 lines) | stat: -rw-r--r-- 3,006 bytes parent folder | download
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
# ==== Purpose ====
#
# This test verifies that executing START SLAVE command after restart of an
# initialized slave shall return no error.
#
# ==== Implementation ====
#
# 1. Initialize the slave by sourcing master-slave.inc without starting the
#    slave threads.
#
# 2. Verify that START SLAVE doesn't throw any error when
#
#    2.1 Server is shutdown and restarted with --relay-log-recovery=1 so that
#        STOP EVENT is generated in the relay log.
#
#    2.2 Server is killed and restarted with --relay-log-recovery=1 and when no
#        STOP EVENTS is generated in the relay log.
#
# 3. Verify that a warning saying that "Server was not able to find a rotate
#    event from a master server to initialize relay log recovery" is logged in
#    the error log.
#
# ==== References ====
#
# Bug#28996606 REPLICATION DOES NOT START IF RESTART MYSQL AFTER INIT
#              WITHOUT START SLAVE

--source include/have_binlog_format_row.inc
--source include/have_slave_repository_type_table.inc
--source include/not_rpl_gtid_only.inc

# 1. Initialize the slave by sourcing master-slave.inc without starting the
#    slave threads.
--let $rpl_multi_source= 1
--let $rpl_topology= 1->2,3->2
--let $rpl_skip_start_slave=1
--source include/rpl_init.inc

--let $rpl_connection_name= server_2
--source include/rpl_connection.inc

CALL mtr.add_suppression("Error during --relay-log-recovery*");
CALL mtr.add_suppression("Server was not able to find a rotate event*");
CALL mtr.add_suppression("Recovery from source pos*");

# 2. Verify that START SLAVE doesn't throw any error when
#
# 2.1 Server is shutdown and restarted with --relay-log-recovery=1 so that
#     STOP EVENT is generated in the relay log.
#
# 2.2 Server is killed and restarted with --relay-log-recovery=1 and when no
#     STOP EVENTS is generated in the relay log.

--let $i=0
while ($i < 2)
{
  if ($i == 1)
  {
    # Force kill the slave server and restart it with --relay-log-recovery=1 so
    # that STOP_EVENT is not generated in the relay log.
    --let $rpl_force_stop= 1
  }
  --let $rpl_server_number= 2
  --let $rpl_server_parameters= --skip_replica_start=1
  --source include/rpl_restart_server.inc

  --let $rpl_connection_name= server_2
  --source include/rpl_connection.inc

  # START SLAVE should not throw any error.
  --source include/start_slave.inc

  # Reset all servers to a clean state without syncing the servers.
  --let $rpl_skip_sync=1
  --source include/rpl_reset.inc
  --inc $i
}

# 3. Verify that a warning saying that "Server was not able to find a rotate
#    event from a master server to initialize relay log recovery" is logged in
#    the error log.

--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
# Each test will log two warnings, one fore each channel.
--let $assert_count= 2
--let $assert_select=.* \[Warning\] .* Server was not able to find a rotate event
--let $assert_text= Found the expected warning line in the error log.
--source include/assert_grep.inc

--source include/rpl_end.inc