File: rpl_gtid_mysqlbinlog_rotate.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 (67 lines) | stat: -rw-r--r-- 2,531 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
################################################################################
# BUG#20980932 MYSQLBINLOG GENERATES 'ROLLBACK' AFTER FD EVENT CAUSING 1782
#              ERRRO
#
# mysqlbinlog prints "ROLLBACK" at the end of binlog file. The ROLLBACK
# caused the error that "@@SESSION.GTID_NEXT cannot be set to ANONYMOUS
# when @@GLOBAL.GTID_MODE = ON."
#
# It happened in below two cases:
# - Case1. Binlog file doesn't include any data related events.
#  e.g. The binlog only includes:
#  Format_description_log_event
#  Rotate_log_event
#
#  and mysqlbinlog output:
#  BINLOG '... the binary of Format_description_log_event ...'
#  ROLLBACK
#
# - Case2. Relay log file includes a Format_description_log_event of master
#   which is generated at starting server.
#   e.g. the relay log includes:
#   Format_description_log_event of relay log
#   Format_description_log_event of master(generated when starting server)
#
#   and mysqlbinlog output:
#   BINLOG '... the binary of relay log's Format_description_log_event'
#   ROLLBACK
#   BINLOG '... the binary of master's Format_description_log_event'
#
#   To fix it:
#   - ROLLBACK is not printed if there is no uncomplete transaction at the end
#     of a binlog.
#   - Format_description_log_event of relay log is not output as a 'BINLOG'.
#   - SET @@SESSION.GTID_NEXT = 'AUTOMATIC' is always printed out at the end of
#     a binlog. It is after the 'ROLLBACK' if the last transaction is
#     uncomplete.
#
#  This test verify above two cases work well.
################################################################################
--source include/have_binlog_format_row.inc

--echo #
--echo # Verify Case2 works well
--echo #
--source include/master-slave.inc
--let $master_file1 = query_get_value(SHOW MASTER STATUS, File, 1)
--let $MASTER_DATADIR=`select @@datadir`

--source include/rpl_connection_slave.inc

--let $SLAVE_DATADIR=`select @@datadir`
--let $relay_file1 = query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)

--exec $MYSQL_BINLOG --force-if-open $SLAVE_DATADIR/$relay_file1 | $MYSQL -uroot -S$MASTER_MYSOCK
--exec $MYSQL_BINLOG --force-if-open $SLAVE_DATADIR/$relay_file1 | $MYSQL -uroot -S$SLAVE_MYSOCK

--echo #
--echo # Verify Case1 works well
--echo #
--source include/rpl_connection_master.inc
FLUSH BINARY LOGS;

--let $master_file2 = query_get_value(SHOW MASTER STATUS, File, 1)

--exec $MYSQL_BINLOG --force-if-open $MASTER_DATADIR/$master_file1 $MASTER_DATADIR/$master_file2 | $MYSQL -uroot -S$SLAVE_MYSOCK

--source include/rpl_end.inc