1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge branch '10.6' into '10.11'

This commit is contained in:
Julius Goryavsky
2025-04-02 05:50:52 +02:00
79 changed files with 1517 additions and 94 deletions

View File

@@ -10,7 +10,6 @@
#
##############################################################################
galera_sequences : MDEV-35934/MDEV-33850 For Galera, create sequence with low cache got signal 6 error: [ERROR] WSREP: FSM: no such a transition REPLICATING -> COMMITTED
galera_wan : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan
galera_vote_rejoin_ddl : MDEV-35940 Unallowed state transition: donor -> synced in galera_wan
MW-329 : MDEV-35951 Complete freeze during MW-329 test

View File

@@ -24,6 +24,6 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender (.*) is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';

View File

@@ -66,7 +66,7 @@ SHOW STATUS LIKE 'wsrep_desync_count';
Variable_name Value
wsrep_desync_count 0
SET @@global.wsrep_desync = 0;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender (.*) is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
connection node_1;
# Wait until both nodes are back to cluster
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';

View File

@@ -13,4 +13,4 @@ SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME
VARIABLE_VALUE
Primary
SET SESSION wsrep_sync_wait=DEFAULT;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender (.*) is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

View File

@@ -0,0 +1,22 @@
connection node_2;
connection node_1;
connect con1,127.0.0.1,root,,test,$NODE_MYPORT_1;
connection node_1;
CALL mtr.add_suppression("CREATE TABLE isolation failure");
SET DEBUG_SYNC = 'wsrep_kill_thd_before_enter_toi SIGNAL may_kill WAIT_FOR continue';
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
connection con1;
SET DEBUG_SYNC = 'now WAIT_FOR may_kill';
SET DEBUG_SYNC = 'now SIGNAL continue';
connection node_1;
Got one of the listed errors
connection node_2;
SHOW TABLES LIKE 't1';
Tables_in_test (t1)
connection con1;
SHOW TABLES LIKE 't1';
Tables_in_test (t1)
SET DEBUG_SYNC = 'RESET';
disconnect con1;
disconnect node_2;
disconnect node_1;

View File

@@ -26,3 +26,4 @@ COUNT(*) = 1
1
DROP TABLE t1;
connection node_1;
SET GLOBAL wsrep_mode = DEFAULT;

View File

@@ -53,7 +53,7 @@ FOUND 2 /Resuming and resyncing the provider/ in mysqld.2.err
FOUND 1 /Server not desynched from group at BLOCK_DDL because WSREP_MODE_BF_MARIABACKUP is used./ in mysqld.2.err
# Should return FOUND 1 as server did desync and pause at BLOCK_COMMIT
FOUND 1 /Server desynched from group during BACKUP STAGE BLOCK_COMMIT./ in mysqld.2.err
SET GLOBAL wsrep_mode = "";
SET GLOBAL wsrep_mode = DEFAULT;
connection node_1;
DROP TABLE t;
disconnect node_2;

View File

@@ -47,6 +47,9 @@ select NEXT VALUE FOR Seq1_1;
NEXT VALUE FOR Seq1_1
4
connection node_1;
SHOW CREATE SEQUENCE Seq1_1;
Table Create Table
Seq1_1 CREATE SEQUENCE `Seq1_1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB
DROP SEQUENCE Seq1_1;
connection node_1;
CREATE TABLE t2 (d CHAR(1)KEY);

View File

@@ -0,0 +1,152 @@
connection node_2;
connection node_1;
connection node_1;
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0), (3, 0);
connection node_1;
START TRANSACTION;
INSERT INTO t1 VALUES (4, next value for s);
INSERT INTO t1 VALUES (5, next value for s);
INSERT INTO t1 VALUES (6, next value for s);
INSERT INTO t1 VALUES (7, next value for s);
INSERT INTO t1 VALUES (8, next value for s);
INSERT INTO t1 VALUES (9, next value for s);
INSERT INTO t1 VALUES (10, next value for s);
INSERT INTO t1 VALUES (11, next value for s);
INSERT INTO t1 VALUES (12, next value for s);
INSERT INTO t1 VALUES (13, next value for s);
INSERT INTO t1 VALUES (14, next value for s);
SELECT * FROM t1 WHERE f1 > 0 FOR UPDATE;
f1 f2
1 0
3 0
4 1
5 3
6 5
7 7
8 9
9 11
10 13
11 15
12 17
13 19
14 21
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
SET SESSION wsrep_sync_wait=0;
SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
connection node_2;
INSERT INTO t1 VALUES (2, 2);
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=';
SET GLOBAL wsrep_provider_options = 'dbug=d,abort_trx_end';
SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
SET SESSION wsrep_on = 0;
SET SESSION wsrep_on = 1;
SET GLOBAL wsrep_provider_options = 'dbug=';
SET GLOBAL wsrep_provider_options = 'signal=abort_trx_end';
SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_master_enter_sync';
connection node_1;
wsrep_local_replays
1
INSERT INTO t1 VALUES (22, next value for s);
INSERT INTO t1 VALUES (23, next value for s);
INSERT INTO t1 VALUES (24, next value for s);
INSERT INTO t1 VALUES (25, next value for s);
INSERT INTO t1 VALUES (26, next value for s);
INSERT INTO t1 VALUES (27, next value for s);
INSERT INTO t1 VALUES (28, next value for s);
INSERT INTO t1 VALUES (29, next value for s);
INSERT INTO t1 VALUES (30, next value for s);
INSERT INTO t1 VALUES (31, next value for s);
INSERT INTO t1 VALUES (32, next value for s);
INSERT INTO t1 VALUES (33, next value for s);
INSERT INTO t1 VALUES (34, next value for s);
INSERT INTO t1 VALUES (35, next value for s);
connection node_1;
SELECT * FROM t1;
f1 f2
1 0
2 2
3 0
4 1
5 3
6 5
7 7
8 9
9 11
10 13
11 15
12 17
13 19
14 21
22 31
23 33
24 35
25 37
26 39
27 41
28 43
29 45
30 47
31 49
32 51
33 53
34 55
35 57
SELECT LASTVAL(s);
LASTVAL(s)
57
connection node_2;
SELECT * FROM t1;
f1 f2
1 0
2 2
3 0
4 1
5 3
6 5
7 7
8 9
9 11
10 13
11 15
12 17
13 19
14 21
22 31
23 33
24 35
25 37
26 39
27 41
28 43
29 45
30 47
31 49
32 51
33 53
34 55
35 57
SELECT LASTVAL(s);
LASTVAL(s)
NULL
connection node_1;
SELECT NEXTVAL(s);
NEXTVAL(s)
59
connection node_2;
SELECT NEXTVAL(s);
NEXTVAL(s)
62
DROP SEQUENCE s;
DROP TABLE t1;

View File

@@ -0,0 +1,350 @@
connection node_2;
connection node_1;
connection node_1;
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY DEFAULT NEXTVAL(s), f2 INT) ENGINE=InnoDB;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_1;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
connection node_2;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
connection node_2a;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
connection node_1a;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
connection node_2;
SELECT LASTVAL(s);
LASTVAL(s)
40
connection node_1;
SELECT LASTVAL(s);
LASTVAL(s)
19
connection node_2a;
SELECT LASTVAL(s);
LASTVAL(s)
60
connection node_1a;
SELECT LASTVAL(s);
LASTVAL(s)
79
connection node_1;
SELECT * FROM t1;
f1 f2
1 1
3 1
5 1
7 1
9 1
11 1
13 1
15 1
17 1
19 1
22 1
24 1
26 1
28 1
30 1
32 1
34 1
36 1
38 1
40 1
42 1
44 1
46 1
48 1
50 1
52 1
54 1
56 1
58 1
60 1
61 1
63 1
65 1
67 1
69 1
71 1
73 1
75 1
77 1
79 1
connection node_2;
SELECT * FROM t1;
f1 f2
1 1
3 1
5 1
7 1
9 1
11 1
13 1
15 1
17 1
19 1
22 1
24 1
26 1
28 1
30 1
32 1
34 1
36 1
38 1
40 1
42 1
44 1
46 1
48 1
50 1
52 1
54 1
56 1
58 1
60 1
61 1
63 1
65 1
67 1
69 1
71 1
73 1
75 1
77 1
79 1
connection node_1;
DROP TABLE t1;
DROP SEQUENCE s;
connection node_1;
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY DEFAULT NEXTVAL(s), f2 INT) ENGINE=InnoDB;
connection node_1;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
connection node_2;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
connection node_2a;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
connection node_1a;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
connection node_2;
SELECT LASTVAL(s);
LASTVAL(s)
20
connection node_1;
SELECT LASTVAL(s);
LASTVAL(s)
19
connection node_2a;
SELECT LASTVAL(s);
LASTVAL(s)
40
connection node_1a;
SELECT LASTVAL(s);
LASTVAL(s)
39
connection node_1;
SELECT * FROM t1;
f1 f2
connection node_2;
SELECT * FROM t1;
f1 f2
connection node_1;
DROP TABLE t1;
DROP SEQUENCE s;
connection node_1;
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY DEFAULT NEXTVAL(s), f2 INT) ENGINE=InnoDB;
connection node_1;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
connection node_1a;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
connection node_2a;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
connection node_2;
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
connection node_1;
COMMIT;
connection node_1a;
ROLLBACK;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2a;
ROLLBACK;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_2;
SELECT LASTVAL(s);
LASTVAL(s)
40
connection node_1;
SELECT LASTVAL(s);
LASTVAL(s)
19
connection node_2a;
SELECT LASTVAL(s);
LASTVAL(s)
20
connection node_1a;
SELECT LASTVAL(s);
LASTVAL(s)
39
connection node_1;
SELECT * FROM t1;
f1 f2
1 1
3 1
5 1
7 1
9 1
11 1
13 1
15 1
17 1
19 1
connection node_2;
SELECT * FROM t1;
f1 f2
1 1
3 1
5 1
7 1
9 1
11 1
13 1
15 1
17 1
19 1
connection node_1;
DROP TABLE t1;
DROP SEQUENCE s;

View File

@@ -48,7 +48,7 @@ SET @@global.wsrep_desync = 0;
SET SESSION wsrep_sync_wait=15;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender (.*) is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
--connection node_1
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';

View File

@@ -77,7 +77,7 @@ SET @@global.wsrep_desync = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
--source include/wait_condition.inc
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender (.*) is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
--connection node_1
--echo # Wait until both nodes are back to cluster

View File

@@ -25,7 +25,6 @@ SET SESSION wsrep_sync_wait=DEFAULT;
--error ER_LOCK_WAIT_TIMEOUT
DELETE FROM mysql.wsrep_streaming_log;
#
# Reconnect to the cluster
#
@@ -36,6 +35,5 @@ SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SET SESSION wsrep_sync_wait=DEFAULT;
--source include/auto_increment_offset_restore.inc
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender (.*) is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender .+ ?is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

View File

@@ -0,0 +1,43 @@
#
# MDEV-36116: TOI crashes in debug assert if executing thread is killed.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug_sync.inc
--source include/have_debug.inc
--connect con1,127.0.0.1,root,,test,$NODE_MYPORT_1
# Start TOI operation and wait for the thread to be killed.
--connection node_1
CALL mtr.add_suppression("CREATE TABLE isolation failure");
--let $connection_id = `SELECT CONNECTION_ID()`
SET DEBUG_SYNC = 'wsrep_kill_thd_before_enter_toi SIGNAL may_kill WAIT_FOR continue';
--send
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
# Kill the thread and let it continue.
--connection con1
SET DEBUG_SYNC = 'now WAIT_FOR may_kill';
--disable_query_log
--eval KILL CONNECTION $connection_id
--enable_query_log
SET DEBUG_SYNC = 'now SIGNAL continue';
--connection node_1
--error 2013,2026
--reap
# Verify no tables created on either nodes.
--connection node_2
SHOW TABLES LIKE 't1';
--connection con1
SHOW TABLES LIKE 't1';
# Cleanup
SET DEBUG_SYNC = 'RESET';
--disconnect con1
--source include/galera_end.inc

View File

@@ -36,6 +36,4 @@ SELECT COUNT(*) = 1 FROM t1;
DROP TABLE t1;
--connection node_1
--disable_query_log
SET GLOBAL wsrep_mode = DEFAULT;
--enable_query_log

View File

@@ -129,7 +129,7 @@ let SEARCH_PATTERN = Server not desynched from group at BLOCK_DDL because WSREP_
let SEARCH_PATTERN = Server desynched from group during BACKUP STAGE BLOCK_COMMIT.;
--source include/search_pattern_in_file.inc
SET GLOBAL wsrep_mode = "";
SET GLOBAL wsrep_mode = DEFAULT;
--connection node_1
DROP TABLE t;

View File

@@ -3,6 +3,7 @@
--source include/have_sequence.inc
--source include/have_aria.inc
--disable_ps2_protocol
#
# MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster
#
@@ -47,6 +48,7 @@ SHOW CREATE SEQUENCE Seq1_1;
select NEXT VALUE FOR Seq1_1;
--connection node_1
SHOW CREATE SEQUENCE Seq1_1;
DROP SEQUENCE Seq1_1;
#

View File

@@ -0,0 +1,9 @@
!include ../galera_2nodes.cnf
[mysqld.1]
auto-increment-increment=2
auto-increment-offset=1
[mysqld.2]
auto-increment-increment=2
auto-increment-offset=2

View File

@@ -0,0 +1,5 @@
[binlogon]
log-bin
log-slave-updates
[binlogoff]

View File

@@ -0,0 +1,115 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/galera_have_debug_sync.inc
--disable_ps2_protocol
#
# We create InnoDB seqeuence with small cache that is then
# used as default value for column in table.
#
--connection node_1
--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0), (3, 0);
--connection node_1
START TRANSACTION;
INSERT INTO t1 VALUES (4, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (5, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (6, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (7, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (8, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (9, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (10, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (11, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (12, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (13, next value for s); # No conflict in cert
INSERT INTO t1 VALUES (14, next value for s); # No conflict in cert
SELECT * FROM t1 WHERE f1 > 0 FOR UPDATE; # Should cause GAP lock between 1 and 3
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
SET SESSION wsrep_sync_wait=0;
# Block the applier on node #1 and issue a conflicting update on node #2
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_set_sync_point.inc
#
# Send conflicting INSERT
#
--connection node_2
INSERT INTO t1 VALUES (2, 2); # This should BF abort because of GAP lock
--connection node_1a
--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
--let $galera_sync_point = apply_monitor_slave_enter_sync commit_monitor_master_enter_sync
--source include/galera_wait_sync_point.inc
--source include/galera_clear_sync_point.inc
--let $galera_sync_point = abort_trx_end
--source include/galera_set_sync_point.inc
--let $galera_sync_point = apply_monitor_slave_enter_sync
--source include/galera_signal_sync_point.inc
--let $galera_sync_point = abort_trx_end commit_monitor_master_enter_sync
--source include/galera_wait_sync_point.inc
# Let the transactions proceed
--source include/galera_clear_sync_point.inc
--let $galera_sync_point = abort_trx_end
--source include/galera_signal_sync_point.inc
--let $galera_sync_point = commit_monitor_master_enter_sync
--source include/galera_signal_sync_point.inc
# Commit succeeds
--connection node_1
--reap
# wsrep_local_replays has increased by 1
--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
--disable_query_log
--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old = 1 AS wsrep_local_replays;
--enable_query_log
INSERT INTO t1 VALUES (22, next value for s);
INSERT INTO t1 VALUES (23, next value for s);
INSERT INTO t1 VALUES (24, next value for s);
INSERT INTO t1 VALUES (25, next value for s);
INSERT INTO t1 VALUES (26, next value for s);
INSERT INTO t1 VALUES (27, next value for s);
INSERT INTO t1 VALUES (28, next value for s);
INSERT INTO t1 VALUES (29, next value for s);
INSERT INTO t1 VALUES (30, next value for s);
INSERT INTO t1 VALUES (31, next value for s);
INSERT INTO t1 VALUES (32, next value for s);
INSERT INTO t1 VALUES (33, next value for s);
INSERT INTO t1 VALUES (34, next value for s);
INSERT INTO t1 VALUES (35, next value for s);
--connection node_1
SELECT * FROM t1;
SELECT LASTVAL(s);
--connection node_2
SELECT * FROM t1;
SELECT LASTVAL(s);
--connection node_1
SELECT NEXTVAL(s);
--connection node_2
SELECT NEXTVAL(s);
DROP SEQUENCE s;
DROP TABLE t1;

View File

@@ -0,0 +1,9 @@
!include ../galera_2nodes.cnf
[mysqld.1]
auto-increment-increment=2
auto-increment-offset=1
[mysqld.2]
auto-increment-increment=2
auto-increment-offset=2

View File

@@ -0,0 +1,5 @@
[binlogon]
log-bin
log-slave-updates
[binlogoff]

View File

@@ -0,0 +1,255 @@
--source include/galera_cluster.inc
--source include/have_sequence.inc
--disable_ps2_protocol
#
# Case 1: Separate transactions from few connections
#
--connection node_1
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY DEFAULT NEXTVAL(s), f2 INT) ENGINE=InnoDB;
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--connection node_1
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
--connection node_2
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
--connection node_2a
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
--connection node_1a
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
COMMIT;
--connection node_2
SELECT LASTVAL(s);
--connection node_1
SELECT LASTVAL(s);
--connection node_2a
SELECT LASTVAL(s);
--connection node_1a
SELECT LASTVAL(s);
--connection node_1
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
--connection node_1
DROP TABLE t1;
DROP SEQUENCE s;
#
# Case 2: All rollback
#
--connection node_1
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY DEFAULT NEXTVAL(s), f2 INT) ENGINE=InnoDB;
--connection node_1
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
--connection node_2
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
--connection node_2a
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
--connection node_1a
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
ROLLBACK;
--connection node_2
SELECT LASTVAL(s);
--connection node_1
SELECT LASTVAL(s);
--connection node_2a
SELECT LASTVAL(s);
--connection node_1a
SELECT LASTVAL(s);
--connection node_1
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
--connection node_1
DROP TABLE t1;
DROP SEQUENCE s;
#
# Case 3: Mixed transactions
#
--connection node_1
CREATE SEQUENCE s INCREMENT=0 CACHE=5 ENGINE=InnoDB;
CREATE TABLE t1 (f1 INT PRIMARY KEY DEFAULT NEXTVAL(s), f2 INT) ENGINE=InnoDB;
--connection node_1
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
--connection node_1a
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
--connection node_2a
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
--connection node_2
BEGIN;
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
INSERT INTO t1(f2) values (1);
--connection node_1
COMMIT;
--connection node_1a
ROLLBACK;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
--connection node_2a
--error ER_LOCK_DEADLOCK
ROLLBACK;
--connection node_2
SELECT LASTVAL(s);
--connection node_1
SELECT LASTVAL(s);
--connection node_2a
SELECT LASTVAL(s);
--connection node_1a
SELECT LASTVAL(s);
--connection node_1
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
--connection node_1
DROP TABLE t1;
DROP SEQUENCE s;

View File

@@ -0,0 +1,61 @@
connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_3;
connection node_1;
CREATE TABLE parent (
id INT PRIMARY KEY
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id INT,
KEY (parent_id),
CONSTRAINT FOREIGN KEY (parent_id) REFERENCES parent(id)
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (2);
connection node_3;
SET SESSION wsrep_on = OFF;
DELETE FROM parent WHERE id = 1;
SET SESSION wsrep_on = ON;
Restarting server 3 with one applier thread having FK and UK checks disabled
SET GLOBAL DEBUG_DBUG = 'd,sync.wsrep_after_write_row';
connection node_1;
INSERT INTO child VALUES (1, 1);
connection node_3;
SET DEBUG_SYNC = 'now WAIT_FOR sync.wsrep_after_write_row_reached';
SET GLOBAL DEBUG_DBUG = '';
SET wsrep_sync_wait = 0;
SET DEBUG_SYNC = 'ib_after_row_insert SIGNAL signal.wsrep_after_write_row';
INSERT INTO child VALUES (2, 2);
SET DEBUG_SYNC = 'RESET';
include/assert_grep.inc [no FK constraint failure]
Server 3
SELECT COUNT(*) AS EXPECT_1 FROM parent;
EXPECT_1
1
SELECT COUNT(*) AS EXPECT_2 FROM child;
EXPECT_2
2
connection node_1;
Server 1
SET wsrep_sync_wait = 15;
SELECT COUNT(*) AS EXPECT_2 FROM parent;
EXPECT_2
2
SELECT COUNT(*) AS EXPECT_2 FROM child;
EXPECT_2
2
connection node_2;
Server 2
SET wsrep_sync_wait = 15;
SELECT COUNT(*) AS EXPECT_2 FROM parent;
EXPECT_2
2
SELECT COUNT(*) AS EXPECT_2 FROM child;
EXPECT_2
2
DROP TABLE child;
DROP TABLE parent;
disconnect node_2;
disconnect node_1;

View File

@@ -2,8 +2,6 @@ connection node_2;
connection node_1;
connection node_1;
connection node_2;
connection node_1;
connection node_2;
connection node_3;
Killing node #3 to free ports for garbd ...
connection node_3;
@@ -26,8 +24,8 @@ DROP TABLE t1;
Restarting node #3 to satisfy MTR's end-of-test checks
connection node_3;
connection node_1;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
connection node_2;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
connection node_3;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

View File

@@ -11,7 +11,6 @@ CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO t1 (f2) SELECT REPEAT('x', 1024) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
connection node_2;
Killing node #3 to free ports for garbd ...
connection node_3;
connection node_1;
@@ -33,8 +32,8 @@ Restarting node #3 to satisfy MTR's end-of-test checks
connection node_3;
connection node_1;
connection node_1;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
connection node_2;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
connection node_3;
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

View File

@@ -0,0 +1,110 @@
#
# MDEV-36360: Don't grab table-level X locks for applied inserts.
#
# It prevents a debug crash in wsrep_report_error() which happened when appliers would run
# with FK and UK checks disabled and erroneously execute plain inserts as bulk inserts.
#
# Moreover, in release builds such a behavior could lead to deadlocks between two applier
# threads if a thread waiting for a table-level lock was ordered before the lock holder.
# In that case the lock holder would proceed to commit order and wait forever for the
# now-blocked other applier thread to commit before.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug_sync.inc
--source include/have_debug.inc
--let $galera_connection_name = node_3
--let $galera_server_number = 3
--source include/galera_connect.inc
# Save original auto_increment_offset values.
--let $node_1=node_1
--let $node_2=node_2
--let $node_3=node_3
--source ../galera/include/auto_increment_offset_save.inc
# Create parent and child tables.
--connection node_1
CREATE TABLE parent (
id INT PRIMARY KEY
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id INT,
KEY (parent_id),
CONSTRAINT FOREIGN KEY (parent_id) REFERENCES parent(id)
) ENGINE=InnoDB;
# Fill the parent table with rows that will later be used by the child.
INSERT INTO parent VALUES (1), (2);
# Wait until the rows are replicated on node #3.
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 2 FROM parent
--source include/wait_condition.inc
# Delete one row from the parent table on node #3 and rejoin the cluster.
SET SESSION wsrep_on = OFF;
DELETE FROM parent WHERE id = 1;
SET SESSION wsrep_on = ON;
--echo Restarting server 3 with one applier thread having FK and UK checks disabled
--source include/shutdown_mysqld.inc
--let $start_mysqld_params = --wsrep_slave_FK_checks=0 --wsrep_slave_UK_checks=0
--source ../galera/include/start_mysqld.inc
# Stop the applier after writing a row into the child table.
SET GLOBAL DEBUG_DBUG = 'd,sync.wsrep_after_write_row';
# Insert a child row that will be applied on node #3, but should not
# grab table-level X-lock.
--connection node_1
INSERT INTO child VALUES (1, 1);
--connection node_3
SET DEBUG_SYNC = 'now WAIT_FOR sync.wsrep_after_write_row_reached';
# Now that the applier has hit the global sync point wait, reset it
# so that the upcoming insert avoids it.
SET GLOBAL DEBUG_DBUG = '';
# Don't wait for applied insert to commit.
SET wsrep_sync_wait = 0;
SET DEBUG_SYNC = 'ib_after_row_insert SIGNAL signal.wsrep_after_write_row';
# The insert should pass the sync point, as otherwise if the applied insert
# grabs table-level X-lock, they'll both deadlock forever.
INSERT INTO child VALUES (2, 2);
SET DEBUG_SYNC = 'RESET';
--let $assert_select = foreign key constraint fails
--let $assert_count = 0
--let $assert_text = no FK constraint failure
--let $assert_only_after = CURRENT_TEST
--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.3.err
--source include/assert_grep.inc
# Child row insert is applied even though there's no parent row.
--echo Server 3
SELECT COUNT(*) AS EXPECT_1 FROM parent;
SELECT COUNT(*) AS EXPECT_2 FROM child;
# Check other nodes have both parent and child rows.
--connection node_1
--echo Server 1
SET wsrep_sync_wait = 15;
SELECT COUNT(*) AS EXPECT_2 FROM parent;
SELECT COUNT(*) AS EXPECT_2 FROM child;
--connection node_2
--echo Server 2
SET wsrep_sync_wait = 15;
SELECT COUNT(*) AS EXPECT_2 FROM parent;
SELECT COUNT(*) AS EXPECT_2 FROM child;
DROP TABLE child;
DROP TABLE parent;
# Restore original auto_increment_offset values.
--source ../galera/include/auto_increment_offset_restore.inc
--source include/galera_end.inc

View File

@@ -9,14 +9,9 @@
--source include/big_test.inc
# Save galera ports
--connection node_1
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT
--connection node_2
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT
--let $galera_connection_name = node_3
--let $galera_server_number = 3
--source include/galera_connect.inc
@@ -81,10 +76,10 @@ let $restart_noprint=2;
# Workaround for galera#101
--connection node_1
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
--connection node_2
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
--connection node_3
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

View File

@@ -10,6 +10,10 @@
--source include/have_debug.inc
--source include/have_debug_sync.inc
# Save galera ports
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT
--let $galera_connection_name = node_3
--let $galera_server_number = 3
--source include/galera_connect.inc
@@ -22,10 +26,7 @@
--let $node_3=node_3
--source ../galera/include/auto_increment_offset_save.inc
# Save galera ports
--connection node_1
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_1 = $_NODE_GALERAPORT
--let $datadir= `SELECT @@datadir`
--let $innodb_max_dirty_pages_pct = `SELECT @@innodb_max_dirty_pages_pct`
@@ -39,10 +40,6 @@ CREATE TABLE t1 (f1 INTEGER, f2 varchar(1024)) Engine=InnoDB;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO t1 (f2) SELECT REPEAT('x', 1024) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
--connection node_2
--source suite/galera/include/galera_base_port.inc
--let $NODE_GALERAPORT_2 = $_NODE_GALERAPORT
--echo Killing node #3 to free ports for garbd ...
--connection node_3
@@ -122,13 +119,16 @@ let $restart_noprint=2;
--eval SET GLOBAL innodb_max_dirty_pages_pct_lwm = $innodb_max_dirty_pages_pct_lwm
--enable_query_log
# Restore original auto_increment_offset values.
--source ../galera/include/auto_increment_offset_restore.inc
# Workaround for galera#101
--connection node_1
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
--connection node_2
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");
--connection node_3
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0 (.*) is not in state transfer \\(SYNCED\\)");
CALL mtr.add_suppression("WSREP: Protocol violation\\. JOIN message sender 1\\.0( \\(.*\\))? is not in state transfer \\(SYNCED\\)\\. Message ignored\\.");

View File

@@ -37,9 +37,6 @@ f1 f2
SET SESSION wsrep_trx_fragment_size = 10000;
START TRANSACTION;
INSERT INTO t1 VALUE (10, 'node1');
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
COUNT(*)
0
connection node_1a;
INSERT INTO t1 VALUES(15, 'node2');
connection node_1;
@@ -48,6 +45,7 @@ f1 f2
1 node1
5 node2
10 node1
15 node2
INSERT INTO t1 VALUES(15, 'node1');
ERROR 23000: Duplicate entry '15' for key 'PRIMARY'
COMMIT;

View File

@@ -61,7 +61,6 @@ SET SESSION wsrep_trx_fragment_size = 10000;
START TRANSACTION;
INSERT INTO t1 VALUE (10, 'node1');
SELECT COUNT(*) FROM mysql.wsrep_streaming_log;
--connection node_1a
INSERT INTO t1 VALUES(15, 'node2');

View File

@@ -3445,6 +3445,20 @@ drop table t;
create table t (a int) with system versioning partition by system_time partitions 3;
ERROR HY000: Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
#
# MDEV-36115 InnoDB: assertion: node->pcur->rel_pos == BTR_PCUR_ON
# in row_update_for_mysql
#
create table t (a int key) engine=innodb
with system versioning
partition by key() partitions 3;
start transaction;
insert into t values (1),(2),(3),(4),(5),(6),(7),(8);
set timestamp=+1;
delete from t;
insert into t values (1),(2);
DELETE from t;
drop table t;
#
# End of 10.5 tests
#
#

View File

@@ -2675,6 +2675,22 @@ drop table t;
--error WARN_VERS_PARAMETERS
create table t (a int) with system versioning partition by system_time partitions 3;
--echo #
--echo # MDEV-36115 InnoDB: assertion: node->pcur->rel_pos == BTR_PCUR_ON
--echo # in row_update_for_mysql
--echo #
create table t (a int key) engine=innodb
with system versioning
partition by key() partitions 3;
start transaction;
insert into t values (1),(2),(3),(4),(5),(6),(7),(8);
set timestamp=+1;
delete from t;
insert into t values (1),(2);
DELETE from t;
drop table t;
--echo #
--echo # End of 10.5 tests
--echo #