Debian Codegraph @

mysql-test/suite/rpl/t/master_last_event_time.inc

raw
1 --echo #
2 --echo # Test that changes are properly applied by server_2 and server_3
3 --echo #
4
5 # MDEV-34765: Slave to master synchronization must be done via binlog
6 # coordinates, as GTID with statement format would cause the sync_with_master
7 # points to continue too early due to the gtid_slave_pos update happening
8 # during the Query_log_event::do_apply_event(), which is before the
9 # *_last_event_time fields are updated.
10 --connection server_1
11 --source include/save_master_pos.inc
12
13 --connection server_2
14 --source include/sync_with_master.inc
15
16 # binlog coordinate on server_2 differs from server_1's, so update the sync pos
17 # so server_3 can sync
18 --source include/save_master_pos.inc
19
20
21 --echo # Show that the server_2 received the insert from master
22 select * from t1;
23
24 --let $master_time= query_get_value(SHOW ALL SLAVES STATUS, Master_last_event_time, 1)
25 --let $slave_time= query_get_value(SHOW ALL SLAVES STATUS, Slave_last_event_time, 1)
26 --disable_query_log
27 --eval select "$master_time" <> "NULL" as "master <> NULL; Should be 1"
28
29 if (`SELECT NOT "$master_time" <> "NULL"`)
30 {
31 --echo MASTER: $master_time
32 }
33
34 --eval select "$master_time" = "$slave_time" as "master_time == slave_time ; Should be 1"
35 if (`SELECT NOT "$master_time" = "$slave_time"`)
36 {
37 --echo MASTER: $master_time SLAVE: $slave_time
38 }
39 --enable_query_log
40
41 --connection server_3
42 --source include/start_slave.inc
43 --source include/sync_with_master.inc
44
45 --echo # Show that the server_3 received the insert from master
46 select * from t1;
47
48 --let $master_time= query_get_value(SHOW ALL SLAVES STATUS, Master_last_event_time, 1)
49 --let $slave_time= query_get_value(SHOW ALL SLAVES STATUS, Slave_last_event_time, 1)
50 --disable_query_log
51
52 --eval select "$master_time" <> "NULL" as "master <> NULL; Should be 1"
53 if (`SELECT NOT "$master_time" <> "NULL"`)
54 {
55 --echo MASTER: $master_time
56 }
57
58 --eval select "$master_time" = "$slave_time" as "master_time == slave_time ; Should be 1"
59 if (`SELECT NOT "$master_time" = "$slave_time"`)
60 {
61 --echo MASTER: $master_time SLAVE: $slave_time
62 }
63 --enable_query_log
64
65 # Reset things for next test
66 --source include/stop_slave.inc
67 --connection server_1