Bug #18023 IM: instance can be started several times; monitor interval must be > 2sec
Submitted: 7 Mar 2006 12:22 Modified: 21 Jun 2006 10:26
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:Instance Manager Severity:S1 (Critical)
Version:5.0.19 + earlier 5.0 OS:sol10-amd64-a, OpenBSD + others
Assigned to: Alexander Nozdrin CPU Architecture:Any

[7 Mar 2006 12:22] Joerg Bruehe
Description:
Release build of 5.0.19.

The following bug has also occurred previously (back to 5.0.15), but always escaped reporting. It also occurred on other platforms, currently it is just on OpenBSD.

-------------------------------------------------------
*** r/im_life_cycle.result
--- r/im_life_cycle.reject
***************
*** 12,24
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
! mysqld2       online
  SHOW INSTANCE STATUS mysqld1;
  instance_name status  version
  mysqld1       online  VERSION
  SHOW INSTANCE STATUS mysqld2;
  instance_name status  version
! mysqld2       online  VERSION
  SHOW VARIABLES LIKE 'port';
  Variable_name Value
  port  IM_MYSQLD1_PORT
--- 12,24
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
! mysqld2       offline
  SHOW INSTANCE STATUS mysqld1;
  instance_name status  version
  mysqld1       online  VERSION
  SHOW INSTANCE STATUS mysqld2;
  instance_name status  version
! mysqld2       offline VERSION
  SHOW VARIABLES LIKE 'port';
  Variable_name Value
  port  IM_MYSQLD1_PORT
***************
*** 43,51
  instance_name status
  mysqld1       online
  mysqld2       offline
! Killing the process...
! Sleeping...
! Success: the process was restarted.
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
--- 43,49
  instance_name status
  mysqld1       online
  mysqld2       offline
! Error: invalid PID path (/home/mysqldev/granny/test/mysql-standard-5.0.19-openbsd3.9-i386/mysql-test/var/run/mysqld_1.pid
) or PID file does not exist.
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
***************
*** 54,63
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
! mysqld2       online
! Killing the process...
! Sleeping...
! Success: the process was killed.
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
--- 52,59
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
! mysqld2       offline
! Error: invalid PID path (/home/mysqldev/granny/test/mysql-standard-5.0.19-openbsd3.9-i386/mysql-test/var/run/mysqld_2.pid) or PID file does not exist.
  SHOW INSTANCES;
  instance_name status
  mysqld1       online
-------------------------------------------------------

The above was in
granny-5.0-standard.log   normal

Starting from the second set of differences, things may vary:
***************
*** 45,66
  mysqld2       offline
  Killing the process...
  Sleeping...
! Success: the process was restarted.
  SHOW INSTANCES;
  instance_name status
! mysqld1       online
  mysqld2       offline
  START INSTANCE mysqld2;
  SHOW INSTANCES;
  instance_name status
! mysqld1       online
! mysqld2       online
! Killing the process...
! Sleeping...
! Success: the process was killed.
  SHOW INSTANCES;
  instance_name status
! mysqld1       online
  mysqld2       offline
  SHOW INSTANCE STATUS;
  ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
--- 45,64
  mysqld2       offline
  Killing the process...
  Sleeping...
! Error: the process was not restarted.
  SHOW INSTANCES;
  instance_name status
! mysqld1       offline
  mysqld2       offline
  START INSTANCE mysqld2;
  SHOW INSTANCES;
  instance_name status
! mysqld1       offline
! mysqld2       offline
! Error: invalid PID path (/home/mysqldev/granny/test/mysql-pro-5.0.19-openbsd3.9-i386/mysql-test/var/run/mysqld_2.pid) or PID file does not exist.
  SHOW INSTANCES;
  instance_name status
! mysqld1       offline
  mysqld2       offline
  SHOW INSTANCE STATUS;
  ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
-------------------------------------------------------

This is from
granny-5.0-pro.log   normal

As there are no platform or compiler option differences between "standard" and "pro", it seems there are race conditions or other varying effects.

How to repeat:
Detected by the test suite.
[6 May 2006 10:41] Alexander Nozdrin
It seems the cause of the bug is the same as for BUG#14106.
[22 May 2006 12:32] Alexander Nozdrin
This bug is expected to be fixed by a patch for BUG#14106.
Please, re-verify it again.
[24 May 2006 13:21] Alexander Nozdrin
This bug now has the following symptoms:

-------------------------------------------------------
*** r/im_life_cycle.result      Tue May 23 11:58:24 2006
--- r/im_life_cycle.reject      Wed May 24 16:18:07 2006
***************
*** 57,63 ****
  mysqld2       offline
  Killing the process...
  Sleeping...
! Success: the process was restarted.

  --------------------------------------------------------------------
  -- 1.1.7.
--- 57,63 ----
  mysqld2       offline
  Killing the process...
  Sleeping...
! Error: the process was killed.

  --------------------------------------------------------------------
  -- 1.1.7.
-------------------------------------------------------
[29 May 2006 11:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/6958
[29 May 2006 11:23] Alexander Nozdrin
The following bugs have been marked as duplicates of this bug:
  - BUG#17584: Problems with server PID file
  - BUG#17586: Restarting the server fails on SCO
  - BUG#18018: PID file problem -> wrong use of "kill"
[29 May 2006 13:29] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/6974
[30 May 2006 14:14] Alexander Nozdrin
Pushed into 5.0 tree, currently tagged 5.0.23.
[2 Jun 2006 14:56] Konstantin Osipov
Merged into 5.1.12
[5 Jun 2006 21:33] Mike Hillyer
Documented in changelog:

<listitem>
        <para>
          Race conditions on certain platforms could cause the Instance
          Manager to try to restart the same instance multiple times.
          (Bug #18023)
        </para>
      </listitem>
[6 Jun 2006 11:11] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/7318
[19 Jun 2006 10:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/7833
[21 Jun 2006 4:30] Paul DuBois
Additional changes are for test suite only.
No changelog entry needed.
[18 Aug 2006 13:41] Alexander Nozdrin
The patch in the main 5.0 tree, currently tagged 5.0.25.
[13 May 2008 6:23] Roopa Prabhu
What is an instance in Mysql?
Please explain.