File: gr_binlog_checksum.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 (130 lines) | stat: -rw-r--r-- 4,662 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
################################################################################
# This test validates that Group Replication does support events checksums on
# all binary and relay logs, with the exception of the relay logs of
# group_replication_applier channel
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Start GR on server1 and create a table.
# 2. Start GR on server2.
# 3. Validate that server2 recovery channel relay logs have
#    checksums.
# 4. Execute a new transaction on server1 and validate that
#    server2 applier channel relay logs do not have checksums.
# 5. Validate that server2 binary log have checksums.
# 6. Validate that server1 binary log have checksums.
# 7. Clean up.
################################################################################
--source include/have_debug.inc
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
--let $output_file = $MYSQLTEST_VARDIR/tmp/gr-checksum-dump-file
--let $_binlog_compression_enable= `SELECT @@GLOBAL.binlog_transaction_compression`


--echo
--echo ############################################################
--echo # 1. Start GR on server1 and create a table.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--source include/start_and_bootstrap_group_replication.inc
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY);


--echo
--echo ############################################################
--echo # 2. Start GR on server2.
--echo #    Disable recovery channel relay logs purge through a debug flag.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
SET GLOBAL debug= '+d,gr_recovery_skip_purge_logs';
--source include/start_group_replication.inc
SET GLOBAL debug= '-d,gr_recovery_skip_purge_logs';


--echo
--echo ############################################################
--echo # 3. Validate that server2 recovery channel relay logs have
--echo #    checksums.
--let $datadir= `SELECT @@datadir`
--let $mysqlbinlog_parameters= $datadir/server-relay-log-group_replication_recovery.000003
--let $mysqlbinlog_pipe= > $output_file 2>&1
--source include/mysqlbinlog.inc

--let $assert_file= $output_file
--let $assert_count = 15
--let $assert_select = .*CRC32 0x\w+.*
--let $assert_text = recovery channel relay logs have checksums
--source include/assert_grep.inc


--echo
--echo ############################################################
--echo # 4. Execute a new transaction on server1 and validate that
--echo #    server2 applier channel relay logs do not have checksums.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
INSERT INTO t1 VALUES (1);
--source include/rpl_sync.inc

--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $datadir= `SELECT @@datadir`
--let $mysqlbinlog_parameters= $datadir/server-relay-log-group_replication_applier.000002
--let $mysqlbinlog_pipe= > $output_file 2>&1
--source include/mysqlbinlog.inc

--let $assert_file= $output_file
--let $assert_count = 0
--let $assert_select = .*CRC32 0x\w+.*
--let $assert_text = applier channel relay logs do not have checksums
--source include/assert_grep.inc


--echo
--echo ############################################################
--echo # 5. Validate that server2 binary log have checksums.
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--let $datadir= `SELECT @@datadir`
--let $mysqlbinlog_parameters= $datadir/server-binary-log.000001
--let $mysqlbinlog_pipe= > $output_file 2>&1
--source include/mysqlbinlog.inc

--let $assert_file= $output_file
--let $assert_count = 17
if ($_binlog_compression_enable == 1) {
  --let $assert_count = 18
}
--let $assert_select = .*CRC32 0x\w+.*
--let $assert_text = binary log have checksums
--source include/assert_grep.inc


--echo
--echo ############################################################
--echo # 6. Validate that server1 binary log have checksums.
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
--let $datadir= `SELECT @@datadir`
--let $mysqlbinlog_parameters= $datadir/server-binary-log.000001
--let $mysqlbinlog_pipe= > $output_file 2>&1
--source include/mysqlbinlog.inc

--let $assert_file= $output_file
--let $assert_count = 17
if ($_binlog_compression_enable == 1) {
  --let $assert_count = 18
}
--let $assert_select = .*CRC32 0x\w+.*
--let $assert_text = binary log have checksums
--source include/assert_grep.inc


--echo
--echo ############################################################
--echo # 7. Clean up.
--remove_file $output_file
DROP TABLE t1;
--source include/group_replication_end.inc