1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-34705: Binlog in Engine: Resume from existing binlogs

When (re-)starting the server, check for any existing binlog files.
Open the last two found (if any), and find the position that was last
written before the restart. Continue binlogging from that point rather
than creating new binlog files.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2024-09-22 18:04:17 +02:00
parent 39695c3956
commit 1794fd427a
7 changed files with 455 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
--source include/have_innodb.inc
--source include/have_innodb_binlog.inc
--source include/have_binlog_format_mixed.inc
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
--source include/have_innodb_binlog.inc
--source include/have_binlog_format_mixed.inc
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog1.txt
--source include/restart_mysqld.inc
INSERT INTO t1 VALUES (2, 0);
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog2.txt
--source include/restart_mysqld.inc
INSERT INTO t1 VALUES (3, 0);
--exec $MYSQL_BINLOG --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog3.txt
DROP TABLE t1;