203 lines
8.7 KiB
Plaintext
203 lines
8.7 KiB
Plaintext
################################################################################
|
|
# WL#11610 - GCS message fragmentation options
|
|
#
|
|
# This test case checks message fragmentation options for group replication
|
|
#
|
|
# Test:
|
|
# 0. The test requires two servers: M1 and M2.
|
|
# 1. When GROUP is OFFLINE, set variable
|
|
# group_replication_communication_max_message_size to 0, i.e. disabled.
|
|
# 2. Check it asserts that:
|
|
# - The variable does not take invalid inputs.
|
|
# - The variable does not take over the max inputs.
|
|
# - The variable does not take negative inputs.
|
|
# - The variable can be set to valid value.
|
|
# 3. Bootstrap M1 and start M2 to make them ONLINE.
|
|
# 4. Assert that on running member variable cannot be changed.
|
|
# 5. Check if two servers with and without fragmentation enabled are able to
|
|
# exchange messages and still comunicate with each other.
|
|
# 6. Confirm, in the error log, the servers start with the expected
|
|
# fragmentation threshold.
|
|
# 7. Cleanup
|
|
################################################################################
|
|
|
|
--source include/have_group_replication_plugin.inc
|
|
--let $rpl_skip_group_replication_start= 1
|
|
--source include/group_replication.inc
|
|
|
|
--let $sound_threshold= 50000
|
|
--let $double_sound_threshold= `SELECT $sound_threshold * 2`
|
|
--let $half_sound_threshold= `SELECT $sound_threshold / 2`
|
|
--let $default_threshold= 10485760
|
|
--let $incorrect_threshold= "AAAA"
|
|
--let $overflow_threshold= 4294967297
|
|
--let $negative_threshold= -1
|
|
|
|
--echo #########################################################################
|
|
--echo # 1. When GROUP is OFFLINE, set variable group_replication_communication_max_message_size to 0, i.e. disabled.
|
|
# make sure that fragmentation is disabled
|
|
# disable compression to be sure fragmentation kicks in
|
|
--let $rpl_connection_name= server2
|
|
--source include/rpl_connection.inc
|
|
|
|
--let $saved_threshold_2= `SELECT @@group_replication_communication_max_message_size`
|
|
SET GLOBAL group_replication_communication_max_message_size= 0;
|
|
--let $saved_compression_2= `SELECT @@group_replication_compression_threshold`
|
|
SET GLOBAL group_replication_compression_threshold= 0;
|
|
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
--let $saved_threshold_1= `SELECT @@group_replication_communication_max_message_size`
|
|
SET GLOBAL group_replication_communication_max_message_size= 0;
|
|
--let $saved_compression_1= `SELECT @@group_replication_compression_threshold`
|
|
SET GLOBAL group_replication_compression_threshold= 0;
|
|
|
|
--echo #########################################################################
|
|
--echo # 2. Check it asserts that:
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
--echo # 2.a. The variable does not take invalid inputs.
|
|
--error ER_WRONG_TYPE_FOR_VAR
|
|
--eval SET GLOBAL group_replication_communication_max_message_size=$incorrect_threshold
|
|
|
|
--echo # 2.b. The variable does not take over the max inputs.
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
--eval SET GLOBAL group_replication_communication_max_message_size=$overflow_threshold
|
|
|
|
--echo # 2.c. The variable does not take negative inputs.
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
--eval SET GLOBAL group_replication_communication_max_message_size=$negative_threshold
|
|
|
|
--echo # 2.d. The variable can be set to DEFAULT.
|
|
SET GLOBAL group_replication_communication_max_message_size=DEFAULT;
|
|
|
|
# Assert that the threshold was actually changed
|
|
--let $threshold= `SELECT @@group_replication_communication_max_message_size`
|
|
--let $assert_cond= $threshold = $default_threshold
|
|
--let $assert_text= Assert that communication_max_message_size was changed to the default value
|
|
--source include/assert.inc
|
|
|
|
--echo # 2.e. The variable can be set to a valid value.
|
|
--eval SET GLOBAL group_replication_communication_max_message_size=$sound_threshold
|
|
|
|
# Assert that the threshold was actually changed
|
|
--let $threshold= `SELECT @@group_replication_communication_max_message_size`
|
|
--let $assert_cond= $threshold = $sound_threshold
|
|
--let $assert_text= Assert that communication_max_message_size was changed
|
|
--source include/assert.inc
|
|
|
|
--echo #########################################################################
|
|
--echo # 3. Bootstrap M1 and start M2 to make them ONLINE.
|
|
# Start GR on server1
|
|
--source include/start_and_bootstrap_group_replication.inc
|
|
|
|
# Start GR on server2
|
|
--let $rpl_connection_name= server2
|
|
--source include/rpl_connection.inc
|
|
--source include/start_group_replication.inc
|
|
|
|
# Go back to server1
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
--echo #########################################################################
|
|
--echo # 4. Assert that on running member variable cannot be changed.
|
|
--error ER_GROUP_REPLICATION_RUNNING
|
|
--eval SET GLOBAL group_replication_communication_max_message_size=$double_sound_threshold
|
|
|
|
# Assert that the value remains unchanged since SET failed
|
|
--let $threshold= `SELECT @@group_replication_communication_max_message_size`
|
|
--let $assert_cond= $threshold = $sound_threshold
|
|
--let $assert_text= Assert that the communication_max_message_size remains unchanged
|
|
--source include/assert.inc
|
|
|
|
--echo #########################################################################
|
|
--echo # 5. Check if two servers with and without fragmentation enabled are able to exchange messages and still comunicate with each other.
|
|
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB) ENGINE=InnoDB;
|
|
|
|
# This will trigger on the wire fragmentation since we are generating a row
|
|
# larger than the fragment threshold
|
|
--eval INSERT INTO t1 VALUES(1, REPEAT('A', $double_sound_threshold))
|
|
|
|
# This will not be fragmented on the wire
|
|
--eval INSERT INTO t1 VALUES(2, 'B')
|
|
|
|
--let $rpl_connection_name= server2
|
|
--source include/rpl_connection.inc
|
|
|
|
--source include/rpl_sync.inc
|
|
|
|
# Assert that fragmentation is disabled on server2 given that we had set
|
|
# threshold to 0 earlier in the test
|
|
--let $threshold= `SELECT @@group_replication_communication_max_message_size`
|
|
--let $assert_cond= $threshold = 0
|
|
--let $assert_text= Assert that the communication_max_message_size is disabled
|
|
--source include/assert.inc
|
|
|
|
# Server2 has fragmentation disabled, so lets see if it
|
|
# is able to speak with server1 which has fragmentation on
|
|
--eval INSERT INTO t1 VALUES(3, REPEAT('C', $double_sound_threshold))
|
|
|
|
--source include/rpl_sync.inc
|
|
|
|
# Assert that the data made it through
|
|
--let $diff_tables= server1:test.t1,server2:test.t1
|
|
--source include/diff_tables.inc
|
|
|
|
--echo #########################################################################
|
|
--echo # 6, Confirm, in the error log, the servers start with the expected fragmentation threshold.
|
|
# Assert that GR on server1 was started with fragmentation enabled
|
|
# It was only started once
|
|
--let $assert_file=$MYSQLTEST_VARDIR/tmp/group_replication_fragmentation_options_mysqld.1.err
|
|
--let $assert_text= Fragmentation was active and logged to the error log
|
|
--let $assert_select=.*group_replication_communication_max_message_size: $sound_threshold.*
|
|
--let $assert_count= 1
|
|
--source include/assert_grep.inc
|
|
|
|
# Assert that GR on server1 was never started with fragmentation disabled
|
|
--let $assert_file=$MYSQLTEST_VARDIR/tmp/group_replication_fragmentation_options_mysqld.1.err
|
|
--let $assert_text= Fragmentation was disabled and logged to the error log
|
|
--let $assert_select=.*group_replication_communication_max_message_size: 0.*
|
|
--let $assert_count= 0
|
|
--source include/assert_grep.inc
|
|
|
|
# Assert that GR on server2 was never started with fragmentation enabled
|
|
--let $assert_file=$MYSQLTEST_VARDIR/tmp/group_replication_fragmentation_options_mysqld.2.err
|
|
--let $assert_text= Fragmentation was always disabled
|
|
--let $assert_select=.*group_replication_communication_max_message_size: 0.*
|
|
--let $assert_count= 1
|
|
--source include/assert_grep.inc
|
|
|
|
--echo #########################################################################
|
|
--echo # Clean up
|
|
DROP TABLE t1;
|
|
|
|
--source include/rpl_sync.inc
|
|
|
|
# restore server1
|
|
--let $rpl_connection_name= server1
|
|
--source include/rpl_connection.inc
|
|
|
|
--source include/stop_group_replication.inc
|
|
--replace_result $saved_threshold_1 SAVED_VALUE
|
|
--eval SET GLOBAL group_replication_communication_max_message_size= $saved_threshold_1
|
|
--replace_result $saved_compression_1 SAVED_VALUE
|
|
--eval SET GLOBAL group_replication_compression_threshold= $saved_compression_1
|
|
--source include/start_group_replication.inc
|
|
|
|
# restore server2
|
|
--let $rpl_connection_name= server2
|
|
--source include/rpl_connection.inc
|
|
|
|
--source include/stop_group_replication.inc
|
|
--replace_result $saved_threshold_2 SAVED_VALUE
|
|
--eval SET GLOBAL group_replication_communication_max_message_size= $saved_threshold_2
|
|
--replace_result $saved_compression_2 SAVED_VALUE
|
|
--eval SET GLOBAL group_replication_compression_threshold= $saved_compression_2
|
|
--source include/start_group_replication.inc
|
|
|
|
# (looney toons music) th-th-th-that's all folks!
|
|
--source include/group_replication_end.inc
|