File: gr_startup_verifications.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 (90 lines) | stat: -rw-r--r-- 4,086 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
################################################################################
# The intent of this test is to verify if the validations that were
# created within the Group Replication plugin in the startup process
# are fully functional.
#
# It will test the dynamic variables:
# - binlog_format. It will be set to STATEMENT in order to fail.
# - transaction_write_set_extraction. It will be set to HASH_ALGORITHM_OFF in
# order to fail.
# - replica_parallel_workers. It will be set to 4 in order to fail.
#
# Test:
# 0. The test requires one server.
#  - Install plugin at startup.
# 1. binlog_format=STATEMENT. START GROUP_REPLICATION must fail due to GR
#    incompatible binlog_format.
# 2. Set transaction_write_set_extraction=OFF. START GROUP_REPLICATION must fail
#    due to GR incompatible binlog_format.
# 3. Set REPLICA_PARALLEL_WORKERS=4, REPLICA_PARALLEL_TYPE=DATABASE. START
#    GROUP_REPLICATION must fail due to GR incompatible REPLICA_PARALLEL_WORKERS.
#  - Set REPLICA_PARALLEL_WORKERS=4, REPLICA_PARALLEL_TYPE=LOGICAL_CLOCK. START
#    GROUP_REPLICATION must fail due to GR incompatible REPLICA_PARALLEL_WORKERS.
# 4. Restore the old configuration values.
################################################################################

--source include/have_group_replication_plugin.inc

--connection server1
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"

--echo #
--echo # Test if binlog_format with the wrong value will fail.
--echo #

--let $binlog_format_backup= `SELECT @@GLOBAL.binlog_format`

SET GLOBAL binlog_format= STATEMENT;

--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

--eval SET GLOBAL binlog_format= "$binlog_format_backup"

--let $transaction_write_set_extraction_backup= `SELECT @@GLOBAL.transaction_write_set_extraction`
# Value of TWSE cannot be changed when BTDT!= COMMIT_ORDER
--let $binlog_transaction_dependency_tracking_backup= `SELECT @@GLOBAL.binlog_transaction_dependency_tracking`

SET GLOBAL binlog_transaction_dependency_tracking= COMMIT_ORDER;
SET GLOBAL transaction_write_set_extraction=OFF;

--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

--replace_result $transaction_write_set_extraction_backup WRITE_SET_EXTRACTION_ALGORITHM
--eval SET GLOBAL transaction_write_set_extraction= $transaction_write_set_extraction_backup
--replace_result $binlog_transaction_dependency_tracking_backup BINLOG_TRANSACTION_DEPENDENCY_TRACKING
--eval SET GLOBAL binlog_transaction_dependency_tracking= $binlog_transaction_dependency_tracking_backup

--echo #
--echo # Test if parallel applier is enabled and that start
--echo # Group Replication will fail.
--echo #
SET @replica_parallel_type_saved= @@GLOBAL.REPLICA_PARALLEL_TYPE;
SET @replica_parallel_workers_saved= @@GLOBAL.REPLICA_PARALLEL_WORKERS;
SET @replica_preserve_commit_order= @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER;

SET @@GLOBAL.REPLICA_PARALLEL_TYPE= "DATABASE";
SET GLOBAL REPLICA_PARALLEL_WORKERS= 4;
--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

SET @@GLOBAL.REPLICA_PARALLEL_TYPE= "LOGICAL_CLOCK";
SET GLOBAL REPLICA_PARALLEL_WORKERS= 4;
SET @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER= OFF;
--error ER_GROUP_REPLICATION_CONFIGURATION
START GROUP_REPLICATION;

SET @@GLOBAL.REPLICA_PARALLEL_TYPE= @replica_parallel_type_saved;
--disable_warnings
SET @@GLOBAL.REPLICA_PARALLEL_WORKERS= @replica_parallel_workers_saved;
--enable_warnings
SET @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER= @replica_preserve_commit_order;

call mtr.add_suppression("Binlog format should be ROW for Group Replication");
call mtr.add_suppression("Extraction of transaction write sets requires*");
call mtr.add_suppression("In order to use parallel applier on Group Replication, parameter replica-parallel-type must be set to 'LOGICAL_CLOCK'");
call mtr.add_suppression("Group Replication requires replica-preserve-commit-order to be set to ON when using more than 1 applier threads.");

--source include/gr_clear_configuration.inc