From 71806bf37c45d5490d8382cba6a5cca6879fa0db Mon Sep 17 00:00:00 2001 From: Stepan Patryshev Date: Tue, 15 Dec 2020 18:05:56 +0200 Subject: MDEV-24414 Update and enable galera.galera_defaults --- mysql-test/suite/galera/disabled.def | 1 - mysql-test/suite/galera/t/galera_defaults.test | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'mysql-test/suite/galera') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index dd1721839e0..0692a02c7b0 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -14,7 +14,6 @@ MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-329 : MDEV-19962 Galera test failure on MW-329 -galera.galera_defaults : MDEV-21494 Galera test sporadic failure on galera.galera_defaults galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc galera_gcache_recover_manytrx : MDEV-18834 Galera test failure diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test index 3d4a7da7b54..a9e10de0176 100644 --- a/mysql-test/suite/galera/t/galera_defaults.test +++ b/mysql-test/suite/galera/t/galera_defaults.test @@ -13,7 +13,7 @@ # Make sure that the test is operating on the right version of galera library. --disable_query_log ---let $galera_version=25.3.20 +--let $galera_version=25.3.31 source ../wsrep/include/check_galera_version.inc; --enable_query_log -- cgit v1.2.1 From dc62a67ed3e7d5dcfb125f3e718adff40c17f764 Mon Sep 17 00:00:00 2001 From: Stepan Patryshev Date: Tue, 15 Dec 2020 18:05:59 +0200 Subject: MDEV-24414 Update and enable galera.galera_defaults --- mysql-test/suite/galera/disabled.def | 1 - mysql-test/suite/galera/t/galera_defaults.test | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'mysql-test/suite/galera') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 4d911c60a5e..f53fbd2b08c 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -14,7 +14,6 @@ MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently MW-328A : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-328B : MDEV-22666 galera.MW-328A MTR failed: "Semaphore wait has lasted > 600 seconds" and do not release port 16002 MW-329 : MDEV-19962 Galera test failure on MW-329 -galera.galera_defaults : MDEV-21494 Galera test sporadic failure on galera.galera_defaults galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() galera_binlog_stmt_autoinc : MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc galera_gcache_recover_manytrx : MDEV-18834 Galera test failure diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test index 3d4a7da7b54..a9e10de0176 100644 --- a/mysql-test/suite/galera/t/galera_defaults.test +++ b/mysql-test/suite/galera/t/galera_defaults.test @@ -13,7 +13,7 @@ # Make sure that the test is operating on the right version of galera library. --disable_query_log ---let $galera_version=25.3.20 +--let $galera_version=25.3.31 source ../wsrep/include/check_galera_version.inc; --enable_query_log -- cgit v1.2.1 From c742346e5041d85caaf30d2d6c10369603ad09ad Mon Sep 17 00:00:00 2001 From: Stepan Patryshev Date: Wed, 16 Dec 2020 18:29:06 +0200 Subject: TODO-2697 Enable galera.lp1376747-4 on 10.3 CS --- mysql-test/suite/galera/disabled.def | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test/suite/galera') diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 0692a02c7b0..87dbb7a6487 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -23,7 +23,6 @@ galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key galera_var_node_address : MDEV-20485 Galera test failure galera_wan : MDEV-17259 Test failure on galera.galera_wan -lp1376747-4 : MDEV-21911 Galera test failure on lp1376747-4 partition : MDEV-19958 Galera test failure on galera.partition query_cache: MDEV-15805 Test failure on galera.query_cache sql_log_bin : MDEV-21491 galera.sql_log_bin -- cgit v1.2.1 From 87fa6d2c5c74338bcba8254a663400b49840172e Mon Sep 17 00:00:00 2001 From: sjaakola Date: Wed, 2 Dec 2020 17:28:49 +0200 Subject: MDEV-24327 wsrep XID checkpointing order with log_slave_updates=OFF If log_slave_updates==OFF, wsrep applier threads used to be configured with option: thd->variables.option_bits&= ~(OPTION_BIN_LOG); (i.e. like sql_log_bin=ON). And this was regardless of log-bin configuration. With this, having configuration of: --log-bin && --log-slave-updates=OFF, local threads used binlogging, but applier threads did not. And further: local threads went through binlog group commit, while applier threads did direct commits. This resulted in situation, where applier threads entered earlier in wsrep XID checkpointing, and could sync their wsrep XID out of order. Later local thread commit would see that higher seqno was already checkpointed, and fire an assert because of this. As a fix, applier threads are now forced to enable binlogging regardless of log-slave-updates configuration. This PR comes with new mtr test: galera.MDEV-24327, which causes a scenario where applier transaction is applied and committed while earlier local transaction is parked before commit order monitor enter. A buggy mariadb versoin would fail for assertion because of wsrep XID checkpoint order violation. --- mysql-test/suite/galera/r/MDEV-24327.result | 35 ++++++++++++ mysql-test/suite/galera/t/MDEV-24327.cnf | 6 ++ mysql-test/suite/galera/t/MDEV-24327.test | 87 +++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 mysql-test/suite/galera/r/MDEV-24327.result create mode 100644 mysql-test/suite/galera/t/MDEV-24327.cnf create mode 100644 mysql-test/suite/galera/t/MDEV-24327.test (limited to 'mysql-test/suite/galera') diff --git a/mysql-test/suite/galera/r/MDEV-24327.result b/mysql-test/suite/galera/r/MDEV-24327.result new file mode 100644 index 00000000000..d309749efa4 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-24327.result @@ -0,0 +1,35 @@ +connection node_2; +connection node_1; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +INSERT INTO t1 VALUES (1, 'f'); +INSERT INTO t1 VALUES (2, 'g'); +connection node_1; +SET AUTOCOMMIT=ON; +START TRANSACTION; +UPDATE t1 SET f2 = '1' WHERE f1 = 1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_sync_wait=0; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_master_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_2; +UPDATE t1 SET f2 = '2' WHERE f1 = 2; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_1; +SELECT * FROM t1; +f1 f2 +1 1 +2 2 +"node 1 is complete now" +connection node_2; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-24327.cnf b/mysql-test/suite/galera/t/MDEV-24327.cnf new file mode 100644 index 00000000000..390a9aab0f4 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-24327.cnf @@ -0,0 +1,6 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin=mariadb-bin +log-slave-updates=OFF + diff --git a/mysql-test/suite/galera/t/MDEV-24327.test b/mysql-test/suite/galera/t/MDEV-24327.test new file mode 100644 index 00000000000..7aeffea11fa --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-24327.test @@ -0,0 +1,87 @@ +# +# MDEV-24327 wsrep XID checkpointing order violation with log_slave_updates=OFF +# +# Here we have configure two node cluster with --log-bin=ON and --log-slave_-updates=OFF +# +# a transaction in node executes so far that it has replicated and reached +# commit phase, We have sync point before entering commit order monitor and +# the transaction is parked there +# +# Then another transaction is executed in node 2, it replicates and commits in node 2 +# and is received and applied in node 1. After applying it will remain waiting for +# commit order monitor, as it has later seqno than the first transaction in node 1. +# +# control connection in node 1 waits to see the +# +# With the buggy version of MDEV-24327, the applier has however, already synced the +# wsrep XID checkpoint +# +# +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +INSERT INTO t1 VALUES (1, 'f'); +INSERT INTO t1 VALUES (2, 'g'); + +--connection node_1 +SET AUTOCOMMIT=ON; +START TRANSACTION; + +UPDATE t1 SET f2 = '1' WHERE f1 = 1; + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET SESSION wsrep_sync_wait=0; +--connection node_1a +--let $expected_wsrep_received = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received'` +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# Block the commit, send the COMMIT and wait until it gets blocked + +--let $galera_sync_point = commit_monitor_master_enter_sync +--source include/galera_set_sync_point.inc + +--connection node_1 +--send COMMIT + +--connection node_1a + +# wait for the commit to block in sync point + +--let $galera_sync_point = commit_monitor_master_enter_sync +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# +# replicate non conflicting transaction from node 2 +# it will get later seqno and should sync XID checkpoint after transaction in node 1 +# +--connection node_2 +UPDATE t1 SET f2 = '2' WHERE f1 = 2; + +# +# wait until update from node 2 has been committed +# if XID checkpointing order was violated, node 1 would crash for assert +# + +--connection node_1a +--let $wait_condition = SELECT VARIABLE_VALUE = $expected_wsrep_received FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received' +--source include/wait_condition.inc + +--let $galera_sync_point = commit_monitor_master_enter_sync +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +--connection node_1 +--reap +SELECT * FROM t1; +--echo "node 1 is complete now" + + +--connection node_2 +DROP TABLE t1; -- cgit v1.2.1 From 2cb5fb6019f4ea10106d9059307b2dbf9b9605e8 Mon Sep 17 00:00:00 2001 From: sjaakola Date: Wed, 2 Dec 2020 17:28:49 +0200 Subject: MDEV-24327 wsrep XID checkpointing order with log_slave_updates=OFF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If log_slave_updates==OFF, wsrep applier threads used to be configured with option: thd->variables.option_bits&= ~(OPTION_BIN_LOG); (i.e. like sql_log_bin=ON). And this was regardless of log-bin configuration. With this, having configuration of: --log-bin && --log-slave-updates=OFF, local threads used binlogging, but applier threads did not. And further: local threads went through binlog group commit, while applier threads did direct commits. This resulted in situation, where applier threads entered earlier in wsrep XID checkpointing, and could sync their wsrep XID out of order. Later local thread commit would see that higher seqno was already checkpointed, and fire an assert because of this. As a fix, applier threads are now forced to enable binlogging regardless of log-slave-updates configuration. This PR comes with new mtr test: galera.MDEV-24327, which causes a scenario where applier transaction is applied and committed while earlier local transaction is parked before commit order monitor enter. A buggy mariadb versoin would fail for assertion because of wsrep XID checkpoint order violation. Reviewed-by: Jan Lindström --- mysql-test/suite/galera/r/MDEV-24327.result | 33 +++++++++++ mysql-test/suite/galera/t/MDEV-24327.cnf | 6 ++ mysql-test/suite/galera/t/MDEV-24327.test | 87 +++++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 mysql-test/suite/galera/r/MDEV-24327.result create mode 100644 mysql-test/suite/galera/t/MDEV-24327.cnf create mode 100644 mysql-test/suite/galera/t/MDEV-24327.test (limited to 'mysql-test/suite/galera') diff --git a/mysql-test/suite/galera/r/MDEV-24327.result b/mysql-test/suite/galera/r/MDEV-24327.result new file mode 100644 index 00000000000..e7cd9d08f4b --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-24327.result @@ -0,0 +1,33 @@ +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +INSERT INTO t1 VALUES (1, 'f'); +INSERT INTO t1 VALUES (2, 'g'); +connection node_1; +SET AUTOCOMMIT=ON; +START TRANSACTION; +UPDATE t1 SET f2 = '1' WHERE f1 = 1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_sync_wait=0; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync'; +connection node_1; +COMMIT; +connection node_1a; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 1; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_2; +UPDATE t1 SET f2 = '2' WHERE f1 = 2; +connection node_1a; +SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync'; +SET GLOBAL wsrep_provider_options = 'dbug='; +connection node_1; +SELECT * FROM t1; +f1 f2 +1 1 +2 2 +"node 1 is complete now" +connection node_2; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-24327.cnf b/mysql-test/suite/galera/t/MDEV-24327.cnf new file mode 100644 index 00000000000..390a9aab0f4 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-24327.cnf @@ -0,0 +1,6 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin=mariadb-bin +log-slave-updates=OFF + diff --git a/mysql-test/suite/galera/t/MDEV-24327.test b/mysql-test/suite/galera/t/MDEV-24327.test new file mode 100644 index 00000000000..fe3dbbe2870 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-24327.test @@ -0,0 +1,87 @@ +# +# MDEV-24327 wsrep XID checkpointing order violation with log_slave_updates=OFF +# +# Here we have configure two node cluster with --log-bin=ON and --log-slave_-updates=OFF +# +# a transaction in node executes so far that it has replicated and reached +# commit phase, We have sync point before entering commit order monitor and +# the transaction is parked there +# +# Then another transaction is executed in node 2, it replicates and commits in node 2 +# and is received and applied in node 1. After applying it will remain waiting for +# commit order monitor, as it has later seqno than the first transaction in node 1. +# +# control connection in node 1 waits to see the +# +# With the buggy version of MDEV-24327, the applier has however, already synced the +# wsrep XID checkpoint +# +# +# + +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc + +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); +INSERT INTO t1 VALUES (1, 'f'); +INSERT INTO t1 VALUES (2, 'g'); + +--connection node_1 +SET AUTOCOMMIT=ON; +START TRANSACTION; + +UPDATE t1 SET f2 = '1' WHERE f1 = 1; + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET SESSION wsrep_sync_wait=0; +--connection node_1a +--let $expected_wsrep_received = `SELECT VARIABLE_VALUE+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received'` +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# Block the commit, send the COMMIT and wait until it gets blocked + +--let $galera_sync_point = commit_monitor_enter_sync +--source include/galera_set_sync_point.inc + +--connection node_1 +--send COMMIT + +--connection node_1a + +# wait for the commit to block in sync point + +--let $galera_sync_point = commit_monitor_enter_sync +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc + +# +# replicate non conflicting transaction from node 2 +# it will get later seqno and should sync XID checkpoint after transaction in node 1 +# +--connection node_2 +UPDATE t1 SET f2 = '2' WHERE f1 = 2; + +# +# wait until update from node 2 has been committed +# if XID checkpointing order was violated, node 1 would crash for assert +# + +--connection node_1a +--let $wait_condition = SELECT VARIABLE_VALUE = $expected_wsrep_received FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_received' +--source include/wait_condition.inc + +--let $galera_sync_point = commit_monitor_enter_sync +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +--connection node_1 +--reap +SELECT * FROM t1; +--echo "node 1 is complete now" + + +--connection node_2 +DROP TABLE t1; -- cgit v1.2.1 From d1e9a4c15c7ea4121408c21e02a0006a19689508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Sat, 19 Dec 2020 09:41:14 +0200 Subject: MDEV-23065 : Crash after setting wsrep_on to ON dynamically and reconnect At end_connection make sure we have wsrep before trying to free connection assigned to it. --- mysql-test/suite/galera/r/galera#500.result | 2 ++ mysql-test/suite/galera/t/galera#500.test | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'mysql-test/suite/galera') diff --git a/mysql-test/suite/galera/r/galera#500.result b/mysql-test/suite/galera/r/galera#500.result index 7ba02c56053..2e3f659bd79 100644 --- a/mysql-test/suite/galera/r/galera#500.result +++ b/mysql-test/suite/galera/r/galera#500.result @@ -1,3 +1,5 @@ +connection node_1; +connection node_2; connection node_2; SET SESSION wsrep_sync_wait = 0; SET GLOBAL wsrep_provider_options="gmcast.isolate=2"; diff --git a/mysql-test/suite/galera/t/galera#500.test b/mysql-test/suite/galera/t/galera#500.test index 3c8490b6907..471620b32c1 100644 --- a/mysql-test/suite/galera/t/galera#500.test +++ b/mysql-test/suite/galera/t/galera#500.test @@ -8,6 +8,11 @@ --source include/galera_cluster.inc --source include/galera_have_debug_sync.inc +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + # Force node_2 gcomm background thread to terminate via exception. --connection node_2 --let $wsrep_cluster_address = `SELECT @@wsrep_cluster_address` @@ -36,3 +41,5 @@ SET SESSION wsrep_on=0; --connection node_2 CALL mtr.add_suppression("WSREP: exception from gcomm, backend must be restarted: Gcomm backend termination was requested by setting gmcast.isolate=2."); + +--source include/auto_increment_offset_restore.inc -- cgit v1.2.1 From 04741dc736e803b0a91c76d19de464e25b4a1977 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Mon, 21 Dec 2020 14:44:56 +0100 Subject: MENT-1047 Assertion `active() == false' failed with "XA START.." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Galera replication does not support XA transactions yet. Reject any attempt to `XA START` a transaction, if Galera is enabled. Reviewed-by: Jan Lindström --- mysql-test/suite/galera/r/MENT-1047.result | 4 ++++ mysql-test/suite/galera/t/MENT-1047.test | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 mysql-test/suite/galera/r/MENT-1047.result create mode 100644 mysql-test/suite/galera/t/MENT-1047.test (limited to 'mysql-test/suite/galera') diff --git a/mysql-test/suite/galera/r/MENT-1047.result b/mysql-test/suite/galera/r/MENT-1047.result new file mode 100644 index 00000000000..76d58f6d52f --- /dev/null +++ b/mysql-test/suite/galera/r/MENT-1047.result @@ -0,0 +1,4 @@ +connection node_2; +connection node_1; +XA START 'trx'; +ERROR 42000: This version of MariaDB doesn't yet support 'XA transactions with Galera replication' diff --git a/mysql-test/suite/galera/t/MENT-1047.test b/mysql-test/suite/galera/t/MENT-1047.test new file mode 100644 index 00000000000..1431818f806 --- /dev/null +++ b/mysql-test/suite/galera/t/MENT-1047.test @@ -0,0 +1,7 @@ +# +# MENT-1047 - Reject XA with Galera replication +# +--source include/galera_cluster.inc + +--error ER_NOT_SUPPORTED_YET +XA START 'trx'; -- cgit v1.2.1