config root man

Current Path : /usr/opt/mysql57/mysql-test/suite/group_replication/t/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/mysql57/mysql-test/suite/group_replication/t/gr_xplugin_global_variables.test

###############################################################################
# Basic test to set the group replication variables and verify if the GR
# variables are set correctly using xplugin (x prototcol)
#
# NOTE : All the queries through mysqlx plugin is passed using mysqlxtest.
#
# Test:
# 0. This test requires one server.
# 1. Verify that all the group replication variables are GLOBAL variables.
# 2. Copy the original Values of GR variables.
# 3. Set/Modify the GR variables.
# 4. Assert all the modified variables.
# 5. Clean-up
###############################################################################

--source include/have_mysqlx_plugin.inc
--source ../inc/have_group_replication_plugin_base.inc

--let plugins= MYSQLXPLUGIN,GROUP_REPLICATION
--source include/check_plugin_dir.inc

## This initial setup starts three servers with all the prerequisites required
## for GR to start

--source ../inc/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--let $rpl_server_count= 2
--source ../inc/group_replication.inc

## Install Mysqlx plugin on all servers and fetch the mysqlx_port to the local
## variables

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @@GLOBAL.group_replication_ip_whitelist= "AUTOMATIC";
--source ../inc/start_and_bootstrap_group_replication.inc
--replace_regex /\.dll/.so/
--eval INSTALL PLUGIN mysqlx SONAME '$MYSQLXPLUGIN'
--let $mysqlx_port1= `Select @@Global.mysqlx_port`

--let $group_replication_group_seeds=`SELECT @@GLOBAL.group_replication_group_seeds`
--let $group_replication_local_address=`SELECT @@GLOBAL.group_replication_local_address`

--let $xcom_port = `SELECT SUBSTR("$group_replication_local_address",11,5)`

## Verify the default values of some of the GLOBAL variables whose values are independent of the MTR enviroment

--let $assert_text= group_replication_allow_local_disjoint_gtids_join is OFF
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_allow_local_disjoint_gtids_join]" = "0"
--source include/assert.inc

--let $assert_text= group_replication_allow_local_lower_version_join is OFF
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_allow_local_lower_version_join]" = "0"
--source include/assert.inc

--let $assert_text= group_replication_auto_increment_increment is 7
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_auto_increment_increment]" = "7"
--source include/assert.inc

--let $assert_text= group_replication_components_stop_timeout is 31536000
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_components_stop_timeout]" = "31536000"
--source include/assert.inc

--let $assert_text= group_replication_compression_threshold is 1000000
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_compression_threshold]" = "1000000"
--source include/assert.inc

--let $assert_text= group_replication_enforce_update_everywhere_checks is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks]" = "1"
--source include/assert.inc

--let $assert_text= group_replication_flow_control_applier_threshold is 25000
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_flow_control_applier_threshold]" = "25000"
--source include/assert.inc

--let $assert_text= group_replication_flow_control_certifier_threshold is 25000
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_flow_control_certifier_threshold]" = "25000"
--source include/assert.inc

--let $assert_text= group_replication_flow_control_mode is QUOTA
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_flow_control_mode]" = "QUOTA"
--source include/assert.inc

--let $assert_text= group_replication_ip_whitelist is AUTOMATIC
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ip_whitelist]" = "AUTOMATIC"
--source include/assert.inc

--let $assert_text= group_replication_poll_spin_loops is 0
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_poll_spin_loops]" = "0"
--source include/assert.inc

--let $assert_text= group_replication_recovery_complete_at is TRANSACTIONS_APPLIED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_complete_at]" = "TRANSACTIONS_APPLIED"
--source include/assert.inc

--let $assert_text= group_replication_recovery_reconnect_interval is 60
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_reconnect_interval]" = "60"
--source include/assert.inc

--let $assert_text= group_replication_recovery_retry_count is 10
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_retry_count]" = "10"
--source include/assert.inc

--let $assert_text= group_replication_start_on_boot is OFF
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_start_on_boot]" = "0"
--source include/assert.inc

--let $assert_text= group_replication_single_primary_mode is OFF
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_single_primary_mode]" = "0"
--source include/assert.inc

## Save the original values of each GLOBAL variable

--source include/stop_group_replication.inc

SET @group_replication_allow_local_disjoint_gtids_join_save= @@GLOBAL.group_replication_allow_local_disjoint_gtids_join;
SET @group_replication_allow_local_lower_version_join_save= @@GLOBAL.group_replication_allow_local_lower_version_join;
SET @group_replication_auto_increment_increment_save= @@GLOBAL.group_replication_auto_increment_increment;
SET @group_replication_components_stop_timeout_save= @@GLOBAL.group_replication_components_stop_timeout;
SET @group_replication_compression_threshold_save= @@GLOBAL.group_replication_compression_threshold;
SET @group_replication_enforce_update_everywhere_checks_save= @@GLOBAL.group_replication_enforce_update_everywhere_checks;
SET @group_replication_flow_control_applier_threshold_save= @@GLOBAL.group_replication_flow_control_applier_threshold;
SET @group_replication_flow_control_certifier_threshold_save= @@GLOBAL.group_replication_flow_control_certifier_threshold;
SET @group_replication_flow_control_mode_save= @@GLOBAL.group_replication_flow_control_mode;
SET @group_replication_group_name_save= @@GLOBAL.group_replication_group_name;
SET @group_replication_gtid_assignment_block_size_save= @@GLOBAL.group_replication_gtid_assignment_block_size;
SET @group_replication_group_seeds_save= @@GLOBAL.group_replication_group_seeds;
SET @group_replication_local_address_save= @@GLOBAL.group_replication_local_address;
SET @group_replication_poll_spin_loops_save= @@GLOBAL.group_replication_poll_spin_loops;
SET @group_replication_recovery_complete_at_save= @@GLOBAL.group_replication_recovery_complete_at;
SET @group_replication_recovery_reconnect_interval_save= @@GLOBAL.group_replication_recovery_reconnect_interval;
SET @group_replication_recovery_retry_count_save= @@GLOBAL.group_replication_recovery_retry_count;
SET @group_replication_recovery_ssl_ca_save= @@GLOBAL.group_replication_recovery_ssl_ca;
SET @group_replication_recovery_ssl_capath_save= @@GLOBAL.group_replication_recovery_ssl_capath;
SET @group_replication_recovery_ssl_cert_save= @@GLOBAL.group_replication_recovery_ssl_cert;
SET @group_replication_recovery_ssl_cipher_save= @@GLOBAL.group_replication_recovery_ssl_cipher;
SET @group_replication_recovery_ssl_crl_save= @@GLOBAL.group_replication_recovery_ssl_crl;
SET @group_replication_recovery_ssl_crlpath_save= @@GLOBAL.group_replication_recovery_ssl_crlpath;
SET @group_replication_recovery_ssl_key_save= @@GLOBAL.group_replication_recovery_ssl_key;
SET @group_replication_recovery_ssl_verify_server_cert_save= @@GLOBAL.group_replication_recovery_ssl_verify_server_cert;
SET @group_replication_recovery_use_ssl_save= @@GLOBAL.group_replication_recovery_use_ssl;
SET @group_replication_single_primary_mode_save= @@GLOBAL.group_replication_single_primary_mode;
SET @group_replication_ssl_mode_save= @@GLOBAL.group_replication_ssl_mode;
SET @group_replication_start_on_boot_save= @@GLOBAL.group_replication_start_on_boot;

## Set the GR Variables

--write_file $MYSQL_TMP_DIR/set_variables.tmp
-->sql
SET GLOBAL group_replication_allow_local_disjoint_gtids_join= ON;
SET GLOBAL group_replication_allow_local_lower_version_join= ON;
SET GLOBAL group_replication_auto_increment_increment= 5;
SET GLOBAL group_replication_bootstrap_group= 1;
SET GLOBAL group_replication_components_stop_timeout= 10;
SET GLOBAL group_replication_compression_threshold= 10;
SET GLOBAL group_replication_enforce_update_everywhere_checks= OFF;
SET GLOBAL group_replication_flow_control_applier_threshold= 50000;
SET GLOBAL group_replication_flow_control_certifier_threshold= 50000;
SET GLOBAL group_replication_flow_control_mode= "DISABLED";
SET GLOBAL group_replication_force_members= "";
SET GLOBAL group_replication_group_name= "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab";
SET GLOBAL group_replication_group_seeds= CONCAT("127.0.0.1:",%XCOM_PORT%);
SET GLOBAL group_replication_gtid_assignment_block_size= 2;
SET GLOBAL group_replication_ip_whitelist= "AUTOMATIC";
SET GLOBAL group_replication_local_address= CONCAT("127.0.0.1:",%XCOM_PORT%);
SET GLOBAL group_replication_poll_spin_loops= 10;
SET GLOBAL group_replication_recovery_complete_at= TRANSACTIONS_CERTIFIED;
SET GLOBAL group_replication_recovery_reconnect_interval= 20;
SET GLOBAL group_replication_recovery_retry_count= 5;
-->endsql
-->varsub %TEST_DIR%
-->sql
SET GLOBAL group_replication_recovery_ssl_ca= '%TEST_DIR%/std_data/cacert.pem';
-->endsql
-->varsub %TEST_DIR%
-->sql
SET GLOBAL group_replication_recovery_ssl_capath= '%TEST_DIR%/std_data';
-->endsql
-->varsub %TEST_DIR%
-->sql
SET GLOBAL group_replication_recovery_ssl_cert= '%TEST_DIR%/std_data/client-cert.pem';
-->endsql
-->sql
SET GLOBAL group_replication_recovery_ssl_cipher= 'DHE-RSA-AES256-SHA';
SET GLOBAL group_replication_recovery_ssl_crl= 'crl-client-revoked.crl';
-->endsql
-->varsub %TEST_DIR%
-->sql
SET GLOBAL group_replication_recovery_ssl_crlpath= '%TEST_DIR%/std_data';
-->endsql
-->varsub %TEST_DIR%
-->sql
SET GLOBAL group_replication_recovery_ssl_key= '%TEST_DIR%/std_data/client-key.pem';
SET GLOBAl group_replication_recovery_ssl_verify_server_cert= ON;
SET GLOBAL group_replication_recovery_use_ssl= ON;
SET GLOBAL group_replication_single_primary_mode= ON;
SET GLOBAL group_replication_ssl_mode= "VERIFY_CA";
SET GLOBAL group_replication_start_on_boot= ON;
-->endsql
EOF

--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $xcom_port xcom_port
--exec $MYSQLXTEST -u root --port=$mysqlx_port1 --file=$MYSQL_TMP_DIR/set_variables.tmp -v %TEST_DIR%=$MYSQL_TEST_DIR -v %XCOM_PORT%=$xcom_port 2>&1

## Start GR

## Using start gr command instead of start_group_replication.inc since
## it resets the Group name set above.

--source include/start_group_replication_command.inc

--let $assert_text= group_replication_allow_local_disjoint_gtids_join is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_allow_local_disjoint_gtids_join]" = "1"
--source include/assert.inc

--let $assert_text= group_replication_allow_local_lower_version_join is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_allow_local_lower_version_join]" = "1"
--source include/assert.inc

--let $assert_text= group_replication_auto_increment_increment is 5
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_auto_increment_increment]" = "5"
--source include/assert.inc

--let $assert_text= group_replication_components_stop_timeout is 10
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_components_stop_timeout]" = "10"
--source include/assert.inc

--let $assert_text= group_replication_compression_threshold is 10
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_compression_threshold]" = "10"
--source include/assert.inc

--let $assert_text= group_replication_enforce_update_everywhere_checks is OFF
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_enforce_update_everywhere_checks]" = "0"
--source include/assert.inc

--let $assert_text= group_replication_flow_control_applier_threshold is 50000
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_flow_control_applier_threshold]" = "50000"
--source include/assert.inc

--let $assert_text= group_replication_flow_control_certifier_threshold is 50000
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_flow_control_certifier_threshold]" = "50000"
--source include/assert.inc

--let $assert_text= group_replication_flow_control_mode is DISABLED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_flow_control_mode]" = "DISABLED"
--source include/assert.inc

--let $assert_text= group_replication_force_members is ""
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_force_members]" = ""
--source include/assert.inc

--let $assert_text= group_replication_group_name is aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_group_name]" = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaab"
--source include/assert.inc

--let $assert_text= group_replication_group_seeds is 127.0.0.1:xcom_port
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_group_seeds]" = "127.0.0.1:$xcom_port"
--source include/assert.inc

--let $assert_text= group_replication_gtid_assignment_block_size is 2
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_gtid_assignment_block_size]" = "2"
--source include/assert.inc

--let $assert_text= group_replication_ip_whitelist is AUTOMATIC
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ip_whitelist]" = "AUTOMATIC"
--source include/assert.inc

--let $assert_text= group_replication_local_address is 127.0.0.1:xcom_port
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_local_address]" = "127.0.0.1:$xcom_port"
--source include/assert.inc

--let $assert_text= group_replication_recovery_complete_at is TRANSACTIONS_CERTIFIED
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_complete_at]" = "TRANSACTIONS_CERTIFIED"
--source include/assert.inc

--let $assert_text= group_replication_recovery_reconnect_interval is 20
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_reconnect_interval]" = "20"
--source include/assert.inc

--let $assert_text= group_replication_recovery_retry_count is 5
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_retry_count]" = "5"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_ca is MYSQL_TEST_DIR/std_data/cacert.pem
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_ca]" = "$MYSQL_TEST_DIR/std_data/cacert.pem"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_capath is MYSQL_TEST_DIR/std_data
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_capath]" = "$MYSQL_TEST_DIR/std_data"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_cert is MYSQL_TEST_DIR/std_data/client-cert.pem
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_cert]" = "$MYSQL_TEST_DIR/std_data/client-cert.pem"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_cipher is DHE-RSA-AES256-SHA
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_cipher]" = "DHE-RSA-AES256-SHA"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_crl is crl-client-revoked.crl
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_crl]" = "crl-client-revoked.crl"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_crlpath is MYSQL_TEST_DIR/std_data
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_crlpath]" = "$MYSQL_TEST_DIR/std_data"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_key is MYSQL_TEST_DIR/std_data/client-key.pem
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_key]" = "$MYSQL_TEST_DIR/std_data/client-key.pem"
--source include/assert.inc

--let $assert_text= group_replication_recovery_ssl_verify_server_cert is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_ssl_verify_server_cert]" = "1"
--source include/assert.inc

--let $assert_text= group_replication_recovery_use_ssl is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_recovery_use_ssl]" = "1"
--source include/assert.inc

--let $assert_text= group_replication_single_primary_mode is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_single_primary_mode]" = "1"
--source include/assert.inc

--let $assert_text= group_replication_start_on_boot is ON
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_start_on_boot]" = "1"
--source include/assert.inc

--let $assert_text= group_replication_ssl_mode is VERIFY_CA
--let $assert_cond= "[SELECT @@GLOBAL.group_replication_ssl_mode]" = "VERIFY_CA"
--source include/assert.inc

--source include/stop_group_replication.inc

## Modify the GLOBAL variables to its original value

SET GLOBAL group_replication_allow_local_disjoint_gtids_join= @group_replication_allow_local_disjoint_gtids_join_save;
SET GLOBAL group_replication_allow_local_lower_version_join= @group_replication_allow_local_lower_version_join_save;
SET GLOBAL group_replication_auto_increment_increment= @group_replication_auto_increment_increment_save;
SET GLOBAL group_replication_components_stop_timeout= @group_replication_components_stop_timeout_save;
SET GLOBAL group_replication_compression_threshold= @group_replication_compression_threshold_save;
SET GLOBAL group_replication_flow_control_applier_threshold= @group_replication_flow_control_applier_threshold_save;
SET GLOBAL group_replication_flow_control_certifier_threshold= @group_replication_flow_control_certifier_threshold_save;
SET GLOBAL group_replication_flow_control_mode= @group_replication_flow_control_mode_save;
SET GLOBAL group_replication_group_name =@group_replication_group_name_save;
SET GLOBAL group_replication_group_seeds= @group_replication_group_seeds_save;
SET GLOBAL group_replication_gtid_assignment_block_size= @group_replication_gtid_assignment_block_size_save;
SET GLOBAL group_replication_local_address= @group_replication_local_address_save;
SET GLOBAL group_replication_group_seeds= @group_replication_group_seeds_save;
SET GLOBAL group_replication_recovery_complete_at= @group_replication_recovery_complete_at_save;
SET GLOBAL group_replication_poll_spin_loops= @group_replication_poll_spin_loops_save;
SET GLOBAL group_replication_recovery_reconnect_interval= @group_replication_recovery_reconnect_interval_save;
SET GLOBAL group_replication_recovery_retry_count= @group_replication_recovery_retry_count_save;
SET GLOBAL group_replication_recovery_ssl_ca= @group_replication_recovery_ssl_ca_save;
SET GLOBAL group_replication_recovery_ssl_capath= @group_replication_recovery_ssl_capath_save;
SET GLOBAL group_replication_recovery_ssl_cert= @group_replication_recovery_ssl_cert_save;
SET GLOBAL group_replication_recovery_ssl_cipher= @group_replication_recovery_ssl_cipher_save;
SET GLOBAL group_replication_recovery_ssl_crl= @group_replication_recovery_ssl_crl_save;
SET GLOBAL group_replication_recovery_ssl_crlpath= @group_replication_recovery_ssl_crlpath_save;
SET GLOBAL group_replication_recovery_ssl_key= @group_replication_recovery_ssl_key_save;
SET GLOBAL group_replication_recovery_ssl_verify_server_cert= @group_replication_recovery_ssl_verify_server_cert_save;
SET GLOBAL group_replication_recovery_use_ssl= @group_replication_recovery_use_ssl_save;
SET GLOBAL group_replication_single_primary_mode= @group_replication_single_primary_mode_save;
SET GLOBAL group_replication_ssl_mode= @group_replication_ssl_mode_save;
SET GLOBAL group_replication_start_on_boot= @group_replication_start_on_boot_save;
SET GLOBAL group_replication_enforce_update_everywhere_checks= @group_replication_enforce_update_everywhere_checks_save;

## Start GR

## See if GR is able to start after resetting the values.
--source ../inc/start_and_bootstrap_group_replication.inc
--source include/stop_group_replication.inc

--let $rpl_connection_name= server1
--source include/rpl_connection.inc
UNINSTALL PLUGIN mysqlx;

## Clean-up

--remove_file $MYSQL_TMP_DIR/set_variables.tmp
--source ../inc/group_replication_end.inc

Man Man