[MDEV-10507] MariaDB 10.1 + wsrep fails to start under systemd post-reboot Created: 2016-08-07  Updated: 2016-08-25  Resolved: 2016-08-25

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.1.16
Fix Version/s: 10.1.17

Type: Bug Priority: Blocker
Reporter: Andrew Garner Assignee: Nirbhay Choubey (Inactive)
Resolution: Fixed Votes: 3
Labels: None
Environment:

Debian 8



 Description   

After a reboot attempting to start a Galera enabled MariaDB 10.1 fails with an error along these lines:

WSREP: Failed to start mysqld for wsrep recovery: '2016-08-07  2:25:35 140036048377792 [Note] /usr/sbin/mysqld (mysqld 10.1.16-MariaDB-1~jessie) starting as process 5902 ...
...
2016-08-07  2:25:35 140036048377792 [Note] Server socket created on IP: '0.0.0.0'.
2016-08-07  2:25:35 140036048377792 [ERROR] Can't start server : Bind on unix socket: No such file or directory
2016-08-07  2:25:35 140036048377792 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
2016-08-07  2:25:35 140036048377792 [ERROR] Aborting'

This is caused by a missing /var/run/mysqld/ directory under the /var/run tmpfs. The mariadb.service file includes a ExecStartPre directive to recreate this directory but this action is currently specified after the galera_recovery related directive:

...
ExecStartPre=/bin/sh -c "systemctl unset-environment _WSREP_START_POSITION"
ExecStartPre=/bin/sh -c "VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && \
 systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1"
...
ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld
ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION

Moving the /var/run/mysqld ExecStartPre directive to before the galera_recovery line resolves this and startup works as expected.



 Comments   
Comment by Maciej Radzikowski [ 2016-08-08 ]

I can confirm, we also encountered this issue and editing /lib/systemd/system/mariadb.service fixes the problem.

Comment by Joachim de Groot [ 2016-08-19 ]

Is it possible to rebuild the package for Debian with a fix for this issue?

This way it is not usable, and older packages are not available from the repo, so a downgrade is no option either.
Unfortunately this means that 10.1 is currently not usable on Debian.

Comment by Nirbhay Choubey (Inactive) [ 2016-08-22 ]

http://lists.askmonty.org/pipermail/commits/2016-August/009683.html

Comment by Jon Purdy [ 2016-08-23 ]

Confirmed that the suggested fix works running 10.1.16-MariaDB-1~jessie.

Generated at Thu Feb 08 07:42:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.