Debian Codegraph @

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

raw
1 # ==== Purpose ====
2 #
3 # The purpose of this script is to verify that replica is able to receive
4 # both old and new heartbeat_event
5 #
6 # ==== Requirements ====
7 #
8 # R1. Replica should work without erroring out for both old and new
9 # heartbeat event.
10 #
11 # ==== Implementation ====
12 #
13 # 1. Add a debug point which will force the source to send old
14 # heartbeat_event.
15 # 2. Change the heartbeat period on replica to be able to generate heartbeat
16 # event quicker.
17 # 3. Setup replication and sleep on source after executing 1 transaction,
18 # this will generate the heartbeat event on source side.
19 # 4. Verify that the source error log has heartbeat event related message.
20 # 5. Remove the debug point and verify that heartbeat events are still being
21 # generated on source side by asserting the heartbeat message in source
22 # error log.
23 # 6. Verify if replication is working fine.
24 # 7. Clean up
25 #
26 # ==== References ====
27 #
28 # Bug #29913991:HEARTBEAT EVENT CAN ONLY ADDRESS 32 BIT FILE OFFSET
29
30 --source include/have_binlog_format_row.inc
31
32 --source include/have_debug.inc
33
34 # 1. Add the debug point on source to force the source to generate
35 # old heartbeat event.
36 --let $debug_point= use_old_heartbeat_version
37 --source include/add_debug_point.inc
38 --source include/master-slave.inc
39
40 --source include/rpl_connection_slave.inc
41 --source include/stop_slave.inc
42 # 2. Change the heartbeat period on replica
43 CHANGE REPLICATION SOURCE TO SOURCE_HEARTBEAT_PERIOD = 2;
44 --source include/start_slave.inc
45 --source include/rpl_connection_master.inc
46 CREATE TABLE t(s int);
47
48 --source include/sync_slave_sql_with_master.inc
49
50 # 3. Sleep Sleep long enough to receive heartbeat events, even on slow platforms
51 --source include/rpl_connection_master.inc
52 --sleep 2
53 --source include/sync_slave_sql_with_master.inc
54 --source include/rpl_connection_master.inc
55
56 # 4 Verify that the source generated heartbeat related message in the error log
57 --let $assert_text = Found heartbeat related message in the error log
58 --let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
59 --let $assert_select = source sends heartbeat message
60 --let $assert_count = 1
61 --source include/assert_grep.inc
62
63 # 5. Remove the debug point from source
64 --let $debug_point= use_old_heartbeat_version
65 --source include/remove_debug_point.inc
66 INSERT INTO t VALUES(10);
67 --sleep 2
68 --let $assert_text = Found heartbeat related message in the error log
69 --let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
70 --let $assert_select = source sends heartbeat message
71 --let $assert_count = 2
72 --source include/assert_grep.inc
73
74 # 6. Verify that replica is working fine
75 --source include/sync_slave_sql_with_master.inc
76
77 # 7. Clean up
78 --source include/rpl_connection_master.inc
79 DROP TABLE t;
80 --source include/sync_slave_sql_with_master.inc
81 --source include/rpl_end.inc