mirror of
https://github.com/MariaDB/server.git
synced 2026-03-01 22:19:02 +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>
45 lines
1.5 KiB
Text
45 lines
1.5 KiB
Text
--source include/have_binlog_format_row.inc
|
|
--source include/have_innodb_binlog.inc
|
|
|
|
--source include/reset_master.inc
|
|
|
|
SET GLOBAL slave_connections_needed_for_purge= 0;
|
|
|
|
# Set a very low value to force purge as early as possible.
|
|
SET GLOBAL max_binlog_total_size= 128*1024;
|
|
|
|
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, c LONGBLOB, PRIMARY KEY(a, b)) ENGINE=InnoDB;
|
|
|
|
# Test that refcounting works correctly when an OOB spill spans two binlog files.
|
|
# First let's get the binlog position to shortly before the end of binlog-000000.ibb
|
|
|
|
INSERT INTO t1 VALUES (1, 0, REPEAT('x', 262144-8000));
|
|
|
|
# Now there are no outstanding oob references to binlog-000000.ibb.
|
|
# Then spill a new OOB, which will span from binlog-000000.ibb into
|
|
# binlog-000001.ibb. Then the header page of binlog-000001.ibb must
|
|
# have oob reference file_no=0, not 1, as the _start_ of the new oob
|
|
# is in file 0.
|
|
|
|
BEGIN;
|
|
INSERT INTO t1 VALUES (2, 0, REPEAT('y', 40000));
|
|
INSERT INTO t1 VALUES (2, 1, 'end');
|
|
COMMIT;
|
|
|
|
--let $binlog_name= binlog-000002.ibb
|
|
--let $binlog_size= 262144
|
|
--source include/wait_for_engine_binlog.inc
|
|
--source include/show_binary_logs.inc
|
|
|
|
--source include/restart_mysqld.inc
|
|
SET @old_min_slaves= @@GLOBAL.slave_connections_needed_for_purge;
|
|
SET GLOBAL slave_connections_needed_for_purge= 0;
|
|
|
|
--source include/show_binary_logs.inc
|
|
PURGE BINARY LOGS TO 'binlog-000001.ibb';
|
|
--source include/show_binary_logs.inc
|
|
|
|
SET GLOBAL slave_connections_needed_for_purge= @old_min_slaves;
|
|
# We do not need to restore max_binlog_total_size, as we restarted the server.
|
|
|
|
DROP TABLE t1;
|