File: rpl_skip_incident_error.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 (74 lines) | stat: -rw-r--r-- 3,027 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
# ==== Purpose ====
#
# Verify that we can skip an incident event by setting --replica-skip-errors=1590
# on slave.
#
# ==== Implementation ====
#
# 1. a single statement on non-transactional table causes to log an incident
#    event with an unique gtid due to the fact that the stmt_cache is not
#    big enough to accommodate the changes.
#
# 2. sync slave sql with master to verify that we can skip the incident event
#    by setting --replica-skip-errors=1590 on slave.
#
# ==== References ====
#
# Bug #26266758  SKIPPING MYSQL SLAVE ERROR CODE 1590 (ER_REPLICA_INCIDENT) DOES NOT WORK
# See mysql-test/suite/rpl/t/rpl_skip_incident_error_cross.test

--source include/not_group_replication_plugin.inc
# Test in this file is binlog format agnostic, thus no need
# to rerun it for every format.
--source include/have_binlog_format_row.inc
--source include/force_myisam_default.inc
--source include/have_myisam.inc
--source include/master-slave.inc

call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Replica SQL for channel '': The incident LOST_EVENTS occurred on the source.");
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.");

--let $old_max_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_stmt_cache_size", Value, 1)
--let $old_binlog_stmt_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_stmt_cache_size", Value, 1)
SET GLOBAL max_binlog_stmt_cache_size = 4096;
SET GLOBAL binlog_stmt_cache_size = 4096;

--disconnect master
--connect(master,127.0.0.1,root,,test,$MASTER_MYPORT,)
--let $data= `SELECT CONCAT('"', repeat('a',2000), '"')`

CREATE TABLE t1(c1 INT PRIMARY KEY, data TEXT(30000)) ENGINE=MyIsam;

--let $saved_master_pos=query_get_value('SHOW MASTER STATUS', Position, 1)
--echo #
--echo # A single statement on non-transactional table causes to log an incident
--echo # event with an unique gtid due to the fact that the stmt_cache is not
--echo # big enough to accommodate the changes.
--echo #
--disable_query_log
--error ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE
eval INSERT INTO t1 (c1, data) VALUES (1,
       CONCAT($data, $data, $data, $data, $data, $data));
--enable_query_log

--let $binlog_start= $saved_master_pos
--source include/show_binlog_events.inc

INSERT INTO t1 (c1, data) VALUES (2, 'b');

--echo #
--echo # Verify that we can skip the incident event by setting
--echo # --replica-skip-errors=1590 on slave.
--echo #
--source include/sync_slave_sql_with_master.inc

# Cleanup
--source include/rpl_connection_master.inc
DROP TABLE t1;
--replace_result $old_max_binlog_stmt_cache_size ORIGINAL_VALUE
--eval SET GLOBAL max_binlog_stmt_cache_size= $old_max_binlog_stmt_cache_size
--replace_result $old_binlog_stmt_cache_size ORIGINAL_VALUE
--eval SET GLOBAL binlog_stmt_cache_size= $old_binlog_stmt_cache_size

--source include/rpl_end.inc