1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

MTR test for checking correctness of fragmentation over CCs

This commit is contained in:
Teemu Ollakka
2015-10-16 15:57:22 +03:00
committed by Nirbhay Choubey
parent cf43620136
commit 5ad30e8ad1
3 changed files with 94 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
SET GLOBAL wsrep_cluster_address='';
SET SESSION wsrep_sync_wait=0;
SET GLOBAL wsrep_provider_options = 'dbug=d,gcs_core_after_frag_send';
SET SESSION wsrep_retry_autocommit=0;
INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_cluster_address = 'gcomm://127.0.0.1:13001';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
SET GLOBAL wsrep_provider_options = 'signal=gcs_core_after_frag_send';
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
SELECT * FROM t1;
f1 f2
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SELECT * FROM t1;
f1 f2
2 bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3 cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;

View File

@@ -0,0 +1,5 @@
!include ../galera_2nodes.cnf
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64'

View File

@@ -0,0 +1,64 @@
# Test fragmentation over configuration changes
--source include/galera_cluster.inc
--source include/have_innodb.inc
# Prepare table
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 TEXT);
# Stop node2
# Disconnect node_2 from group
--connection node_2
--let $wsrep_cluster_address_orig = `select @@wsrep_cluster_address`
SET GLOBAL wsrep_cluster_address='';
# Connection for sync points
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
SET SESSION wsrep_sync_wait=0;
# Set breakpoint in gcs after first fragment send
--let $galera_sync_point = gcs_core_after_frag_send
--source include/galera_set_sync_point.inc
--connection node_1
SET SESSION wsrep_retry_autocommit=0;
--send INSERT INTO t1 VALUES (1, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
--connection node_1a
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc
# Restart node_2, wait until it joins the group and then make INSERT
--connection node_2
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'
SET SESSION wsrep_on = 0;
--source include/galera_wait_ready.inc
SET SESSION wsrep_on = 1;
INSERT INTO t1 VALUES (2, "bbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
# Signal node_1 to continue
--connection node_1a
--source include/galera_signal_sync_point.inc
# Deadlock error should be returned since write set send was
# interrupted by gcs
--connection node_1
--error ER_LOCK_DEADLOCK
--reap
# Do additional insert to verify that node_1 remain operational
INSERT INTO t1 VALUES (3, "cccccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
# Nodes node_1 and node_2 should now contain rows 2 and 3
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
--connection node_1
DROP TABLE t1;