Bug #44168 agent fails to detect mysqld as local if thread-id is > 2^32
Submitted: 8 Apr 2009 21:05 Modified: 20 Jul 2009 16:25
Reporter: Diego Medina Email Updates:
Status: Closed Impact on me:
Category:MySQL Enterprise Monitor: Agent Severity:S2 (Serious)
Version: OS:Any
Assigned to: Andy Bang CPU Architecture:Any

[8 Apr 2009 21:05] Diego Medina
If we monitor a super busy server, or a server that has been up for a very, very long time, the value from thread-id (taken from the protocol) is not correct and this causes the agent to think it is monitoring a "remote" server

Please see this related MySQL server bug

How to repeat:
1- Install and start the service manager and agent
2- Create 2^32 connections to the monitored mysqld (connect and disconnect)

Note: test case will come later

Suggested fix:
use SELECT connection_id() instead of the mysql->thread_id
[12 Jun 2009 18:25] Diego Medina
One way to force a high thread_id value is:

$ ps ax | grep mysqld 
$ gdb /path/to/mysqld <pid>

(gdb) print thread_id
(gdb) set thread_id = 4294967296
(gdb) cont

(this requires mysql-debug)
[12 Jun 2009 19:15] Diego Medina
This only applies to mysqld 64bit
[19 Jun 2009 3:35] Keith Russell
Patch installed in versions =>
[13 Jul 2009 16:16] Enterprise Tools JIRA Robot
Diego Medina writes: 
Verified fixed on
[20 Jul 2009 16:25] Tony Bedford
An entry has been added to the 2.1.0 changelog:

The Agent failed to correctly determine the state of the monitored server if the thread-id, extracted from the client-server protocol, is greater than 2^32. In the case with a thread-id greater than 2^32, the agent incorrectly determined that it was monitoring a remote server. High values of thread-id occur when the monitored server has many connections, or if it has been running for an extended period of time.