mirror of
https://github.com/MariaDB/server.git
synced 2026-02-22 02:28:39 +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>
67 lines
2.1 KiB
Text
67 lines
2.1 KiB
Text
--source include/have_binlog_format_mixed.inc
|
|
--source include/master-slave.inc
|
|
|
|
--echo *** Test the --binlog-directory variable with legacy binlog.
|
|
|
|
--connection slave
|
|
# Stop the slave while restarting master, just to not have to worry about
|
|
# any connect/re-connect tries. We are testing the location of the binlog,
|
|
# not the slave re-connect abilities.
|
|
--source include/stop_slave.inc
|
|
CHANGE MASTER TO master_use_gtid=Slave_pos;
|
|
|
|
--connection master
|
|
SELECT @@GLOBAL.binlog_storage_engine;
|
|
--let $master_datadir= `SELECT @@datadir`
|
|
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
|
|
|
|
INSERT INTO t1 VALUES (1, 10);
|
|
|
|
# Test that the master can be restarted with binlogs in a separate
|
|
# directory specificed by --binlog-directory.
|
|
--let $rpl_server_number= 1
|
|
--source include/rpl_stop_server.inc
|
|
|
|
--mkdir $master_datadir/binlog_dir
|
|
--copy_file $master_datadir/master-bin.000001 $master_datadir/binlog_dir/master-bin.000001
|
|
--copy_file $master_datadir/master-bin.000001.idx $master_datadir/binlog_dir/master-bin.000001.idx
|
|
--move_file $master_datadir/master-bin.state $master_datadir/binlog_dir/master-bin.state
|
|
--let $rpl_server_parameters= --binlog-directory=binlog_dir
|
|
--source include/rpl_start_server.inc
|
|
|
|
INSERT INTO t1 VALUES (2, 11);
|
|
|
|
# Move master back to using the standard binlog directory.
|
|
--source include/rpl_stop_server.inc
|
|
--move_file $master_datadir/binlog_dir/master-bin.state $master_datadir/master-bin.state
|
|
--let $rpl_server_parameters=
|
|
--source include/rpl_start_server.inc
|
|
|
|
INSERT INTO t1 VALUES (3, 12);
|
|
--source include/save_master_gtid.inc
|
|
--source include/show_binary_logs.inc
|
|
--echo *** Contents of master-bin.index (including directory path):
|
|
--cat_file $master_datadir/master-bin.index
|
|
SELECT * FROM t1 ORDER BY a;
|
|
|
|
--connection slave
|
|
--source include/start_slave.inc
|
|
--source include/sync_with_master_gtid.inc
|
|
SELECT * FROM t1 ORDER BY a;
|
|
|
|
# Clean up.
|
|
--connection slave
|
|
--source include/stop_slave.inc
|
|
SET GLOBAL gtid_slave_pos= '';
|
|
|
|
--connection master
|
|
--source include/kill_binlog_dump_threads.inc
|
|
RESET MASTER;
|
|
--rmdir $master_datadir/binlog_dir
|
|
|
|
--connection slave
|
|
--source include/start_slave.inc
|
|
|
|
--connection master
|
|
DROP TABLE t1;
|
|
--source include/rpl_end.inc
|