summaryrefslogtreecommitdiff
path: root/mysql-test/suite/wsrep
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2021-01-19 10:00:05 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-01-21 11:41:29 +0200
commitbe5fce16a0d4104b216818438ca624bfaa19497a (patch)
treeadf181973fad34ffa10c19d22e33fbbb7cfd872b /mysql-test/suite/wsrep
parent9377e9ba0c8c2b6a89d47e545eb292a6973ad2fb (diff)
downloadmariadb-git-be5fce16a0d4104b216818438ca624bfaa19497a.tar.gz
MDEV-24596 : Assertion `state_ == s_exec || state_ == s_quitting' failed in wsrep::client_state::disable_streaming
There were multiple problems here * wsrep_trx_fragment_size should not be set when wsrep is disabled or provider is not loaded * wsrep_trx_fragment_unit should not be set when wsrep is disabled or provider is not loaded * wsrep_debug has no effect if wsrep is disabled or provider is not loaded * wsrep_start_position should not be set when wsrep is disabled or provider is not loaded any other value than default * wsrep_start_position should be changed only when we are joiner or initialized * wsrep_start_position should be allowed to set only a value that exits, thus we need to add error handling to wsrep_sst_complete
Diffstat (limited to 'mysql-test/suite/wsrep')
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result44
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_variables_wsrep_off.result39
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf12
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test38
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf12
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test30
6 files changed, 175 insertions, 0 deletions
diff --git a/mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result b/mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result
new file mode 100644
index 00000000000..ad35dc8dbcd
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/wsrep_variables_no_provider.result
@@ -0,0 +1,44 @@
+SELECT @@wsrep_on;
+@@wsrep_on
+1
+SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads;
+SET @wsrep_debug_saved = @@global.wsrep_debug;
+SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
+SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address;
+SET GLOBAL wsrep_provider=none;
+SET SESSION wsrep_trx_fragment_size=DEFAULT;
+ERROR HY000: Incorrect arguments to SET
+SELECT @@session.wsrep_trx_fragment_size;
+@@session.wsrep_trx_fragment_size
+0
+SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100'
+SHOW WARNINGS;
+Level Code Message
+Warning 1231 Cannot set 'wsrep_start_position' because wsrep is switched off or provider is not loaded
+Error 1231 Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100'
+SELECT @@global.wsrep_start_position;
+@@global.wsrep_start_position
+00000000-0000-0000-0000-000000000000:-1
+SET GLOBAL wsrep_debug=1;
+Warnings:
+Warning 1231 Setting 'wsrep_debug' has no effect because wsrep is switched off
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+NONE
+SET GLOBAL wsrep_slave_threads=5;
+SELECT @@global.wsrep_slave_threads;
+@@global.wsrep_slave_threads
+5
+SET GLOBAL wsrep_desync=1;
+ERROR HY000: WSREP (galera) not started
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+SET SESSION wsrep_trx_fragment_unit='rows';
+ERROR HY000: Incorrect arguments to SET
+SELECT @@session.wsrep_trx_fragment_unit;
+@@session.wsrep_trx_fragment_unit
+rows
+SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved;
+SET @@global.wsrep_debug = @wsrep_debug_saved;
diff --git a/mysql-test/suite/wsrep/r/wsrep_variables_wsrep_off.result b/mysql-test/suite/wsrep/r/wsrep_variables_wsrep_off.result
new file mode 100644
index 00000000000..7cae89eae8e
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/wsrep_variables_wsrep_off.result
@@ -0,0 +1,39 @@
+SELECT @@wsrep_on;
+@@wsrep_on
+0
+SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads;
+SET @wsrep_debug_saved = @@global.wsrep_debug;
+SET SESSION wsrep_trx_fragment_size=DEFAULT;
+ERROR HY000: Incorrect arguments to SET
+SELECT @@session.wsrep_trx_fragment_size;
+@@session.wsrep_trx_fragment_size
+0
+SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100';
+ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100'
+SHOW WARNINGS;
+Level Code Message
+Warning 1231 Cannot set 'wsrep_start_position' because wsrep is switched off or provider is not loaded
+Error 1231 Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:100'
+SELECT @@global.wsrep_start_position;
+@@global.wsrep_start_position
+00000000-0000-0000-0000-000000000000:-1
+SET GLOBAL wsrep_debug=1;
+Warnings:
+Warning 1231 Setting 'wsrep_debug' has no effect because wsrep is switched off
+SELECT @@global.wsrep_debug;
+@@global.wsrep_debug
+NONE
+SET GLOBAL wsrep_slave_threads=5;
+SELECT @@global.wsrep_slave_threads;
+@@global.wsrep_slave_threads
+5
+SET GLOBAL wsrep_desync=1;
+ERROR HY000: WSREP (galera) not started
+SELECT @@global.wsrep_desync;
+@@global.wsrep_desync
+0
+SET SESSION wsrep_trx_fragment_unit='rows';
+ERROR HY000: Incorrect arguments to SET
+SELECT @@session.wsrep_trx_fragment_unit;
+@@session.wsrep_trx_fragment_unit
+rows
diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf
new file mode 100644
index 00000000000..b73146d26e7
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.cnf
@@ -0,0 +1,12 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld.1]
+wsrep-on=ON
+binlog-format=ROW
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep-cluster-address='gcomm://'
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test
new file mode 100644
index 00000000000..b44c9c5ebc8
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_variables_no_provider.test
@@ -0,0 +1,38 @@
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+SELECT @@wsrep_on;
+
+SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads;
+SET @wsrep_debug_saved = @@global.wsrep_debug;
+SET @wsrep_provider_options_saved= @@global.wsrep_provider_options;
+SET @wsrep_cluster_address_saved= @@global.wsrep_cluster_address;
+
+SET GLOBAL wsrep_provider=none;
+
+--error ER_WRONG_ARGUMENTS
+SET SESSION wsrep_trx_fragment_size=DEFAULT;
+SELECT @@session.wsrep_trx_fragment_size;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100';
+SHOW WARNINGS;
+SELECT @@global.wsrep_start_position;
+SET GLOBAL wsrep_debug=1;
+SELECT @@global.wsrep_debug;
+SET GLOBAL wsrep_slave_threads=5;
+SELECT @@global.wsrep_slave_threads;
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_desync=1;
+SELECT @@global.wsrep_desync;
+--error ER_WRONG_ARGUMENTS
+SET SESSION wsrep_trx_fragment_unit='rows';
+SELECT @@session.wsrep_trx_fragment_unit;
+
+--disable_query_log
+eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
+SET GLOBAL wsrep_cluster_address= @wsrep_cluster_address_saved;
+SET GLOBAL wsrep_provider_options= @wsrep_provider_options_saved;
+--source include/galera_wait_ready.inc
+SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved;
+SET @@global.wsrep_debug = @wsrep_debug_saved;
+--enable_query_log
diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf
new file mode 100644
index 00000000000..2e66b1ef23c
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf
@@ -0,0 +1,12 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+wsrep-on=OFF
+
+[mysqld.1]
+wsrep-on=OFF
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test
new file mode 100644
index 00000000000..4a9cd2bad5f
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.test
@@ -0,0 +1,30 @@
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+SELECT @@wsrep_on;
+
+SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads;
+SET @wsrep_debug_saved = @@global.wsrep_debug;
+
+--error ER_WRONG_ARGUMENTS
+SET SESSION wsrep_trx_fragment_size=DEFAULT;
+SELECT @@session.wsrep_trx_fragment_size;
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL wsrep_start_position='12345678-1234-1234-1234-123456789012:100';
+SHOW WARNINGS;
+SELECT @@global.wsrep_start_position;
+SET GLOBAL wsrep_debug=1;
+SELECT @@global.wsrep_debug;
+SET GLOBAL wsrep_slave_threads=5;
+SELECT @@global.wsrep_slave_threads;
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_desync=1;
+SELECT @@global.wsrep_desync;
+--error ER_WRONG_ARGUMENTS
+SET SESSION wsrep_trx_fragment_unit='rows';
+SELECT @@session.wsrep_trx_fragment_unit;
+
+--disable_query_log
+SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved;
+SET @@global.wsrep_debug = @wsrep_debug_saved;
+--enable_query_log