Bug #87736 8.0.3 log-bin startup message confusing on a slave not configured wtih binlogs
Submitted: 12 Sep 2017 10:23 Modified: 27 Sep 2017 10:03
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Logging Severity:S4 (Feature request)
Version:8.0.3 OS:Any
Assigned to: CPU Architecture:Any
Tags: 8.0, binlogs, documentation, messages

[12 Sep 2017 10:23] Simon Mudd
Description:
8.0.3 enables binlogs by default and on a slave upgraded form 5.7 without binlog configured I see the following message:

2017-09-12T09:52:46.133509Z 0 [Warning] [003786] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=hostname-bin' to avoid this problem.

However, this really does not explain what's going on and why there's a problem, nor does it make things clear what you should really do.

This is triggered as far as I can see from:
* no log_bin entry in /etc/my.cnf
* no --log-bin configured from the command line
* the fact that 8.0.3+ enables binlogs by default.

Some people may not want their servers to generate binlogs due to the extra disk space or I/O requirements, so the change may surprise them.

How to repeat:
see above.

Suggested fix:
If you detect no --log-bin option on the command line and no log-bin setting in /etc/my.cnf then I would suggest a different message:

WARNING: log-bin has not been configured explicitly and is enabled by default with the value <....>
WARNING: Check and configure log_bin, log_bin_index, expire_logs_days are set appropriately
WARNING: To disable binlog generation use <....> from the command line or <...> in my.cnf.
[12 Sep 2017 10:29] Simon Mudd
Documentation at https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#sysvar_log_bin does not seem to be up to date yet but also mixes the command line arguments and my.cnf settings a bit.

It would be good to know how to keep binlogs disabled if I want to maintain this behaviour on a server.
Upgrade documentation should also mention this change and the fact that if no configuration change is made disk space requirements of the servers due to binlogs and the default 30 day binlog expiry may need to be considered.
[12 Sep 2017 15:26] Simon Mudd
The following explicit setting in /etc/my.cnf seems to remove these warnings. So suggest this be configured if binlogs are to be disabled.
log_bin = off

Perhaps not apparent from my previous comment but binlogs may be explicitly disabled on slaves that are not expected to be promoted as a master as they are not needed.
[20 Sep 2017 5:49] MySQL Verification Team
Hello Simon,

Thank you for the feedback!

Thanks,
Umesh
[26 Sep 2017 20:40] Simon Mudd
log_bin = off does not work.

I filled up the box I configured this way as it had binlog files in $datadir named off.000001 and onwards.

So how do I disable binlogs now if I want to?  I still don't know how and I want to do this.

One clear reason: it will fill up my disk on systems not configured to expire appropraitely. The 8.0 default expiry period is 1 month which on most boxes may generate a lot of binlogs.
[27 Sep 2017 10:03] Simon Mudd
I used this not ideal workaround in the meantime:

expire_logs_days = 0
binlog_expire_logs_seconds = 1
max_relay_log_size = 100M  # adjust size to taste
sync_binlog = 0
[3 Oct 2017 14:37] Daniël van Eeden
> log_bin = off does not work.

"skip-log-bin" does work.
[3 Oct 2017 14:38] Daniël van Eeden
From https://dev.mysql.com/doc/refman/8.0/en/replication-options-binary-log.html#option_mysqld_...

"To disable binary logging, you can specify the --skip-log-bin or --disable-log-bin option at startup."