Debian Codegraph @

mysql-test/suite/group_replication/t/gr_write_set_extraction_algorithm.test

raw
1 # This test does the basic validations around transaction-write-set-extraction
2 #
3 # Test outline
4 # 0) Start the group and save the default values
5 # 1) Test that you cannot change the algorithm while GR is running
6 # 2) Test that you cannot join a group if your algorithm is different.
7 #
8
9 --source include/have_group_replication_plugin.inc
10 --let $rpl_skip_group_replication_start= 1
11 --source include/group_replication.inc
12
13 --let $rpl_connection_name= server2
14 --source include/rpl_connection.inc
15 # Value of TWSE cannot be changed when binlog_transaction_dependency_tracking!= COMMIT_ORDER
16 SET @binlog_transaction_dependency_tracking_save= @@GLOBAL.binlog_transaction_dependency_tracking;
17 SET GLOBAL binlog_transaction_dependency_tracking= COMMIT_ORDER;
18 SET @transaction_write_set_extraction_save= @@GLOBAL.transaction_write_set_extraction;
19
20 --let $rpl_connection_name= server1
21 --source include/rpl_connection.inc
22 # Save default value of binlog_transaction_dependency_tracking, change it to
23 # COMMIT_ORDER
24 SET @binlog_transaction_dependency_tracking_save= @@GLOBAL.binlog_transaction_dependency_tracking;
25 SET GLOBAL binlog_transaction_dependency_tracking= COMMIT_ORDER;
26 SET @transaction_write_set_extraction_save= @@GLOBAL.transaction_write_set_extraction;
27
28 --echo #
29 --echo # 1. Try to change the algorithm while Group Replication is running.
30 --echo # It will be disallowed.
31 --echo #
32
33 SET GLOBAL transaction_write_set_extraction='MURMUR32';
34
35 --let $write_set_algorithm= `SELECT @@GLOBAL.transaction_write_set_extraction`
36 --let $assert_text= transaction_write_set_extraction is correct
37 --let $assert_cond= "$write_set_algorithm"= "MURMUR32"
38 --source include/assert.inc
39
40 --source include/start_and_bootstrap_group_replication.inc
41
42 --error ER_GROUP_REPLICATION_RUNNING
43 SET SESSION transaction_write_set_extraction=OFF;
44
45 --error ER_GROUP_REPLICATION_RUNNING
46 SET SESSION transaction_write_set_extraction='XXHASH64';
47
48 --let $write_set_algorithm= `SELECT @@GLOBAL.transaction_write_set_extraction`
49 --let $assert_text= transaction_write_set_extraction is correct
50 --let $assert_cond= "$write_set_algorithm"= "MURMUR32"
51 --source include/assert.inc
52
53 --echo #
54 --echo # 2. Try to join a member with a different algorithm
55 --echo # It will be disallowed.
56 --echo #
57
58 --let $rpl_connection_name= server2
59 --source include/rpl_connection.inc
60
61 --disable_query_log
62 --eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
63 --enable_query_log
64
65 SET GLOBAL transaction_write_set_extraction='XXHASH64';
66
67 --error ER_GROUP_REPLICATION_CONFIGURATION
68 START GROUP_REPLICATION;
69
70 --replace_regex /[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9][0-9][0-9][0-9][-+Z][0-9:]* *[0-9]* *\[/DATE_TIME [/
71 --let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_write_set_extraction_algorithm.err
72 --let $grep_pattern=The member is configured with a transaction-write-set-extraction option value
73 --source include/grep_pattern.inc
74
75 --echo #
76 --echo # 3. Cleanup
77 --echo #
78
79 --let $rpl_connection_name= server1
80 --source include/rpl_connection.inc
81
82 --source include/stop_group_replication.inc
83 SET GLOBAL transaction_write_set_extraction= @transaction_write_set_extraction_save;
84 SET GLOBAL binlog_transaction_dependency_tracking= @binlog_transaction_dependency_tracking_save;
85
86 --let $rpl_connection_name= server2
87 --source include/rpl_connection.inc
88
89 SET GLOBAL transaction_write_set_extraction= @transaction_write_set_extraction_save;
90 SET GLOBAL binlog_transaction_dependency_tracking= @binlog_transaction_dependency_tracking_save;
91
92 --source include/group_replication_end.inc