mariadb/mysql-test/suite/binlog_in_engine/recovery.test
Kristian Nielsen 7081f2a58e Binlog-in-engine: New binlog implementation integrated in InnoDB
Implement an improved binlog implementation that is integrated into
the storage engine. The new implementation is enabled with the
--binlog-storage-engine option. Initially the InnoDB storage engine
implements the binlog.

Integrating the binlog in the storage engine improves performance,
since it makes the InnoDB redo log the single source of truth and
avoids the need for expensive two-phase commit between binlog and
engine. It also makes it possible to disable durability (set
--innodb-flush-log-at-trx-commit=0) to further improve performance,
while still preserving the ability to recover the binlog and database
into a consistent state after a crash.

The new binlog implementation also greatly improves the internal
design and implementation of the binlog, and enables future
enhancements for replication.

This is a squash of the original 11.4-based patch series.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2026-01-23 03:21:03 +01:00

62 lines
1.5 KiB
Text

--source include/not_embedded.inc
--source include/not_valgrind.inc
--source include/have_debug.inc
--source include/have_binlog_format_mixed.inc
--source include/have_innodb_binlog.inc
--let $datadir= `SELECT @@datadir`
--source include/reset_master.inc
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--let $no_checkpoint_flush= 1
--let no_checkpoint_kill= 1
--source ../../suite/innodb/include/no_checkpoint_start.inc
--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
BEGIN;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
COMMIT;
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
SELECT * FROM t1 ORDER BY a;
# Crash the server
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait-recovery.test
EOF
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
--error 2006,2013
SELECT 1;
--source include/wait_until_disconnected.inc
--source ../../suite/innodb/include/no_checkpoint_end.inc
# Overwrite the binlog file past the last checkpoint
--let BINLOG_FILE= $datadir/$file
--let OFFSET= $pos
--let LEN=5000
perl;
open F, '+<', $ENV{BINLOG_FILE} or die $!;
sysseek F, $ENV{OFFSET}, 0 or die $!;
my $x= chr(0) x $ENV{LEN};
syswrite F, $x, $ENV{LEN} or die $!;
EOF
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
--let $binlog_file=
--let $binlog_start= 4
--source include/show_binlog_events.inc
DROP TABLE t1;