File: rpl_master_errors.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 (170 lines) | stat: -rw-r--r-- 5,482 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
################################################################################
# It tests the cases where the dump thread returns an error to the client.
################################################################################
--source include/not_group_replication_plugin.inc
--source include/not_rpl_gtid_only.inc
--source include/have_debug.inc
--source include/master-slave.inc

call mtr.add_suppression(".* You need to use --log-bin to make .* work.");
CALL mtr.add_suppression("Failed to open log");
--sync_slave_with_master
--source include/stop_slave.inc
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION= 0;
--source include/start_slave.inc
--source include/rpl_connection_master.inc

--echo #
--echo # Error: binlog file doesn't exist
--echo #
--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server not-exist.000001

--echo #
--echo # Error: master doesn't set server_id
--echo #

--let $debug_point= simulate_no_server_id
--source include/add_debug_point.inc

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server not-exist.000001

--echo #
--echo # Error: Error while sending faked rotate event
--echo #

--let $debug_point= simulate_send_error
--source include/add_debug_point.inc

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001

--let $debug_point= simulate_no_server_id
--source include/remove_debug_point.inc
--let $debug_point= simulate_send_error
--source include/remove_debug_point.inc

--echo #
--echo # Error: Fail to open binlog file
--echo #
FLUSH BINARY LOGS;
--let $datadir= `SELECT @@datadir`
--move_file $datadir/master-bin.000002 $datadir/master-bin-bak.000002

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server --stop-never master-bin.000001
--move_file $datadir/master-bin-bak.000002 $datadir/master-bin.000002

--echo #
--echo # Error: Could not find Format_Description_Event
--echo #
--move_file $datadir/master-bin.000001 $datadir/master-bin-bak.000001
--copy_file $MYSQLTEST_VARDIR/std_data/binlog_no_fd_event.000001 $datadir/master-bin.000001

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001

--echo #
--echo # Error: Fail on reading Previous_gtid_log_event
--echo #
--remove_file $datadir/master-bin.000001
--copy_file $MYSQLTEST_VARDIR/std_data/binlog_truncated_prev_gtid_event.000001 $datadir/master-bin.000001

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-source=BINLOG-DUMP-GTIDS master-bin.000001

--echo #
--echo # Error: Fail on reading event
--echo #
--remove_file $datadir/master-bin.000001
--copy_file $MYSQLTEST_VARDIR/std_data/binlog_truncated_event.000001 $datadir/master-bin.000001

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001

--move_file $datadir/master-bin-bak.000001 $datadir/master-bin.000001

--echo #
--echo # Error: Client requests from a position less than 4
--echo #
--source include/rpl_connection_slave.inc
--let $slave_io_errno= convert_error(ER_SERVER_SOURCE_FATAL_ERROR_READING_BINLOG)
--source include/stop_slave.inc

--let $debug_point= request_source_log_pos_3
--source include/add_debug_point.inc

START SLAVE IO_THREAD;
--let $slave_io_errno= 13114
call mtr.add_suppression(".* Got fatal error 1236 from source when reading data from binary log");
--source include/wait_for_slave_io_error.inc

--let $debug_point= request_source_log_pos_3
--source include/remove_debug_point.inc

--echo #
--echo # Error: Binary log is not open on master
--echo #

# Need to restart master without binlog
--let $rpl_server_number= 1
--let $rpl_server_parameters= --disable-log-bin --gtid-mode=off
--source include/rpl_restart_server.inc

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001

--echo #
--echo # Error: master's gtid_mode is not on
--echo #
# Need to restart master without gtid
--let $rpl_server_parameters= --gtid-mode=off
--source include/rpl_restart_server.inc

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-source=BINLOG-DUMP-GTIDS master-bin.000001

--let $rpl_server_parameters=
--source include/rpl_restart_server.inc

--echo #
--echo # Error: Dump thread is killed
--echo #

--source include/rpl_connection_master.inc
RESET MASTER;
CREATE TABLE t1(c1 INT);

--let $debug_point= simulate_kill_dump
--source include/add_debug_point.inc

# 'stop-never' will cause test timeout if 'kill dump thread' doesn't work well.
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-server master-bin.000001 --stop-never

--echo #
--echo # Error: Fail to send heartbeat with an net error
--echo #
--let $exclude_gtids= `SELECT @@GLOBAL.gtid_executed`
INSERT INTO t1 VALUES(1);

--let $debug_point= simulate_flush_error
--source include/add_debug_point.inc

--error 1
--exec $MYSQL_BINLOG -r $MYSQLTEST_VARDIR/tmp/output --read-from-remote-source=BINLOG-DUMP-GTIDS --exclude-gtids=$exclude_gtids master-bin.000001

--let $debug_point= simulate_kill_dump
--source include/remove_debug_point.inc
--let $debug_point= simulate_flush_error
--source include/remove_debug_point.inc

# Cleanup
DROP TABLE t1;
--remove_file $MYSQLTEST_VARDIR/tmp/output

--source include/rpl_connection_slave.inc
RESET MASTER;
RESET SLAVE;
--source include/start_slave.inc
--source include/rpl_end.inc