Bug #22306 STOP INSTANCE can not be applied for instances in Crashed, Failed and Abandoned
Submitted: 13 Sep 2006 12:48 Modified: 16 Jan 2007 20:51
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:Instance Manager Severity:S3 (Non-critical)
Version:5.1 OS:
Assigned to: Alexander Nozdrin CPU Architecture:Any

[13 Sep 2006 12:48] Alexander Nozdrin
Description:
STOP INSTANCE should be able to stop
mysqld-instances in Crashed, Failed and Abandoned states,
but it is not.

How to repeat:
1. Configure mysqld-instance, that can't be started (for example,
specify TCP port that is already in use).

2. Start such instance by IM;

3. Check its state by "SHOW INSTANCES";

4. Issue "STOP INSTANCE <instance name>". It will be failed with
the following error:
ERROR 3001 (HY000): Cannot stop instance. Perhaps the instance is not started, or was started manually, so IM cannot find the pidfile.
[16 Nov 2006 20: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/15455

ChangeSet@1.2362, 2006-11-16 23:03:58+03:00, kostja@bodhi.local +21 -0
  Cleanup: manually port the polishing parts from Alik's changeset for
  BUG#22306: STOP INSTANCE can not be applied for instances in Crashed,
  Failed and Abandoned
[17 Nov 2006 13: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/15489

ChangeSet@1.2366, 2006-11-17 16:11:04+03:00, kostja@bodhi.local +13 -0
  Replace the approach using Foo_thread_args + Foo_thread and manually
  spawned threads with a reusable class Thread.
  
  This is the second idea implemented in the Alik's patch for
  BUG#22306: STOP INSTANCE can not be applied for instances in Crashed,
  Failed and Abandoned.
  Commiting separately to ease review process.
[17 Nov 2006 22:35] 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/15529

ChangeSet@1.2370, 2006-11-18 01:34:44+03:00, kostja@bodhi.local +22 -0
  Port cleanups, trivial refactoring and code rearrangements from
  Alik's patch for BUG#22306: STOP INSTANCE can not be applied for 
  instances in Crashed, Failed and Abandoned" to ease review process.
  Evaluate global variable linuxthreads before starting threads to avoid
  a race.
[29 Nov 2006 16:45] Konstantin Osipov
Approved the second patch by email.
[30 Nov 2006 9:24] 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/16188

ChangeSet@1.2389, 2006-11-30 12:23:55+03:00, anozdrin@booka. +12 -0
  Fix for the following bugs:
    - BUG#22306: STOP INSTANCE can not be applied for instances in Crashed,
      Failed and Abandoned;
    - BUG#23476: DROP INSTANCE does not work
    - BUG#23215: STOP INSTANCE takes too much time
  
  BUG#22306:
  The problem was that STOP INSTANCE checked that mysqld is up and running.
  If it was not so, STOP INSTANCE reported an error. Now, STOP INSTANCE
  reports an error if the instance has been started (mysqld can be down).
  
  BUG#23476:
  The problem was that DROP INSTANCE tried to stop inactive instance. The fix is
  trivial.
  
  BUG#23215:
  The problem was that locks were not acquired properly, so the
  instance-monitoring thread could not acquire the mutex, holded by the
  query-processing thread.
  
  The fix is to simplify locking scheme by moving instance-related information to
  Instance-class out of Guardian-class. This allows to get rid of storing a
  separate list of Instance-information in Guardian and keeping it synchronized
  with the original list in Instance_map.
[16 Jan 2007 20:51] Paul Dubois
Noted in 5.1.15 changelog.

The Instance Manager STOP INSTANCE command could not be applied to
instances in the Crashed, Failed, or Abandoned state.