mirror of
https://github.com/MariaDB/server.git
synced 2026-02-28 13:38:40 +01:00
This happened when the first OOB record of an event group spans two binlog files, say N and N+1. The reference counting would wrongly attribute the OOB to N+1, allowing N to be purged while it was still needed. This for example could cause server restart to fail when it tries to recover the GTID state from N+1, unable to follow OOB references to N because it was purged before the server restart. Fix by: - Increment OOB refcount _before_ binlogging the first OOB record. - Decrement refcount only _after binlogging complete. - Protecting from purge any files referenced from the active file. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
31 lines
995 B
Text
31 lines
995 B
Text
include/reset_master.inc
|
|
SET GLOBAL slave_connections_needed_for_purge= 0;
|
|
SET GLOBAL max_binlog_total_size= 128*1024;
|
|
Warnings:
|
|
Note 1375 Binary log 'binlog-000000.ibb' is not purged because the binlog file is in active use
|
|
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL, c LONGBLOB, PRIMARY KEY(a, b)) ENGINE=InnoDB;
|
|
INSERT INTO t1 VALUES (1, 0, REPEAT('x', 262144-8000));
|
|
BEGIN;
|
|
INSERT INTO t1 VALUES (2, 0, REPEAT('y', 40000));
|
|
INSERT INTO t1 VALUES (2, 1, 'end');
|
|
COMMIT;
|
|
show binary logs;
|
|
Log_name File_size
|
|
binlog-000000.ibb #
|
|
binlog-000001.ibb #
|
|
binlog-000002.ibb #
|
|
# restart
|
|
SET @old_min_slaves= @@GLOBAL.slave_connections_needed_for_purge;
|
|
SET GLOBAL slave_connections_needed_for_purge= 0;
|
|
show binary logs;
|
|
Log_name File_size
|
|
binlog-000000.ibb #
|
|
binlog-000001.ibb #
|
|
binlog-000002.ibb #
|
|
PURGE BINARY LOGS TO 'binlog-000001.ibb';
|
|
show binary logs;
|
|
Log_name File_size
|
|
binlog-000001.ibb #
|
|
binlog-000002.ibb #
|
|
SET GLOBAL slave_connections_needed_for_purge= @old_min_slaves;
|
|
DROP TABLE t1;
|