Bug #36550 multiple instances of mysqld on same port.
Submitted: 6 May 2008 23:16 Modified: 13 May 2008 16:32
Reporter: Phil Hussey Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.51a OS:Windows (XP professional SP2)
Assigned to: CPU Architecture:Any
Tags: multiple instances, mysqld

[6 May 2008 23:16] Phil Hussey
Description:
The latest version of mysqld (5.0.51a)allows multiple versions to be run against the same port whereas prior versions would terminate if another instance was already running against the same port.

Besides consuming memory, this could also cause problems with multiple instances of mysqld accessing the same resources.

How to repeat:
On windows xp professional version 2002, SP2

Using mysqld using version 5.0.51a

1. Open a command window and issue the following command multiple times:

   start mysqld -b .. --standalone --innodb 

2. ctrl+alt+del to bring up task manager
   see multiple mysqld instances.

Suggested fix:
Modify mysqld version 5.0.51a to detect if the listening port is already being used, and if so simply terminate.

This is already being done in prior versions including version 5.0.27
[7 May 2008 0:10] MySQL Verification Team
Thank you for the bug report. Could you please provide the err log messages of the
second instance which you are trying to start. Thanks in advance.
[7 May 2008 17:26] Phil Hussey
Error log for version 5.0.27 - This is error that one would expect to see.

Attachment: ver5.0.51a.mysqlq.err (application/octet-stream, text), 492 bytes.

[7 May 2008 17:27] Phil Hussey
This is the error file with the new version 5.0.51a - it doesn't shut down.

Attachment: ver5.0.51a.mysqlq.err (application/octet-stream, text), 492 bytes.

[7 May 2008 17:28] Phil Hussey
Hi Miquel,

Attached are the two msql error logs - One for the old version (5.0.27) that works correctly and shuts down subsequent invocations, and one for the new version (5.0.51a) that doesn not shut down subsequent invocations.

Thanks for your help,

Phil
[8 May 2008 12:28] MySQL Verification Team
Thank you for the feedback. Have you started the server with --basedir and
--datadir (different than the first instance)?. Thanks in advance.
[8 May 2008 17:03] Phil Hussey
Hi Miguel,

No we never start with different --basedir and --datadir as we only want 1 instance of mysqld running. The startup in the batch file that executes our application and starts mysqld always issues the following command which would always use the same basedirectory and datadirectory and listening port (3306):

start mysqld -b .. --standalone --innodb 

with version 5.0.27 all subsequent invocations terminate and only leave 1 instance running (like we want) - version 5.051a leaves multiple versions running which you can see with windows task manager. I can send you a screen shot of the multiple instances if you want, just let me know.

Thanks
[9 May 2008 17:37] Phil Hussey
Hi Miguel,

Just to make sure it wasn't platform related, I downloaded the latest version of mySQL (5.0.51a) and installed it on a Windows 2003 platform that did not have any mySQL installed on it yet. Then I went to the bin directory and issued the following commands:

start mysqld-nt
start mysqld-nt
start mysqld-nt
start mysqld-nt
start mysqld-nt

I then did a ctrl+alt+del to bring up the task manager and saw all 5 instances running against the same 3306 port.

To make sure this did not happen in the previous release, I did the same test with 5.0.27 by uninstalling 5.0.51 and downloading/ installing 5.0.27  - with 5.0.27, only one instance of mysqlq-nt is created - which would be the desired behavior as only one daemon should be listening on port 3306.

Could you try the same test and see if you get the same results? If you can confirm it, then could you find out if it is a bug or possibly some new feature in 5.0.51 (like for failover or something)?

Our company has a software release this month and we would like to release it with the latest version (5.0.51) of mySQL, but if this is a bug we'll have to release it with version 5.0.27.

Thanks,

Phil
[9 May 2008 18:29] MySQL Verification Team
Hi Phil,

The actual reason to see the several process is the bug:
http://bugs.mysql.com/bug.php?id=35647.

So this bug it is the duplicate of the above bug.
[9 May 2008 19:54] Phil Hussey
Hi Miguel,

Thanks for getting back to me so quickly - we'll roll back to version 5.0.27 for our implementation then.

Thank you,

Phil
[13 May 2008 16:32] MySQL Verification Team
Duplicate of bug: http://bugs.mysql.com/bug.php?id=35647.