[MDEV-8713] Add continuous binary log backup to mysqlbinlog Created: 2015-09-01  Updated: 2016-10-30  Resolved: 2016-02-27

Status: Closed
Project: MariaDB Server
Component/s: Replication, Scripts & Clients
Fix Version/s: 10.2.0

Type: Task Priority: Critical
Reporter: Chris Calender (Inactive) Assignee: Alexey Botchkov
Resolution: Fixed Votes: 6
Labels: None

Issue Links:
Duplicate
duplicates MDEV-5993 MySQL WL#4783 Extend mysqlbinlog to ... Closed
is duplicated by MDEV-8996 Add to Mysqlbinlog --raw and --stop-n... Closed
Relates
relates to MDEV-8473 mysqlbinlog -v does not properly deco... Closed
relates to MDEV-11177 mysqlbinlog exits silently without er... Closed
relates to MDEV-9792 Backport MDEV-8713 to 10.1 Closed
Sprint: 10.2.0-1, 10.2.0-5, 10.2.0-6

 Description   

This is a request to add continuous binary log backup to mysqlbinlog, such as exists in the MySQL mysqlbinlog as of 5.6.

"As of MySQL 5.6, mysqlbinlog can read binary log files and write new files containing the same content—that is, in binary format rather than text format. This capability enables you to easily back up a binary log in its original format. mysqlbinlog can make a static backup, backing up a set of log files and stopping when the end of the last file is reached. It can also make a continuous (“live”) backup, staying connected to the server when it reaches the end of the last log file and continuing to copy new events as they are generated. In continuous-backup operation, mysqlbinlog runs until the connection ends (for example, when the server exits) or mysqlbinlog is forcibly terminated. When the connection ends, mysqlbinlog does not wait and retry the connection, unlike a slave replication server. To continue a live backup after the server has been restarted, you must also restart mysqlbinlog."

https://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog-backup.html

This also requires the addition of 2 new mysqlbinlog options:

--stop-never
--stop-never-slave-server-id=id

https://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog.html#option_mysqlbinlog_stop-never
https://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog.html#option_mysqlbinlog_stop-never-slave-server-id



 Comments   
Comment by Elena Stepanova [ 2015-09-01 ]

We already have a similar request, MDEV-8473. But that entry describes two separate issues – a feature request for new options from 5.6, and an upstream bug https://bugs.mysql.com/bug.php?id=65812. So, I am going to convert this one, MDEV-8713, to a feature request, while MDEV-8473 will remain a bug report.

Comment by Elena Stepanova [ 2015-09-01 ]

Please note that MDEV-8473 also requested --raw option.

Comment by Elena Stepanova [ 2015-09-01 ]

I've added 10.1 to the list of 'Fix version(s)' just in case it can somehow be added there, although I highly doubt that, please don't see it as a promise.

Comment by Chris Calender (Inactive) [ 2015-09-02 ]

Yes, thank you, the --raw option should also be included with this.

--raw

"By default, mysqlbinlog reads binary log files and writes events in text format. The --raw option tells mysqlbinlog to write them in their original binary format. Its use requires that --read-from-remote-server also be used because the files are requested from a server. mysqlbinlog writes one output file for each file read from the server. The --raw option can be used to make a backup of a server's binary log. With the --stop-never option, the backup is “live” because mysqlbinlog stays connected to the server. By default, output files are written in the current directory with the same names as the original log files. Output file names can be modified using the --result-file option. For more information, see Section 4.6.8.3, 'Using mysqlbinlog to Back Up Binary Log Files'. This option was added in MySQL 5.6.0."

https://dev.mysql.com/doc/refman/5.6/en/mysqlbinlog.html#option_mysqlbinlog_raw

Comment by VAROQUI Stephane [ 2015-11-23 ]

Please note that semi sync was added to this feature in WebScaleSQL

Comment by Alexey Botchkov [ 2015-11-27 ]

Patch proposal:
http://lists.askmonty.org/pipermail/commits/2015-November/008692.html

Comment by Alexey Botchkov [ 2016-02-26 ]

Patch proposal v2:
http://lists.askmonty.org/pipermail/commits/2016-February/009051.html

Comment by Sergei Golubchik [ 2016-02-26 ]

ok to push

Comment by Chris Calender (Inactive) [ 2016-03-03 ]

Are the only real changes here to mysqlbinlong.cc?

If so, can this be backported to a GA version, say 10.1, and/or even 10.0?

Comment by Chris Calender (Inactive) [ 2016-03-03 ]

Many thanks for adding this, btw!

Comment by Alexey Botchkov [ 2016-03-07 ]

Chris,
from the technical point of view yes, it can be backported to 10.0.

Generated at Thu Feb 08 07:29:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.