Tuesday, October 23, 2018

Arg: relay_log_space_limit is (still) not dynamic !

This will be a short rant: why is relay_log_space_limit still not dynamic ?

This is obviously a rhetorical question.  I see no reason why this MySQL System Variable is not (yet) dynamic.  Obviously, changing the value of this variable could need replication to be stopped (like for slave_parallel_type, slave_parallel_workers and slave_preserve_commit_order), but at least it would not need a MySQL restart.

I have been faced many times with situations where changing relay_log_space_limit would have been the right solution, but not being able to do it without restarting MySQL made my life harder.  I faced this again recently, its annoyance grew even more, so I am writing this rant !

I also opened Bug#92891 - Please make relay_log_space_limit dynamic - for tracing this.  I was not able to find a feature request specifically referring to this but it is mentioned by some bugs.  In one of these - Bug#35611 - it is said (on March 13, 2012) that relay_log_space_limit should be made dynamic, but this comment seems to have been somehow forgotten (this bug from 2008 is still open...).  In another one - Bug#68236 from 2013 - the following is mentioned: "that setting is not dynamic and so it loses all it's (sic) use".

The situation where I would have liked this variable to be dynamic is as follows:
  • I am keeping 1 day of binlogs on a slave in a log partition (binlog + relay logs),
  • I want to delay this slave by 24 hours with delayed replication,
  • Adding 1 day of relay logs would fill the log partition,
  • There is no use of keeping 24 hours of relay logs on that delayed slave as the master is already keeping all the needed binlogs (7 days in my case),
  • The right solution would have been to set relay_log_space_limit to a few GB,
  • But changing relay_log_space_limit would have needed to restart mysqld,
  • So I ended-up throwing more disk space at the log partition (I am not proud of this, but lucky GCP: you are selling a little more disk space now).
So please - Oracle, Percona and/or MariaDB - make relay_log_space_limit dynamic !

No comments:

Post a Comment