Bug #71997 Please make relay_log_recovery dynamically configurable
Submitted: 10 Mar 2014 17:32 Modified: 13 Mar 2014 11:24
Reporter: Simon Mudd (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:5.6.15 OS:Any
Assigned to: Jon Stephens CPU Architecture:Any
Tags: dynamic, relay_log_recovery, replication

[10 Mar 2014 17:32] Simon Mudd
Description:
Every time you make configuration variables static you cause problems.

Something like this has no need to be static and means the slave must be bounced in order to have a "crash safe" configuration setting.

How to repeat:
mysql> set global relay_log_recovery = 1;
ERROR 1238 (HY000): Variable 'relay_log_recovery' is a read only variable

Suggested fix:
Please make this configuration setting dynamic in MySQL 5.7.
[10 Mar 2014 17:44] Simon Mudd
I see this is supposed to be fixed in 5.7 here: http://dev.mysql.com/doc/refman/5.7/en/replication-options-slave.html#sysvar_relay_log_rec..., yet on a 5.7.3 box I have I get:

root@myhost [(none)]> show global variables like 'relay_log_recovery';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| relay_log_recovery | OFF   |
+--------------------+-------+
1 row in set (0.00 sec)

root@myhost [(none)]> set global relay_log_recovery = 1;
ERROR 1238 (HY000): Variable 'relay_log_recovery' is a read only variable
root@myhost [(none)]> select @@version;
+---------------+
| @@version     |
+---------------+
| 5.7.3-m13-log |
+---------------+
1 row in set (0.00 sec)

root@myhost [(none)]> 

So if this is fixed in 5.7 please specify in which version the change took place for clarity. Perhaps this will come out in 5.7.4?
[10 Mar 2014 17:58] Simon Mudd
A brief look at: http://dev.mysql.com/doc/relnotes/mysql/5.7/en/ which links to:

http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-5.html (Not yet released, Milestone 15)
http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-4.html (Not yet released, Milestone 14)

Does not seem to show this variable setting being made dynamic, so I am somewhat confused.
[10 Mar 2014 18:03] Simon Mudd
I also note that: http://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#sysvar_relay_log_rec... also says this setting is dynamic.

So it looks like a documentation bug but I'd certainly like to see this value being dynamic as per the synopsis of this bug report.
[10 Mar 2014 19:53] Simon Mudd
I've reread this description of the configuration setting again:

"Enables automatic relay log recovery immediately following server startup, which means that the replication slave discards all unprocessed relay logs and retrieves them from the replication master."

So the configuration setting is only ever used on server startup and at no other time.
Therefore it has been configured to NOT be dynamically configurable, which makes sense.

A similar configuration setting is: innodb_buffer_pool_load_at_startup  = 1.

So please:
(1) adjust the documentation to correctly reflect the fact this setting is not dynamically configurable, or
(2) allow it to be configured, even if it does not actually make the server behave any differently once it is running [Note 1]
[10 Mar 2014 20:01] Simon Mudd
Note 1:

This whole issue came up as I have configuration management tools that are designed to update /etc/my.cnf with the server's intended configuration and then to compare this file to the server's running configuration. Those variables marked as dynamic are changed, and those that are not are noted, so that I can restart the server to pick up the required changes at an appropriate moment.

So while it makes little sense from a functional point of view to make the setting dynamic (it does nothing), it does allow such tools to make the change and see that the running configuration matches the required configuration.

Ideally this "dynamic variable" setting should be visible inside the server, and not in the MySQL documentation as then it would be possible to query the server itself and figure out which variables can be changed. Currently these settings are managed manually which is not ideal and actually there's more than just dynamic as indicated in: https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html

There is:
- static, you can not change the variable
- dynamic, you can change the variable
- dynamic [replication], you can change the variable when replication is stopped
- static [startup setting], it makes no sense to try to change this setting as it's a startup setting.

I'd really to see this information visible for all global variables inside the output of I_S.GLOBAL_VARIABLES as otherwise I have to maintain all this information by hand outside of MySQL and of course this is error  prone.
[10 Mar 2014 20:30] Simon Mudd
And this all comes back to comments I made quite a while ago: http://blog.wl0.org/2011/11/managing-mysqls-configuration/
[13 Mar 2014 11:23] Jon Stephens
The 5.7 Manual says regarding this variable, "In MySQL 5.7, this global variable is read-only". No specific 5.7 release is given because there is no need to do so; had there been a change in its behaviour in 5.7, we would not have made a general statement encompassing all of 5.7 generally.
[13 Mar 2014 11:24] Jon Stephens
I've fixed the data from which the indicated table is generated.

Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.
[13 Mar 2014 11:30] Jon Stephens
Fixed in mysqldoc rev 38057.