Bug #28797 CHANGE MASTER TO MASTER_HOST="localhost" is not using unix-domain-sockets
Submitted: 31 May 2007 8:09 Modified: 14 Sep 2007 9:08
Reporter: Jan Kneschke Email Updates:
Status: Closed
Category:Server: Docs Severity:S3 (Non-critical)
Version:5.1.17, 5.0, 4.1 OS:Any
Assigned to: MC Brown Target Version:
Triage: D4 (Minor)

[31 May 2007 8:09] Jan Kneschke
Description:
Quoting http://dev.mysql.com/doc/refman/5.0/en/change-master-to.html:

MASTER_HOST and MASTER_PORT are the hostname (or IP address) of the master host and its
TCP/IP port. Note that if MASTER_HOST is equal to localhost, then, like in other parts of
MySQL, the port number might be ignored (if Unix socket files can be used, for example).

This is not the case.

How to repeat:
slave> CHANGE MASTER TO MASTER_HOST="localhost", MASTER_PORT=3306, MASTER_USER="repl",
MASTER_PASSWORD="secret", MASTER_LOG_FILE="hostname-bin.000011",
Master_Log_Pos=389524268;

070531 10:01:46 [Note] Slave I/O thread: connected to master
'repl@localhost:3306',replication started in log 'hostname-bin.000011' at position
389524268

master> SHOW PROCESSLIST;
| Id     | User | Host            | db    | Command     | Time |
| 379714 | repl | localhost:24649 | NULL  | Binlog Dump |  213 |

shell> lsof -Pnp 24946
...
mysqld  24946  jan   32r  IPv4           49591589               TCP
127.0.0.1:24649->127.0.0.1:3306 (ESTABLISHED)

Suggested fix:
Either fix the documentation, or allow to use unix-domain-sockets with
MASTER_HOST="localhost".

I would prefer to fix the documentation, but a MASTER_SOCKET option for CHANGE MASTER TO
is fine too. It is non-obvious which socket would be used if MASTER_HOST="localhost"
would really use a socket.
[31 May 2007 10:12] Sveta Smirnova
Thank you for the report.

Verified as described.

Left as server bug to let replication devs to decide what to fix.
[14 Sep 2007 9:08] MC Brown
A note has been added to the manual that you cannot use Unix socket files with
replication.