[MXS-770] Add "PURGE { BINARY | MASTER } LOGS" functionality Created: 2016-06-16  Updated: 2019-08-01  Resolved: 2017-08-07

Status: Closed
Project: MariaDB MaxScale
Component/s: binlogrouter
Affects Version/s: None
Fix Version/s: 2.2.0

Type: New Feature Priority: Major
Reporter: Hareesh Haridas Assignee: Massimiliano Pinto (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MXS-2262 MXS-770 isn't documented Closed
Sprint: 2017-38

 Description   

Please add support for PURGE

{ BINARY | MASTER }

LOGS. This is important in managing the binary logs and disk usage.

~Hareesh



 Comments   
Comment by Massimiliano Pinto (Inactive) [ 2017-08-04 ]

Added MXS-770 branch.

PURGE BINARY LOGS TO ‘file’; deletes all files in binlogdir and GTID
maps repo up to specified file.

mariadb10_slave_gtid=On option is needed in order to keep the list of
binlog files.

Documentation update and usage examples will be part of next commits.

Tested with mariadb10_master_gtid=On and binlog_structure=flat|tree
and with mariadb10_master_gtid=Off (implies binlog_structure=flat)

Current binlog file cannot be deleted.

Some cases:

MySQL [(none)]> purge binary logs to 'mysql-bin.00011s3';
ERROR 1198 (HY000): Cannot execute PURGE BINARY LOGS with a running slave; run STOP SLAVE first.

MySQL [(none)]> purge binary logs to 'fishy-bin.AA011s3';
ERROR 1373 (HY000): Target log not found in binlog index

MySQL [(none)]> purge binary logs to 'mysql-bin.000118';
Query OK, 0 rows affected (0.08 sec)

Comment by Massimiliano Pinto (Inactive) [ 2017-08-07 ]

MaxScale/commit/113d2ad87a3352ff4a6d97a72c9d6dd3e6a711cd

In 'develop' branch

Generated at Thu Feb 08 04:01:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.