Bug #71123 START SLAVE creates master.info etc if the instance had never been slave
Submitted: 10 Dec 2013 8:53 Modified: 16 Nov 2017 7:48
Reporter: Valeriy Kravchuk Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.5.32, 5.6.14, 5.6.15 OS:Any
Assigned to: CPU Architecture:Any
Tags: master.info, start slave

[10 Dec 2013 8:53] Valeriy Kravchuk
Description:
It seems that START SLAVE silently creates master.info (and other related files, relay and status logs) on the system that had never been configured as slave and does not have these files. I do not see this documented on any of the following pages:

http://dev.mysql.com/doc/refman/5.5/en/start-slave.html
http://dev.mysql.com/doc/refman/5.5/en/slave-logs-status.html

Moreover, SHOW SLAVE STATUS executed later does NOT show the content of the files created. 

How to repeat:
On fresh MySQL, run the following (server_id is needed for 5.6.x):

[openxs@chief 5.6]$ bin/mysqld_safe --no-defaults --server-id=1 &
[1] 2593
[openxs@chief 5.6]$ 131210 10:50:03 mysqld_safe Logging to '/home/openxs/dbs/5.6/data/chief.err'.
131210 10:50:03 mysqld_safe Starting mysqld daemon with databases from /home/openxs/dbs/5.6/data

[openxs@chief 5.6]$ ls data
auto.cnf   chief.pid  ib_logfile0  mysql               test
chief.err  ibdata1    ib_logfile1  performance_schema
[openxs@chief 5.6]$ bin/mysql --no-defaults -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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> start slave;
ERROR 1200 (HY000): The server is not configured as slave; fix in config file or with CHANGE MASTER TO
mysql> show slave status\G
Empty set (0.00 sec)

mysql> exit
Bye
[openxs@chief 5.6]$ ls -l data
total 176196
-rw-rw---- 1 openxs openxs       56 Oct  8 10:19 auto.cnf
-rw-r----- 1 openxs openxs    25931 Dec 10 10:50 chief.err
-rw-rw---- 1 openxs openxs        5 Dec 10 10:50 chief.pid
-rw-rw---- 1 openxs openxs      120 Dec 10 10:50 chief-relay-bin.000001
-rw-rw---- 1 openxs openxs       25 Dec 10 10:50 chief-relay-bin.index
-rw-rw---- 1 openxs openxs 79691776 Dec 10 10:50 ibdata1
-rw-rw---- 1 openxs openxs 50331648 Dec 10 10:50 ib_logfile0
-rw-rw---- 1 openxs openxs 50331648 Oct  8 10:18 ib_logfile1
-rw-rw---- 1 openxs openxs       49 Dec 10 10:50 master.info
drwx------ 2 openxs openxs     4096 Oct  8 10:18 mysql
drwx------ 2 openxs openxs     4096 Oct  8 10:18 performance_schema
-rw-rw---- 1 openxs openxs       38 Dec 10 10:50 relay-log.info
drwx------ 2 openxs openxs     4096 Oct 16 11:03 test

Suggested fix:
Document this properly if it's intended behavior? 

Otherwise, do not create files if they do not exist yet, or make SHOW SLAVE STATUS report the content created.
[10 Dec 2013 9:39] MySQL Verification Team
Hello Valeriy,

Thank you for the report.
Verified as described.

Thanks,
Umesh
[16 Nov 2017 7:48] Erlend Dahl
[19 Sep 2017 15:43] Luis Soares

The usage of the files master.info and relay-log.info have been deprecated in
favor of system tables. Closing as won't fix.