forked from MariaDB/server
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-30653 : With wsrep_mode=REPLICATE_ARIA only part of mixed-engine…
… transactions is replicated For both MyISAM and Aria Galera replication is experimental. Problem was that both MyISAM and Aria do not support 2PC that is required if more than one storage engine participates transaction. For Galera we return error if transaction contains DML for MyISAM or Aria even if user has requested replication for them.
- Loading branch information
1 parent
79ba84a
commit 5150106
Showing
9 changed files
with
383 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
connection node_2; | ||
connection node_1; | ||
connection node_1; | ||
create table t1 (id serial not null primary key, val int) engine=innodb; | ||
create table t2 (id serial not null primary key, val int) engine=aria; | ||
insert into t1 values(1, 23); | ||
insert into t2 values(2, 42); | ||
begin; | ||
update t1 set val=24 where id=1; | ||
update t2 set val=41 where id=2; | ||
commit; | ||
ERROR HY000: Transactional commit not supported by involved engine(s) | ||
SELECT * FROM t1; | ||
id val | ||
1 23 | ||
SELECT * FROM t2; | ||
id val | ||
2 41 | ||
connection node_2; | ||
SELECT * FROM t1; | ||
id val | ||
1 23 | ||
SELECT * FROM t2; | ||
id val | ||
DROP TABLE t1, t2; | ||
connection node_1; | ||
SET GLOBAL wsrep_mode='REPLICATE_ARIA'; | ||
create table t1 (id serial not null primary key, val int) engine=innodb; | ||
create table t2 (id serial not null primary key, val int) engine=aria; | ||
insert into t1 values(1, 23); | ||
insert into t2 values(2, 42); | ||
begin; | ||
update t1 set val=24 where id=1; | ||
update t2 set val=41 where id=2; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
commit; | ||
SELECT * FROM t1; | ||
id val | ||
1 24 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
connection node_2; | ||
SELECT * FROM t1; | ||
id val | ||
1 24 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
DROP TABLE t1, t2; | ||
connection node_1; | ||
SET GLOBAL wsrep_mode=''; | ||
connection node_1; | ||
SET GLOBAL wsrep_mode='REPLICATE_MYISAM'; | ||
create table t1 (id serial not null primary key, val int) engine=innodb; | ||
create table t2 (id serial not null primary key, val int) engine=myisam; | ||
insert into t1 values(1, 23); | ||
insert into t2 values(2, 42); | ||
begin; | ||
update t1 set val=24 where id=1; | ||
update t2 set val=41 where id=2; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
commit; | ||
SELECT * FROM t1; | ||
id val | ||
1 24 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
connection node_2; | ||
SELECT * FROM t1; | ||
id val | ||
1 24 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
DROP TABLE t1, t2; | ||
connection node_1; | ||
SET GLOBAL wsrep_mode='REPLICATE_MYISAM,REPLICATE_ARIA'; | ||
create table t1 (id serial not null primary key, val int) engine=innodb; | ||
create table t2 (id serial not null primary key, val int) engine=myisam; | ||
create table t3 (id serial not null primary key, val int) engine=aria; | ||
insert into t1 values(1, 23); | ||
insert into t2 values(2, 42); | ||
insert into t3 values(3, 23); | ||
begin; | ||
update t1 set val=24 where id=1; | ||
update t2 set val=41 where id=2; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
update t3 set val=24 where id=3; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
commit; | ||
SELECT * FROM t1; | ||
id val | ||
1 24 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
SELECT * FROM t3; | ||
id val | ||
3 23 | ||
connection node_2; | ||
SELECT * FROM t1; | ||
id val | ||
1 24 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
SELECT * FROM t3; | ||
id val | ||
3 23 | ||
DROP TABLE t1,t2,t3; | ||
connection node_1; | ||
SET GLOBAL wsrep_mode='REPLICATE_MYISAM,REPLICATE_ARIA'; | ||
create table t1 (id serial not null primary key, val int) engine=innodb; | ||
create table t2 (id serial not null primary key, val int) engine=myisam; | ||
create table t3 (id serial not null primary key, val int) engine=aria; | ||
insert into t1 values(1, 23); | ||
insert into t2 values(2, 42); | ||
insert into t3 values(3, 23); | ||
begin; | ||
update t2 set val=411 where id=2; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
update t3 set val=500 where id=3; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
update t1 set val=241 where id=1; | ||
commit; | ||
SELECT * FROM t1; | ||
id val | ||
1 241 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
SELECT * FROM t3; | ||
id val | ||
3 23 | ||
connection node_2; | ||
SELECT * FROM t1; | ||
id val | ||
1 241 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
SELECT * FROM t3; | ||
id val | ||
3 23 | ||
DROP TABLE t1, t2, t3; | ||
connection node_1; | ||
create table t1 (id serial not null primary key, val int) engine=myisam; | ||
create table t2 (id serial not null primary key, val int) engine=aria; | ||
insert into t1 values(1, 23); | ||
insert into t2 values(2, 42); | ||
begin; | ||
update t1 set val=411 where id=2; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
commit; | ||
begin; | ||
update t2 set val=411 where id=2; | ||
ERROR HY000: Galera does not support transactions containing engines not supporting 2 phase commit | ||
commit; | ||
SELECT * FROM t1; | ||
id val | ||
1 23 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
connection node_2; | ||
SELECT * FROM t1; | ||
id val | ||
1 23 | ||
SELECT * FROM t2; | ||
id val | ||
2 42 | ||
DROP TABLE t1, t2; | ||
connection node_1; | ||
SET GLOBAL wsrep_mode=''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.