Debian Codegraph @

mysql-test/suite/binlog/t/binlog_truncate_multi_engine.test

raw
1 # ==== Purpose ====
2 #
3 # Test verifies truncation of multiple binary logs with multiple transactional
4 # storage engines
5 #
6 # ==== References ====
7 #
8 # MDEV-21117: recovery for --rpl-semi-sync-slave-enabled server
9
10 --source include/have_rocksdb.inc
11 --source include/have_innodb.inc
12 --source include/have_debug.inc
13 --source include/have_debug_sync.inc
14 --source include/have_binlog_format_row.inc
15 --source include/not_valgrind.inc
16
17 --let $old_max_binlog_size= `select @@global.max_binlog_size`
18 call mtr.add_suppression("Can.t init tc log");
19 call mtr.add_suppression("Aborting");
20 --let $MYSQLD_DATADIR= `SELECT @@datadir`
21
22 SET @@global.sync_binlog= 1;
23 CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
24 CREATE TABLE t2 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=rocksdb;
25
26 --let $case = "A"
27 --let $description = "neither engine committed => rollback & binlog truncate"
28 # Hold off engine commits after write to binlog and its rotation.
29 # The transaction is killed along with the server after that.
30 --let $shutdown_timeout=0
31 --let $debug_sync_action = "commit_after_release_LOCK_log SIGNAL con1_ready WAIT_FOR signal_no_signal"
32 --let $restart_parameters = --init-rpl-role=SLAVE --sync-binlog=1
33 --let $test_outcome= 1 row should be present in both tables; binlog is truncated; number of binlogs at reconnect - 3
34 --source binlog_truncate_multi_engine.inc
35 --echo Proof of the truncated binlog file is readable (two transactions must be seen):
36 --exec $MYSQL_BINLOG --short-form --skip-annotate-row-events $MYSQLD_DATADIR/master-bin.000002
37
38 --let $case = "B"
39 --let $description = "one engine has committed its transaction branch"
40 # Hold off after one engine has committed.
41 --let $shutdown_timeout=0
42 --let $debug_sync_action = ""
43 # Both debug_sync and debug-dbug are required to make sure Engines remember the commit state
44 # debug_sync alone will not help.
45 --let $restart_parameters = --init-rpl-role=SLAVE --sync-binlog=1
46 --let $test_outcome= 2 rows should be present in both tables; no binlog truncation; one extra binlog file compare with A; number of binlogs at reconnect - 4
47 --source binlog_truncate_multi_engine.inc
48
49 --let $case = "C"
50 --let $description= "both engines have committed its transaction branch"
51 --let $debug_sync_action = "commit_after_run_commit_ordered SIGNAL con1_ready"
52 # Hold off after both engines have committed. The server is shut down.
53 --let $shutdown_timeout=
54 --let $restart_parameters = --init-rpl-role=SLAVE --sync-binlog=1
55 --let $test_outcome= 2 rows should be present in both tables; no binlog truncation; the same # of binlog files as in B; number of binlogs at reconnect - 4
56 --source binlog_truncate_multi_engine.inc
57
58 DROP TABLE t1, t2;
59 SET @@global.sync_binlog= default;
60 --echo # End of the tests