mirror of
https://github.com/MariaDB/server.git
synced 2026-02-22 10:38:40 +01:00
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>
80 lines
2.4 KiB
Text
80 lines
2.4 KiB
Text
--source include/not_embedded.inc
|
|
--source include/not_valgrind.inc
|
|
--source include/have_debug.inc
|
|
--source include/have_binlog_format_row.inc
|
|
--source include/have_innodb_binlog.inc
|
|
|
|
--let $datadir= `SELECT @@datadir`
|
|
--source include/reset_master.inc
|
|
|
|
# This test case is to test recovery when pre-allocation of tablespaces gets
|
|
# behind and recovery has to create a new file during redo log playback.
|
|
#
|
|
# But controlling pre-allocation is tricky as it runs as a thread in the
|
|
# background. Instead, simply delete the files after crashing the server,
|
|
# to test that they are recovered correctly from the redo log.
|
|
|
|
--echo *** This test depends on configured size of binlogs.
|
|
|
|
CREATE TABLE t1 (a INT PRIMARY KEY, b longtext) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES (1, '');
|
|
|
|
# Let's fill up most, but not all, of binlog-000000.ibb
|
|
INSERT INTO t1 VALUES (2, REPEAT('2', 200000));
|
|
|
|
# Now try to avoid an innodb checkpoint (required to be able to still recover
|
|
# following updates).
|
|
|
|
--let $no_checkpoint_flush= 1
|
|
--let no_checkpoint_kill= 1
|
|
--source ../../suite/innodb/include/no_checkpoint_start.inc
|
|
|
|
# Then fill up rest of binlog-000000.ibb, and some but not all of
|
|
# binlog-000001.ibb.
|
|
INSERT INTO t1 VALUES (3, REPEAT('3', 200000));
|
|
|
|
# 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
|
|
--error 0,1,2
|
|
--remove_file $datadir/binlog-000001.ibb
|
|
--error 0,1,2
|
|
--remove_file $datadir/binlog-000002.ibb
|
|
|
|
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
|
restart
|
|
EOF
|
|
--enable_reconnect
|
|
--source include/wait_until_connected_again.inc
|
|
|
|
--let $binlog_file= binlog-000000.ibb
|
|
--let $binlog_start= 4
|
|
--source include/show_binlog_events.inc
|
|
--let $binlog_file= binlog-000001.ibb
|
|
--let $binlog_start= 4
|
|
--source include/show_binlog_events.inc
|
|
|
|
--echo *** Test starting the server with only a single, completely empty, binlog file.
|
|
|
|
--let $binlog_name= binlog-000002.ibb
|
|
--let $binlog_size= 262144
|
|
--source include/wait_for_engine_binlog.inc
|
|
|
|
--source include/shutdown_mysqld.inc
|
|
--remove_file $datadir/binlog-000000.ibb
|
|
--remove_file $datadir/binlog-000001.ibb
|
|
|
|
--source include/start_mysqld.inc
|
|
|
|
DROP TABLE t1;
|
|
--let $binlog_file= binlog-000002.ibb
|
|
--let $binlog_start= 4
|
|
--source include/show_binlog_events.inc
|