Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
Description
In some cases (think SST, large memory allocation) it takes longer than 30 seconds for the Database server to become available, in which case the init script will report failure. This is especially problematic on systems running systemd, since systemd will erroneously record the service as not started and might at some other time try to launch a second mysqld instance (stop/restart also won't work).
There is already an environment variable referenced when launching (MYSQLD_STARTUP_TIMEOUT) but there seems to be no way to set it. The Debian way would be to specify it in /etc/default/mysql and have something like this inside the init script:
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
This was already fixed for Redhat based distributions in MDEV-5068
I think it's fine to keep it /etc/default/mysql in keeping with the naming of the init script since at least a derivative of it is used in all Debian based distributions and an empty file with helpful comments doesn't hurt.
Only thing about your pull request, you should probably just comment out the MYSQLD_STARTUP_TIMEOUT variable since it defaults to 30 seconds anyways. My suggestion:
+# The delay in seconds the init script waits for the server to be up and running after having started "mysqld_safe" to run the "/etc/mysql/debian-start" script.
+# If the server is still not responding after the delay, the script won't be executed and an error will be thrown on the syslog.
+# Default: 30
+#MYSQLD_STARTUP_TIMEOUT=30
It may also be worth mentioned the delay to mlock large areas of memory or the delay for galera SST in the comment.
Notwithstanding, this pull request would solve the problems I had bootstraping a galera cluster with stock MariaDB.