| 1 |
################################################################################ |
| 2 |
# The intent of this test is to verify if the validations that were |
| 3 |
# created within the Group Replication plugin in the startup process |
| 4 |
# are fully functional. |
| 5 |
# |
| 6 |
# It will test the dynamic variables: |
| 7 |
# - binlog_format. It will be set to STATEMENT in order to fail. |
| 8 |
# - transaction_write_set_extraction. It will be set to HASH_ALGORITHM_OFF in |
| 9 |
# order to fail. |
| 10 |
# - replica_parallel_workers. It will be set to 4 in order to fail. |
| 11 |
# |
| 12 |
# Test: |
| 13 |
# 0. The test requires one server. |
| 14 |
# - Install plugin at startup. |
| 15 |
# 1. binlog_format=STATEMENT. START GROUP_REPLICATION must fail due to GR |
| 16 |
# incompatible binlog_format. |
| 17 |
# 2. Set transaction_write_set_extraction=OFF. START GROUP_REPLICATION must fail |
| 18 |
# due to GR incompatible binlog_format. |
| 19 |
# 3. Set REPLICA_PARALLEL_WORKERS=4, REPLICA_PARALLEL_TYPE=DATABASE. START |
| 20 |
# GROUP_REPLICATION must fail due to GR incompatible REPLICA_PARALLEL_WORKERS. |
| 21 |
# - Set REPLICA_PARALLEL_WORKERS=4, REPLICA_PARALLEL_TYPE=LOGICAL_CLOCK. START |
| 22 |
# GROUP_REPLICATION must fail due to GR incompatible REPLICA_PARALLEL_WORKERS. |
| 23 |
# 4. Restore the old configuration values. |
| 24 |
################################################################################ |
| 25 |
|
| 26 |
--source include/have_group_replication_plugin.inc |
| 27 |
|
| 28 |
--connection server1 |
| 29 |
--replace_result $group_replication_group_name GROUP_REPLICATION_GROUP_NAME |
| 30 |
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" |
| 31 |
|
| 32 |
--echo # |
| 33 |
--echo # Test if binlog_format with the wrong value will fail. |
| 34 |
--echo # |
| 35 |
|
| 36 |
--let $binlog_format_backup= `SELECT @@GLOBAL.binlog_format` |
| 37 |
|
| 38 |
SET GLOBAL binlog_format= STATEMENT; |
| 39 |
|
| 40 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 41 |
START GROUP_REPLICATION; |
| 42 |
|
| 43 |
--eval SET GLOBAL binlog_format= "$binlog_format_backup" |
| 44 |
|
| 45 |
--let $transaction_write_set_extraction_backup= `SELECT @@GLOBAL.transaction_write_set_extraction` |
| 46 |
# Value of TWSE cannot be changed when BTDT!= COMMIT_ORDER |
| 47 |
--let $binlog_transaction_dependency_tracking_backup= `SELECT @@GLOBAL.binlog_transaction_dependency_tracking` |
| 48 |
|
| 49 |
SET GLOBAL binlog_transaction_dependency_tracking= COMMIT_ORDER; |
| 50 |
SET GLOBAL transaction_write_set_extraction=OFF; |
| 51 |
|
| 52 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 53 |
START GROUP_REPLICATION; |
| 54 |
|
| 55 |
--replace_result $transaction_write_set_extraction_backup WRITE_SET_EXTRACTION_ALGORITHM |
| 56 |
--eval SET GLOBAL transaction_write_set_extraction= $transaction_write_set_extraction_backup |
| 57 |
--replace_result $binlog_transaction_dependency_tracking_backup BINLOG_TRANSACTION_DEPENDENCY_TRACKING |
| 58 |
--eval SET GLOBAL binlog_transaction_dependency_tracking= $binlog_transaction_dependency_tracking_backup |
| 59 |
|
| 60 |
--echo # |
| 61 |
--echo # Test if parallel applier is enabled and that start |
| 62 |
--echo # Group Replication will fail. |
| 63 |
--echo # |
| 64 |
SET @replica_parallel_type_saved= @@GLOBAL.REPLICA_PARALLEL_TYPE; |
| 65 |
SET @replica_parallel_workers_saved= @@GLOBAL.REPLICA_PARALLEL_WORKERS; |
| 66 |
SET @replica_preserve_commit_order= @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER; |
| 67 |
|
| 68 |
SET @@GLOBAL.REPLICA_PARALLEL_TYPE= "DATABASE"; |
| 69 |
SET GLOBAL REPLICA_PARALLEL_WORKERS= 4; |
| 70 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 71 |
START GROUP_REPLICATION; |
| 72 |
|
| 73 |
SET @@GLOBAL.REPLICA_PARALLEL_TYPE= "LOGICAL_CLOCK"; |
| 74 |
SET GLOBAL REPLICA_PARALLEL_WORKERS= 4; |
| 75 |
SET @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER= OFF; |
| 76 |
--error ER_GROUP_REPLICATION_CONFIGURATION |
| 77 |
START GROUP_REPLICATION; |
| 78 |
|
| 79 |
SET @@GLOBAL.REPLICA_PARALLEL_TYPE= @replica_parallel_type_saved; |
| 80 |
--disable_warnings |
| 81 |
SET @@GLOBAL.REPLICA_PARALLEL_WORKERS= @replica_parallel_workers_saved; |
| 82 |
--enable_warnings |
| 83 |
SET @@GLOBAL.REPLICA_PRESERVE_COMMIT_ORDER= @replica_preserve_commit_order; |
| 84 |
|
| 85 |
call mtr.add_suppression("Binlog format should be ROW for Group Replication"); |
| 86 |
call mtr.add_suppression("Extraction of transaction write sets requires*"); |
| 87 |
call mtr.add_suppression("In order to use parallel applier on Group Replication, parameter replica-parallel-type must be set to 'LOGICAL_CLOCK'"); |
| 88 |
call mtr.add_suppression("Group Replication requires replica-preserve-commit-order to be set to ON when using more than 1 applier threads."); |
| 89 |
|
| 90 |
--source include/gr_clear_configuration.inc |