In this blog post, we’ll look at a transaction replay anomaly in Percona XtraDB Cluster.
Introduction
Percona XtraDB Cluster/Galera replays a transaction if the data is non-conflicting but, the transaction happens to have conflicting locks.
Anomaly
Let’s understand this with an example:
- Let’s assume a two-node cluster (node-1 and node-2)
- Base table “t” is created as follows:
create database test; use test; create table t (i int, c char(20), primary key pk(i)) engine=innodb; insert into t values (1, 'abc'), (2, 'abc'), (4, 'abc'); select * from t; mysql> select * from t; +---+------+ | i | c | +---+------+ | 1 | abc | | 2 | abc | | 4 | abc | +---+------+
- node-2 starts runs a transaction (trx-2): …