Debian Codegraph @

mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test

raw
1 #
2 # This include file is used by more than one test suite
3 # (currently rpl and binlog_encryption).
4 # Please check all dependent tests after modifying it
5 #
6
7 #
8 # Bug#11747416 : 32228 A disk full makes binary log corrupt.
9 #
10 #
11 # The test demonstrates reading from binlog error propagation to slave
12 # and reporting there.
13 # Conditions for the bug include a crash at time of the last event to
14 # the binlog was written partly. With the fixes the event is not sent out
15 # any longer, but rather the dump thread sends out a sound error message.
16 #
17 # Crash is not simulated. A binlog with partly written event in its end is installed
18 # and replication is started from it.
19 #
20
21 --source include/have_binlog_format_mixed.inc
22 --source include/master-slave.inc
23
24 --connection slave
25 --source include/stop_slave.inc
26 CHANGE MASTER TO MASTER_USE_GTID=NO;
27 --source include/start_slave.inc
28
29 # Make sure the slave is stopped while we are messing with master.
30 # Otherwise we get occasional failures as the slave manages to re-connect
31 # to the newly started master and we get extra events applied, causing
32 # conflicts.
33 --source include/stop_slave.inc
34
35 --connection master
36 call mtr.add_suppression("Error in Log_event::read_log_event()");
37 --let $datadir= `SELECT @@datadir`
38
39 --let $rpl_server_number= 1
40 --source include/rpl_stop_server.inc
41
42 --remove_file $datadir/master-bin.000001
43 --copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
44
45 --let $rpl_server_number= 1
46 --source include/rpl_start_server.inc
47
48 --source include/wait_until_connected_again.inc
49
50 # evidence of the partial binlog
51 --error ER_ERROR_WHEN_EXECUTING_COMMAND
52 show binlog events;
53
54 --connection slave
55 call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
56 --let $master_use_gtid_option= No
57 --source include/reset_slave.inc
58 start slave;
59
60 # ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
61 --let $slave_param=Last_IO_Errno
62 --let $slave_param_value=1236
63 --source include/wait_for_slave_param.inc
64
65 --let $slave_field_result_replace= / at [0-9]*/ at XXX/
66 --let $status_items= Last_IO_Errno, Last_IO_Error
67 --source include/show_slave_status.inc
68
69 #
70 # Cleanup
71 #
72
73 --connection master
74 reset master;
75
76 --connection slave
77 stop slave;
78 reset slave;
79 # Table was created from binlog, it may not be created if SQL thread is running
80 # slowly and IO thread reaches incident before SQL thread applies it.
81 --disable_warnings
82 drop table if exists t;
83 --enable_warnings
84 reset master;
85
86 --echo End of the tests
87 --let $rpl_only_running_threads= 1
88 --source include/rpl_end.inc