MySQL and more

Thursday, February 7, 2013

The Curious Case of the Missing Binlogs

When you enable binlogs in the my.cnf file you can either set the log-bin flag to true, or you can set it to a path and file name prefix such as this:

[mysqld]
log-bin=/path/to/binlogs/mysql-binlog
This changes the default location where binlogs are stored.  The problem is that when you connect to mysql there is currently no way to query the server to find out if that path has been changed, and what it currently is.  This means you can't be sure where any server's binlogs are actually stored.

Ok, so they're not really missing, but it's a known issue that mysql doesn't make them easy to find.  The server obviously knows the path internally, but it doesn't make this information available. Bug #35231 has been open on this issue since 2008 and is currently being ignored.

Why?

This is such a trivial change to expose that info somewhere.  Why neglect such basic information?

The relay_log variable which behaves the same in the conf file, shows the behavior you would expect in the global variables on the server -- the same as the value you set in the conf.

If MySQL is worried about backwards compatibility then please just add a new variable name.

3 comments:

Andrew said...

You might be interested in MySQL 5.6's log-bin-basename:

http://dev.mysql.com/doc/refman/5.6/en/replication-options-binary-log.html#sysvar_log_bin_basename

Luís Soares said...

Hi,

MySQL 5.6 has log_bin_basename:

http://dev.mysql.com/doc/refman/5.6/en/replication-options-binary-log.html#sysvar_log_bin_basename

Seems like it is what you were looking for... Or, did you mean something else/extra?

Luís

gtowey said...

Thanks for the information to both. I'm glad to see that this has been remedied in 5.6 -- although it's strange to find the bug which describes this issue is still open. Someone could close that.

Even though 5.6 is GA now, it's still going to be some time before it's going to be used in my environment. It's still sad to see that it took so long for this issue to be addressed, and how a simple fix isn't being back ported.

Followers