Commit 1ab2e757 authored by Teemu Ollakka's avatar Teemu Ollakka Committed by Jan Lindström

Fixed and recorded galera_sr.galera_sr_rollback_statement

Disabled GCF-437 which relies on InnoDB redo log size limitation
which does not seem to exist or is increased in MariaDB 10.4.

Require debug sync for mysql-wsrep#215.
parent 24be8438
galera_sr_table_contents : missing file galera_sr_table_contents : missing file
GCF-437 : test relies on InnoDB redo log size limtation
CREATE TABLE ten (f1 INTEGER); connection node_2;
INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; connection node_1;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) ENGINE=InnoDB; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR) ENGINE=InnoDB;
INSERT INTO t1 (f2) SELECT REPEAT('a', 255) FROM ten AS a1, ten AS a2, ten AS a3; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR) ENGINE=InnoDB;
ALTER TABLE t1 CHANGE f1 f1 INTEGER; INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
ALTER TABLE t1 DROP PRIMARY KEY; INSERT INTO t2 VALUES (3, 'b');
INSERT INTO t1 VALUES (1, 'abc');
SET SESSION wsrep_trx_fragment_size = 1; SET SESSION wsrep_trx_fragment_size = 1;
INSERT INTO t2 SELECT * FROM t1; INSERT INTO t2 SELECT * FROM t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
INSERT INTO t2 VALUES (1, 'abc'); last_committed_diff
INSERT INTO t2 VALUES (2, 'abc'); 3
SELECT COUNT(*) = 2 FROM t2; connection node_2;
COUNT(*) = 2 connection node_1;
1 INSERT INTO t2 VALUES (1, 'c');
SELECT COUNT(*) = 2 FROM t2; connection node_2;
COUNT(*) = 2 INSERT INTO t2 VALUES (2, 'c');
1 connection node_1;
SELECT * FROM t2;
f1 f2
1 c
2 c
3 b
connection node_2;
SELECT * FROM t2;
f1 f2
1 c
2 c
3 b
connection node_1;
SET SESSION wsrep_trx_fragment_size = DEFAULT;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE ten;
--source include/galera_cluster.inc
--source include/have_innodb.inc
# #
# Test the case where a statement is rolled back due to an error while Streaming Replication # Test the case where a statement is rolled back due to an error while
# is in effect. We construct an INSERT ... SELECT statement that will fail with a duplicate # Streaming Replication is in effect. We construct an INSERT ... SELECT
# key error towards the end of the statement, after a portion has already been replicated via SR. # statement that will fail with a duplicate key error towards the end of
# the statement, after a portion has already been replicated via SR.
# #
--source include/galera_cluster.inc
--disable_query_log --source include/have_innodb.inc
--let $auto_increment_offset_orig = `SELECT @@auto_increment_offset`
SET GLOBAL auto_increment_offset=1;
--enable_query_log
--connection node_1 --connection node_1
CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 CHAR(255)) ENGINE=InnoDB; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR) ENGINE=InnoDB;
INSERT INTO t1 (f2) SELECT REPEAT('a', 255) FROM ten AS a1, ten AS a2, ten AS a3; INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
ALTER TABLE t1 CHANGE f1 f1 INTEGER;
ALTER TABLE t1 DROP PRIMARY KEY;
# This poison value is used to cause the INSERT ... SELECT below to fail # This poison value is used to cause the INSERT ... SELECT below to fail
INSERT INTO t1 VALUES (1, 'abc'); INSERT INTO t2 VALUES (3, 'b');
--let $wsrep_trx_fragment_size_orig = `SELECT @@wsrep_trx_fragment_size`
SET SESSION wsrep_trx_fragment_size = 1; SET SESSION wsrep_trx_fragment_size = 1;
--disable_query_log
--let $last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--enable_query_log
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
INSERT INTO t2 SELECT * FROM t1; INSERT INTO t2 SELECT * FROM t1;
#
# We should see three fragments replicated: Rows 1, 2 and rollback fragment.
#
--disable_query_log
--let $last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--eval SELECT $last_committed_after - $last_committed_before AS last_committed_diff
--enable_query_log
--connection node_2 --connection node_2
--let $wait_condition = SELECT COUNT(*) = 0 FROM t2; --let $wait_condition = SELECT COUNT(*) = 1 FROM t2;
--source include/wait_condition.inc --source include/wait_condition.inc
# Cluster continues to operate after the implicit ROLLBACK; # Cluster continues to operate after the implicit ROLLBACK;
--connection node_1 --connection node_1
INSERT INTO t2 VALUES (1, 'abc'); INSERT INTO t2 VALUES (1, 'c');
--connection node_2 --connection node_2
INSERT INTO t2 VALUES (2, 'abc'); INSERT INTO t2 VALUES (2, 'c');
--connection node_1 --connection node_1
SELECT COUNT(*) = 2 FROM t2; SELECT * FROM t2;
--connection node_2 --connection node_2
SELECT COUNT(*) = 2 FROM t2; SELECT * FROM t2;
--connection node_1 --connection node_1
--disable_query_log SET SESSION wsrep_trx_fragment_size = DEFAULT;
--eval SET GLOBAL auto_increment_offset=$auto_increment_offset_orig;
--enable_query_log
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
DROP TABLE ten;
--source include/galera_cluster.inc --source include/galera_cluster.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--source include/have_debug_sync.inc
# #
# Test the following sequence of events: # Test the following sequence of events:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment