mariadb/mysql-test/suite/maria/maria-connect.result
unknown 0697ee265f MDEV-181: XID crash recovery across binlog boundaries
Keep track of how many pending XIDs (transactions that are prepared in
storage engine and written into binlog, but not yet durably committed
on disk in the engine) there are in each binlog.

When the count of one binlog drops to zero, write a new binlog checkpoint
event, telling which is the oldest binlog with pending XIDs.

When doing XA recovery after a crash, check the last binlog checkpoint
event, and scan all binlog files from that point onwards for XIDs that
must be committed if found in prepared state inside engine.

Remove the code in binlog rotation that waits for all prepared XIDs to
be committed before writing a new binlog file (this is no longer necessary
when recovery can scan multiple binlog files).
2012-06-22 11:46:28 +02:00

28 lines
885 B
Text

set global storage_engine=aria;
set session storage_engine=aria;
drop table if exists t1;
SET SQL_WARNINGS=1;
RESET MASTER;
set binlog_format=statement;
CREATE TABLE t1 (a int primary key);
insert t1 values (1),(2),(3);
insert t1 values (4),(2),(5);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select * from t1;
a
1
2
3
4
SHOW BINLOG EVENTS FROM <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a int primary key)
master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Query 1 # use `test`; insert t1 values (1),(2),(3)
master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Query 1 # use `test`; insert t1 values (4),(2),(5)
master-bin.000001 # Query 1 # COMMIT
drop table t1;
set binlog_format=default;