[MXS-3714] Monitor servers for existance of "mysql" system database, to detect datadir deletion Created: 2021-08-09  Updated: 2022-09-27  Resolved: 2022-09-08

Status: Closed
Project: MariaDB MaxScale
Component/s: N/A
Affects Version/s: None
Fix Version/s: N/A

Type: New Feature Priority: Major
Reporter: Hartmut Holzgraefe Assignee: Todd Stoffel (Inactive)
Resolution: Won't Do Votes: 0
Labels: None

Issue Links:
Relates

 Description   

A running MariaDB Server might not detect that its datadir contents got deleted by another process until being restarted.

By e.g. monitoring whether the "mysql" database is still visible on a server (it should always be) such a basically invalid server stage could be detected and a server in this state could be removed from replication chains or clusters.



 Comments   
Comment by markus makela [ 2021-08-09 ]

Technically, this is already implemented in the form of auth_refresh_interval: https://mariadb.com/kb/en/mariadb-maxscale-25-mariadb-maxscale-configuration-guide/#users_refresh_interval Whenever users are refreshes, the mysql database is accessed. The problem is that this is only done on the server labeled as the Master for the cluster that the service uses. This could be used as coarse detection of problems but it of course won't cover everything.

One way to deal with this would be to allow the user to define some SQL statements that are executed in addition to the normal monitoring checks, possibly in a file similar to how promotion_sql_file uses them. This would allow for some versatility that is defined by the end user.

Comment by Hartmut Holzgraefe [ 2022-07-14 ]

I didn't really make myself clear, this was about the datadir being deleted while the mariadb server is still running. This may go undetected as long as the server still has the table files open via the table cache, so e.g. refreshing the user auth data may still work out, at least as long as there's no prior FLUSH TABLES

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