Three new patches for mysqlbinlog
After a minor coding blitz I have created 3 patches for mysqlbinlog (one is more of an enhancement of a previous patch):
- Compression support (patch here)
- SSL support (patch here)
- RAW mode (updated patch
here) - See update below for updated patch
The compression support patch adds the --compress parameter adds support for compression when retrieving data from a remote MySQL server, much in the same way that other mysql clients do. Basic tests indicate it compresses data up to 10x for SBR statements.
The SSL support patch adds the --ssl* parameters to the mysqlbinlog client just as the other mysql clients.
The RAW mode patch is almost an entire rewrite of the original RAW mode patch fixing all the problem introduced in it. For those not familia with it the patch introduces a way of backing up the remote binlog files without having a remote slave running or using something like SCP. One possible usage for this to have a live up-to-the-second backup of your data like this:
- Run mysqlbinlog --raw --read-from-remote-server --host=mysqlserver.address --to-last-log=2 mysqld-bin.000001
- Grab a mysqldump --master-data=2 --host=mysqlserver.address
- Repeat #2 every hour (or however long you want the snapshots to be)
Change summary:
- mysqlbinlog safe exits with CTRL-C or kill
- --raw added which will retrieve raw binlog files from the remote server and save them using the filenames in the replication headers
- --to-last-log is now an int, =1 is the old behaviour (stop at end of last log), =2 is continuous (sets serverID=255)
- --result-dir added for use with --raw mode
- --result-file modified so that when used with --raw mode it is a prefix for the output files
UPDATE 2009-03-13:
A user of this patch noticed 2 bugs with it. Firstly the --result-dir caused a crash if the directory did not exist, and secondly it was not handling the binlog headers correctly. I have fixed both of these problems and take4 of the patch can be found here.


So are those patches going anywhere? We wouldn't want them to bitrot...
You could submit them for OurDelta (http://launchpad.net/ourdelta
Posted by Arjen Lentz on March 02, 2009 at 02:28 PM GMT #
Hi Arjen,
I am trying to get these (or a variant of) into the main MySQL source. OurDelta or anyone else are welcome to use/include them in the mean time.
Posted by LinuxJedi on March 03, 2009 at 10:51 AM GMT #
Hi Andrew -
Please use one of the public channels to contribute code to MySQL. These are "internals" and the "bugs db" channels.
Once you do that, please attach a comment here so people know how to track the "destiny" of this contribution w.r.t. MySQL.
This way people can more openly discuss the patch you're proposing here.
You're a Sun employee and have no need for an SCA.
Take a look here; http://forge.mysql.com/wiki/Contributing_Code
Regards,
Masood
Posted by M. Mortazavi on March 30, 2009 at 07:21 AM BST #