Bug #19718 Instance Manager: FLUSH INSTANCES starts stopped guarded instances
Submitted: 11 May 2006 10:42 Modified: 5 Oct 2007 15:15
Reporter: Andrejs Dubovskis Email Updates:
Status: Unsupported Impact on me:
None 
Category:Instance Manager Severity:S3 (Non-critical)
Version:5.0.21 OS:Any
Assigned to: CPU Architecture:Any
Tags: rt_q1_2007

[11 May 2006 10:42] Andrejs Dubovskis
Description:
In IM documentation I found, that "flush instances" in instance manager does not restart servers. But see below:

mysql> show instances;        
+---------------+---------+
| instance_name | status  |
+---------------+---------+
| mysqld1       | offline | 
+---------------+---------+
1 row in set (0.00 sec)

mysql> flush instances;                   
Query OK, 0 rows affected (0.03 sec)

mysql> show instances; 
+---------------+--------+
| instance_name | status |
+---------------+--------+
| mysqld1       | online | 
+---------------+--------+
1 row in set (0.00 sec)

How to repeat:
Connect to instance manager.

stop instance mysqld1;
show instances;
flush instances;
show instances;
[11 May 2006 11:14] Valeriy Kravchuk
Thank you for a problem report. What is in the error log for the instance you restarted (for the period of flush instances command)? I want to check is it a real restart or simply incorrect state was shown by IM.
[11 May 2006 11:38] Valeriy Kravchuk
Is your instance (mysqld1) guarded?
[11 May 2006 12:32] Andrejs Dubovskis
Yes, mysqld1 is guarded.

I found, that 'flush instances' does not start mysqld1 immediately, but after monitoring-interval (we have value 60).

See log snapshot:

060511 15:26:04 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
060511 15:27:04 [Warning] Neither --relay-log nor --relay-log-index were used; s

mysql> stop instance mysqld1;
Query OK, 0 rows affected (0.01 sec)

mysql> show instances;       
+---------------+---------+
| instance_name | status  |
+---------------+---------+
| mysqld1       | offline | 
+---------------+---------+
1 row in set (0.00 sec)

mysql> flush instances;
Query OK, 0 rows affected (0.03 sec)

mysql> show instances; 
+---------------+---------+
| instance_name | status  |
+---------------+---------+
| mysqld1       | offline | 
+---------------+---------+

mysql> show instances;
+---------------+---------+
| instance_name | status  |
+---------------+---------+
| mysqld1       | offline | 
+---------------+---------+
1 row in set (0.00 sec)

mysql> show instances;                  
+---------------+--------+
| instance_name | status |
+---------------+--------+
| mysqld1       | online | 
+---------------+--------+
1 row in set (0.03 sec)
[11 May 2006 15:23] Valeriy Kravchuk
My results were the same - hence the question. But it is not a bug. This behaviour of (guarded) instance is described in the manual (http://dev.mysql.com/doc/refman/5.0/en/instance-manager-command-options.html):

"--monitoring-interval=seconds

The interval in seconds for monitoring instances. The default value is 20 seconds. Instance Manager tries to connect to each monitored instance using the non-existing MySQL_Instance_Manager user account to check whether it is alive/not hanging. In the case of a failure to connect, IM performs several attempts to restart the instance. The nonguarded option in the appropriate instance section disables this behavior for a particular instance."
[12 May 2006 6:02] Andrejs Dubovskis
Sorry, but I do not agree. This is a bug.

If you issue command 'stop instance mysqld1' (mysqld1 is guarded instance), instance manager does not restart mysqld1 indefinitly long time.
But, if at this moment you issue command 'flush instances', mysqld1 will be started during monitoring-interval. But all I want, just reread configuration file (possibly for other instance).
[3 Mar 2007 12:39] 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/21085

ChangeSet@1.2451, 2007-03-03 15:40:29+03:00, anozdrin@booka.opbmk +19 -0
  Patch for
  BUG#19718: IM: FLUSH INSTANCES starts stopped guarded instances
  WL#3543: Deprecate FLUSH INSTANCES
  
  The patch adds support for warnings per connection to Instance Manager,
  introduces SHOW WARNINGS statement and deprecates FLUSH INSTANCES.
  
  See the WL item for details.
[5 Oct 2007 15:15] Konstantin Osipov
FLUSH INSTANCES command is deprecated in IM 5.1