File: rpl_simulate_create_chunk_failure.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 (77 lines) | stat: -rw-r--r-- 2,665 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
75
76
77
# ==== Purpose ====
#
# Bug #18963676  MISSED TO HANDLE OOM ERROR WHILE ADDING A GTID INTO GTID SET
#
# Verify that we can get correct global @@GTID_EXECUTED after server
# restarts from a crash caused by 'OUT OF MEMORY' error on adding
# GTID into global @@GTID_EXECUTED.
#
# ==== Implementation ====
#
# 1) Commit a transaction on master.
# 2) Wait the slave server crash caused by 'OUT OF MEMORY' error
#    on adding GTID into @@GLOBAL.GTID_EXECUTED when applying
#    the replicated transaction.
# 3) Verify that the transaction is committed and its GTID is
#    added into @@GLOBAL.GTID_EXECUTED and 'gtid_executed'
#    table after slave server restarts.
#

# Test in this file is binlog format agnostic, thus no need
# to rerun them for every format.
--source include/have_binlog_format_row.inc
--source include/not_group_replication_plugin.inc
--source include/master-slave.inc
# Restrict the test runs to only debug builds, since we set DEBUG point in the test.
--source include/have_debug.inc
# Test simulates OOM condition and hence should not be run with valgrind
-- source include/not_valgrind.inc

--source include/rpl_connection_slave.inc
call mtr.add_suppression("You need to use --log-bin to make --binlog-format work");

--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect

--let $debug_point= rpl_gtid_update_on_commit_simulate_out_of_memory
--source include/add_debug_point.inc

--source include/rpl_connection_master.inc
--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`
--echo #
--echo # Commit a transaction on master
--echo #
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);

--source include/rpl_connection_slave.inc
--echo #
--echo # Wait the slave server crash caused by 'OUT OF MEMORY' error
--echo # on adding GTID into @@GLOBAL.GTID_EXECUTED when applying
--echo # the replicated transaction.
--echo #
--source include/wait_until_disconnected.inc
--let $rpl_server_number= 2
--source include/rpl_start_server.inc

--echo #
--echo # Verify that the transaction is committed and its GTID is
--echo # added into @@GLOBAL.GTID_EXECUTED and 'gtid_executed'
--echo # table after slave server restarts.
--echo #

# No need to unset the debug point as the server restarted

--replace_result $master_uuid MASTER_UUID
--eval SELECT * FROM mysql.gtid_executed
--let $assert_text= committed gtids MASTER_UUID:1
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1"

--let $assert_text= Table t1 exists and is empty
--let $assert_cond= "[SELECT c1 FROM t1]" = ""
--source include/assert.inc
--source include/start_slave.inc

# Cleanup
--source include/rpl_connection_master.inc
DROP TABLE t1;
--source include/rpl_end.inc