Debian Codegraph @

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

raw
1 # ==== Purpose ====
2 #
3 # Verify that we can skip an incident event without a GTID by setting
4 # --replica-skip-errors=1590 on cross-version replication.
5 #
6 # ==== Implementation ====
7 #
8 # 1. a single statement on non-transactional table causes to log an incident
9 # event withiout a GTID due to the fact that the stmt_cache is not big
10 # enough to accommodate the changes.
11 #
12 # 2. sync slave sql with master to verify that we can skip the incident event
13 # by setting --replica-skip-errors=1590 on slave.
14 #
15 # ==== References ====
16 #
17 # Bug #26266758 SKIPPING MYSQL SLAVE ERROR CODE 1590 (ER_REPLICA_INCIDENT) DOES NOT WORK
18 # See mysql-test/suite/rpl/t/rpl_skip_incident_error.test
19
20 --source include/not_group_replication_plugin.inc
21 # Test in this file is binlog format agnostic, thus no need
22 # to rerun it for every format.
23 --source include/have_binlog_format_row.inc
24 --source include/force_myisam_default.inc
25 --source include/have_myisam.inc
26 --source include/have_debug.inc
27 --source include/master-slave.inc
28
29 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
30 call mtr.add_suppression("Replica SQL for channel '': The incident LOST_EVENTS occurred on the source.");
31 call mtr.add_suppression("Non-transactional changes were not written to the binlog. An incident event has been written to the binary log which will stop the replicas.");
32
33 --let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1)
34 --let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1)
35 SET GLOBAL max_binlog_stmt_cache_size = 4096;
36 SET GLOBAL binlog_stmt_cache_size = 4096;
37
38 --let $debug_point= simulate_write_trans_without_gtid
39 --source include/add_debug_point.inc
40
41 --disconnect master
42 --connect(master,127.0.0.1,root,,test,$MASTER_MYPORT,)
43 --let $data= `SELECT CONCAT('"', repeat('a',2000), '"')`
44
45 CREATE TABLE t1(c1 INT PRIMARY KEY, data TEXT(30000)) ENGINE=MyIsam;
46
47 --let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1)
48 --echo #
49 --echo # A single statement on non-transactional table causes to log an incident
50 --echo # event without a GTID due to the fact that the stmt_cache is not big
51 --echo # enough to accommodate the changes.
52 --echo #
53 --disable_query_log
54 --error ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
55 eval INSERT INTO t1 (c1, data) VALUES (1,
56 CONCAT($data, $data, $data, $data, $data, $data));
57 --enable_query_log
58 --let $binlog_start= $saved_master_pos
59 # Set this option to prove that there is no GTID generated
60 # for the incident event.
61 --let $keep_gtid_events= 1
62 --source include/show_binlog_events.inc
63
64
65 --echo #
66 --echo # Verify that we can skip the incident event by setting
67 --echo # --replica-skip-errors=1590 on slave.
68 --echo #
69 --source include/sync_slave_sql_with_master.inc
70
71 # Cleanup
72 --source include/rpl_connection_master.inc
73 DROP TABLE t1;
74
75 --let $debug_point= simulate_write_trans_without_gtid
76 --source include/remove_debug_point.inc
77
78 --replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
79 --eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
80 --replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
81 --eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size
82
83 --source include/rpl_end.inc