Bug #41570 master_uuid discovery broken with master_host='localhost'
Submitted: 17 Dec 2008 23:17 Modified: 9 Jan 2015 10:06
Reporter: Darren Oldag Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Agent Severity:S3 (Non-critical)
Version:2.0 OS:Any
Assigned to: Jan Kneschke CPU Architecture:Any

[17 Dec 2008 23:17] Darren Oldag
Description:
I have a 5.1 slave pointing to a 5.0 master.  master_host='localhost' and master_port=36001.  the 5.1 is running on 3306.

master_uuid is being returned as the uuid for the 5.1 mysqld.  i'm pretty sure this is because the agent is using libmysql to connect to the master as specified by master.info, and 'localhost' will let it connect to the unix domain socket instead of connecting to the real master via tcp localhost:36001, as replication really would.

How to repeat:
see description

Suggested fix:
do not use libmysql 'feature' that connects to the unix domain socket by default for 'localhost' if we are trying to emulate the replication slave connecting to his master to fetch the master uuid.
[18 Dec 2008 20:27] Gary Whizin
Fix with other master_uuid bugs. Leith thinks: just transform localhost --> 127.0.0.1 and it will probably be fine...
[18 Dec 2008 22:56] Darren Oldag
changing to 127.0.0.1 for master_host fixed it for me, yes.
[16 Mar 2009 14:45] Kay Roepke
As a note to the bugfixer: We automagically convert the "localhost" entry in the agent-instance.ini to 127.0.0.1 to avoid using domain sockets.

Needs investigation.
[2 Aug 2010 15:30] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
Fixed it in trunk (aka 2.3)

{noformat}
revno: 1915
fixes bug(s): http://bugs.mysql.com/41570
committer: jan@mysql.com
branch nick: trunk
timestamp: Mon 2010-08-02 17:27:55 +0200
message:
  rewrite 'localhost' to '127.0.0.1' if we want to connect to the master as slave
  as replication only uses TCP (fixes #41570/EM-297)
modified:
  src/job_collect_mysql.c
{noformat}
[6 Aug 2010 14:41] Enterprise Tools JIRA Robot
Jan Kneschke writes: 
... and pushed to 2.2:

{noformat}
revno: 1903
fixes bug(s): http://bugs.mysql.com/41750
committer: jan@mysql.com
branch nick: rel-2.2
timestamp: Fri 2010-08-06 16:28:30 +0200
message:
  rewrite 'localhost' to '127.0.0.1' if we want to connect to the master as slave
  as replication only uses TCP (fixes #41570/EM-297)
{noformat}