Details
Description
The following test show how to make a cluster inconsistent with a transaction that uses a savepoint with both innodb and aria storage engines involved:
connection node_1;
|
CREATE TABLE t1 (a INTEGER PRIMARY KEY) engine=innodb;
|
START TRANSACTION;
|
INSERT INTO t1 VALUES (1);
|
SELECT count(*) a from mysql.db;
|
a
|
2
|
SAVEPOINT s1;
|
ERROR 42000: The storage engine for the table doesn't support SAVEPOINT
|
INSERT INTO t1 VALUES (2);
|
COMMIT;
|
connection node_1;
|
SELECT * FROM t1;
|
a
|
1
|
2
|
connection node_2;
|
SELECT * FROM t1;
|
a
|
2
|
Aria does not support SAVEPOINT, so an error is returned and the statement is rolled back.
This statement rollback is incorrectly causes the trx cache to be truncated back to the beginning of the transaction. Ultimately causing an inconsistency, as only the second half of the transaction is replicated to the rest of the cluster.