Bug #71697 | Make expire_logs_days accept decimal values (more flexible retention) | ||
---|---|---|---|
Submitted: | 13 Feb 2014 7:25 | Modified: | 24 May 2017 6:36 |
Reporter: | Simon Mudd (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Utilities: Binlog Events | Severity: | S4 (Feature request) |
Version: | 5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | binlog, retention, windmill |
[13 Feb 2014 7:25]
Simon Mudd
[13 Feb 2014 8:00]
MySQL Verification Team
also: http://bugs.mysql.com/bug.php?id=68236
[17 Feb 2014 12:27]
Mats Kindahl
Thanks for the report. Verified as described. The internal representation of expire_logs_days is unsigned long, and changing this to a floating point value would allow computations to be done in the same way as before, so it is a straightforward change.
[6 Apr 2017 2:25]
Jon Stephens
This issue is addressed in MySQL 8.0.1 by the addition of the binlog_expire_logs_days system variable.
[6 Apr 2017 9:36]
Jon Stephens
See BUG#85828.
[6 Apr 2017 15:36]
Simon Mudd
I do not understand why you implement this FR with a different variable and then try to deprecate this one. All you do with that is make life for people that use these settings harder as they have to use one setting for 5.7 and earlier and a different one for 8.0 and later. If you manager servers of both versions then this makes configuration management harder. The suggestion I made was to use the same variable and make it backwards compatible (integer value behaviour would not change) but decimal usage would give more flexibility. And additionally if you used a "period suffix" then you could make it clearer the intent that was needed. The solution implemented in 8.0 is not really very user friendly.
[23 May 2017 20:07]
Sven Sandberg
Thank you for your feedback, Simon! We chose to use seconds because: - We want to standardize on using seconds for measuring time. (I believe expire_logs_days is the only place that uses days). - It becomes easy to format/parse in HH:MM:SS format, using SEC_TO_TIME/TIME_TO_SEC, or standard library calls in most languages. Notice that you can still use expire_logs_days, and even in combination with binlog_expire_logs_seconds, e.g. like: SET GLOBAL expire_logs_days = 2, binlog_expire_logs_seconds = TIME_TO_SEC('12:00:00') to set 2.5 days expiration. You can also use: SET GLOBAL binlog_expire_logs_seconds = TIME_TO_SEC('2 12:00:00') as an alternative to set 2.5 days expiration. Expire_logs_days still exists and has not been deprecated. (There is a *proposal* to change the name in order to have more consistent identifier prefixes. That would involve a deprecation procedure with the old name existing as an alias for the new one during one or more major versions.) I sincerely hope this feature will make it easy for you to set your binlog expiration time with sub-day precision!
[24 May 2017 6:36]
Simon Mudd
Thanks for the effort you are putting into this. That is appreciated. Moving to support a decimal/floating point expire_logs_days would have solved more situations, and if you want to move to seconds I would have supported a format such as "12h", "2d8h", "36s" etc as that's much more usable than people using seconds. Why do you allow innodb_buffer_pool_size = "800M", or "80G" ? Simply because that is a much more intuitive measure (and a quick read) than 838860800 or 85899345920. If you don't pay attention the 2 values look the same and you have to count the digits to be sure. So the ease of use of understanding the value means a lot to those who have different servers with different configurations and need to manage this. Had you started with the _seconds setting that that would have been fine. History is hard to explain to people but you're going to force people who manage 5.7 and 8.0 (not to talk about AWS, MariaDB etc) where have to check the version of MySQL they are using when generating the configuration settings and also when making changes to the server. That's a larger cost, which may not be for most people but bites those of us who manage multiple versions and different "forks" of MySQL. I guess it is done now but in the future please don't only consider a single MySQL version when changing settings. Think about those who manage more and try to keep things as simple as possible where that is possible.