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

Binlog-in-engine: Implement dynamically changing binlog max size

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2025-07-16 21:25:00 +02:00
parent 31ba7922a0
commit 685b0b0def
8 changed files with 41 additions and 8 deletions

View File

@@ -164,4 +164,14 @@ SELECT @@GLOBAL.gtid_binlog_state;
SELECT @@GLOBAL.gtid_binlog_state;
@@GLOBAL.gtid_binlog_state
0-1-2508,1-1-1003
SET @old_max_size= @@GLOBAL.max_binlog_size;
SET GLOBAL max_binlog_size= 1048576;
FLUSH BINARY LOGS;
SHOW BINARY LOGS;
Log_name File_size
binlog-000030.ibb 8192
binlog-000031.ibb 8192
binlog-000032.ibb 262144
binlog-000033.ibb 1048576
SET GLOBAL max_binlog_size= @old_max_size;
DROP TABLE t1;

View File

@@ -247,6 +247,18 @@ SELECT @@GLOBAL.gtid_binlog_state;
--source include/restart_mysqld.inc
SELECT @@GLOBAL.gtid_binlog_state;
# Test dynamically changing the max binlog size.
SET @old_max_size= @@GLOBAL.max_binlog_size;
--let $binlog_size= 1048576
eval SET GLOBAL max_binlog_size= $binlog_size;
FLUSH BINARY LOGS;
--let $binlog_name= binlog-000033.ibb
--source include/wait_for_engine_binlog.inc
SHOW BINARY LOGS;
SET GLOBAL max_binlog_size= @old_max_size;
DROP TABLE t1;
# No need to restore @@GLOBAL.slave_connections_needed_for_purge, as we

View File

@@ -16,7 +16,6 @@
--source suite/rpl/include/rpl_gtid_index.inc
--echo *** Switch to a larger binlog size
# ToDo: Fix that in current code, changing max_binlog_size dynamically is silently ignored.
SET @old_binlog_size= @@GLOBAL.max_binlog_size;
SET GLOBAL max_binlog_size= 16*1024*1024;
--let $NUM_POS= 1000