summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/galera_sr/t/MDEV-25718.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
commit06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/galera_sr/t/MDEV-25718.test
parentInitial commit. (diff)
downloadmariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz
mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/galera_sr/t/MDEV-25718.test')
-rw-r--r--mysql-test/suite/galera_sr/t/MDEV-25718.test63
1 files changed, 63 insertions, 0 deletions
diff --git a/mysql-test/suite/galera_sr/t/MDEV-25718.test b/mysql-test/suite/galera_sr/t/MDEV-25718.test
new file mode 100644
index 00000000..9aebbdc7
--- /dev/null
+++ b/mysql-test/suite/galera_sr/t/MDEV-25718.test
@@ -0,0 +1,63 @@
+#
+# MDEV-25718 Assertion `transaction.is_streaming()' failed in
+# void wsrep::transaction::adopt()
+#
+
+--source include/galera_cluster.inc
+--source include/have_debug_sync.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
+
+#
+# Start a SR transaction and block it after it has replicated
+# a fragment. Notice the transaction is still in executing state.
+#
+--connection node_1
+SET SESSION wsrep_trx_fragment_size = 1;
+START TRANSACTION;
+SET debug_sync = "ha_write_row_end SIGNAL write_row_end WAIT_FOR write_row_continue";
+--send INSERT INTO t1 VALUES (1);
+
+--connect node_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_ctrl
+SET debug_sync = "now WAIT_FOR write_row_end";
+SET GLOBAL debug_dbug = '+d,wsrep_streaming_rollback';
+
+#
+# Issue a conflicting DDL, that will block in streaming_rollback
+# sync point.
+#
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+--send TRUNCATE TABLE t1;
+
+--connection node_ctrl
+SET SESSION debug_sync = "now WAIT_FOR wsrep_streaming_rollback_reached";
+
+#
+# Let the INSERT continue. If bug is present will be able to go through
+# before_rollback() / streaming_rollback() and clear its streaming context,
+# which causes the assertion to trigger in BF aborter.
+#
+SET SESSION wsrep_sync_wait = 0;
+SET debug_sync = "now SIGNAL write_row_continue";
+
+# Let's give the INSERT some time, to make sure it does rollback
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = "INSERT INTO t1 VALUES (1)" AND STATE = "Freeing items";
+--source include/wait_condition.inc
+
+# Resume the DDL in streaming_rollback
+SET SESSION debug_sync = "now SIGNAL wsrep_streaming_rollback_continue";
+
+--connection node_1a
+--reap
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+# Cleanup
+--connection node_ctrl
+SET GLOBAL debug_dbug = "";
+SET DEBUG_SYNC = 'RESET';
+DROP TABLE t1;