Bug #96353 log_bin uses report_host for binary log filename
Submitted: 27 Jul 2019 9:35 Modified: 30 Jul 2019 7:19
Reporter: Kedar Vaijanapurkar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7.25 (should be all) OS:Any (NA)
Assigned to: CPU Architecture:Any
Tags: binary log, filename, log_bin, MySQL, report_host

[27 Jul 2019 9:35] Kedar Vaijanapurkar
Description:
When log bin is not specified, mysql uses report_host value for binary log naming. This is not specified in the documentation.

ref: 
https://dev.mysql.com/doc/refman/8.0/en/replication-options-slave.html#option_mysqld_repor...
https://dev.mysql.com/doc/refman/5.7/en/replication-options-binary-log.html#option_mysqld_...

How to repeat:
Enable binlog without specifying filename and specify report_host other than hostname.

Suggested fix:
Update documentation to state this.
[30 Jul 2019 7:19] MySQL Verification Team
Hi Kedar,

Thank you for the report.
I tried to reproduce this issue at my end and even checked internally with repl dev and confirmed that there is no reference to report_host while setting binlog name.

- Checked against 5.7.27 build(same for 5.7.25)
- With log-bin not set, report_host set to xyz host
rm -rf 96353
bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/96353 --log-error-verbosity=3
bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/96353 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/96353/log.err --log-error-verbosity=3 --secure-file-priv="" --log-bin --server-id=5727 --report-host=VALID_HOST_NAME 2>&1 &

bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27-log MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like 'report%';
+-----------------+--------+
| Variable_name   | Value  |
+-----------------+--------+
| report_host     | VALID_HOST_NAME |
| report_password |        |
| report_port     | 3333   |
| report_user     |        |
+-----------------+--------+
4 rows in set (0.00 sec)

mysql> show binary logs;
+------------------+-----------+
| Log_name         | File_size |
+------------------+-----------+
| hod03-bin.000001 |       154 |
+------------------+-----------+
1 row in set (0.00 sec)

mysql> system hostname
hod03
mysql>mysql> system cat docs/INFO_SRC
commit: 8ccfc51ab8d361be94168fe04b6818d0b234c9c0
date: 2019-06-10 20:06:14 +0530
build-date: 2019-06-10 16:43:41 +0200
short: 8ccfc51
branch: mysql-5.7.27-release

MySQL source 5.7.27

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.  

Thank you for your interest in MySQL.

regards,
Umesh