[MXS-2325] Disabled events are enabled on promoted slave upon failover Created: 2019-02-11  Updated: 2020-08-25  Resolved: 2019-03-05

Status: Closed
Project: MariaDB MaxScale
Component/s: failover, mariadbmon
Affects Version/s: 2.3.3
Fix Version/s: 2.3.5

Type: Bug Priority: Major
Reporter: Kyle Joiner (Inactive) Assignee: Esa Korhonen
Resolution: Fixed Votes: 0
Labels: None

Sprint: MXS-SPRINT-76, MXS-SPRINT-77

 Description   

Upon a master failure, all enabled and disabled events on the promoted slave will be enabled.

Per the manual:
https://mariadb.com/kb/en/mariadb-maxscale-23-mariadb-monitor/#handle_server_events

On Master:

MariaDB [(none)]> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
MariaDB [test]> show events;
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+---------+------------+----------------------+----------------------+--------------------+
| Db   | Name       | Definer        | Time zone | Type     | Execute at          | Interval value | Interval field | Starts | Ends | Status  | Originator | character_set_client | collation_connection | Database Collation |
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+---------+------------+----------------------+----------------------+--------------------+
| test | test_event | root@localhost | SYSTEM    | ONE TIME | 2019-02-11 16:28:47 | NULL           | NULL           | NULL   | NULL | ENABLED |          1 | latin1               | latin1_swedish_ci    | latin1_swedish_ci  |
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+---------+------------+----------------------+----------------------+--------------------+
1 row in set (0.001 sec)

****************************************
Disable event on master
****************************************

MariaDB [test]> alter event test_event disabled;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'disabled' at line 1
MariaDB [test]> alter event test_event disable;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [test]> show events;
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+----------+------------+----------------------+----------------------+--------------------+
| Db   | Name       | Definer        | Time zone | Type     | Execute at          | Interval value | Interval field | Starts | Ends | Status   | Originator | character_set_client | collation_connection | Database Collation |
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+----------+------------+----------------------+----------------------+--------------------+
| test | test_event | root@localhost | SYSTEM    | ONE TIME | 2019-02-11 16:28:47 | NULL           | NULL           | NULL   | NULL | DISABLED |          1 | latin1               | latin1_swedish_ci    | latin1_swedish_ci  |
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+----------+------------+----------------------+----------------------+--------------------+
1 row in set (0.001 sec)
 
MariaDB [test]> exit;
Bye

******************************************************
On the slave the state stays the same
******************************************************

[root@24f0e1ed4599 ~]# mysql -u root -P33062
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.3.11-MariaDB-log MariaDB Server
 
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
MariaDB [(none)]> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
MariaDB [test]> show events;
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+--------------------+------------+----------------------+----------------------+--------------------+
| Db   | Name       | Definer        | Time zone | Type     | Execute at          | Interval value | Interval field | Starts | Ends | Status             | Originator | character_set_client | collation_connection | Database Collation |
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+--------------------+------------+----------------------+----------------------+--------------------+
| test | test_event | root@localhost | SYSTEM    | ONE TIME | 2019-02-11 16:28:47 | NULL           | NULL           | NULL   | NULL | SLAVESIDE_DISABLED |          1 | latin1               | latin1_swedish_ci    | latin1_swedish_ci  |
+------+------------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+--------------------+------------+----------------------+----------------------+--------------------+
1 row in set (0.001 sec)

************************************************************
Upon failover this event would be enable which could cause problems.
************************************************************



 Comments   
Comment by Esa Korhonen [ 2019-03-05 ]

The monitor now keeps a list of enabled events of every server. When doing failover/switchover, only the events that were enabled on the old master are set to enabled on the new master.

Generated at Thu Feb 08 04:13:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.