Description:
When updating the global variables the previous item is not adjusted, so they both may say 'all'.
select @@version, @@innodb_monitor_enable, @@innodb_monitor_disable;
+------------+-------------------------+--------------------------+
| @@version | @@innodb_monitor_enable | @@innodb_monitor_disable |
+------------+-------------------------+--------------------------+
| 5.6.28-log | all | all |
+------------+-------------------------+--------------------------+
Without going to the status field of the INFORMATION_SCHEMA.INNODB_METRICS table there is no way to know which variable is correct. Whichever was updated last will take precedence.
How to repeat:
db2 (none)> set global innodb_monitor_disable='all';
Query OK, 0 rows affected (0.00 sec)
db2 (none)>set global innodb_monitor_enable='all';
Query OK, 0 rows affected (0.00 sec)
db2 (none)>select @@innodb_monitor_enable, @@innodb_monitor_disable;
+-------------------------+--------------------------+
| @@innodb_monitor_enable | @@innodb_monitor_disable |
+-------------------------+--------------------------+
| all | all |
+-------------------------+--------------------------+
1 row in set (0.00 sec)
db2 (none)>select distinct status from INFORMATION_SCHEMA.INNODB_METRICS;
+---------+
| status |
+---------+
| enabled |
+---------+
1 row in set (0.01 sec)
db2 (none)> set global innodb_monitor_disable='all';
Query OK, 0 rows affected (0.00 sec)
db2 (none)>select @@innodb_monitor_enable, @@innodb_monitor_disable;
+-------------------------+--------------------------+
| @@innodb_monitor_enable | @@innodb_monitor_disable |
+-------------------------+--------------------------+
| all | all |
+-------------------------+--------------------------+
1 row in set (0.00 sec)
db2 (none)>select distinct status from INFORMATION_SCHEMA.INNODB_METRICS;
+---------+
| status |
+---------+
| disabled |
+---------+
1 row in set (0.01 sec)
Suggested fix:
When updating one of the variables to all, if the same thing is in the other variable then set it to NULL