Score:0

Mariadb creates a subprocess after crash

om flag
Ror

We recently had a crash on our Mariadb server (10.6.5) on a Debian 9 VM. The process was restarted without error but now there's a second mariadb process like so :

mysql    26718  5.1 42.4 15062644 12788308 ?   Ssl  Apr13  61:53 /usr/sbin/mariadbd
mysql    26777  1.9 11.5 15152500 3488712 ?    S    Apr13  22:38 /usr/sbin/mariadbd

which seems to be a subprocess of the first one.

We can't stop those two processes with

systemctl stop mariadb

The command hangs indefinitely. The only way to get rid of them is to kill -9 both processes. If we restart the mariadb process, the second process will eventually start with no reason. If the subprocess is killed first, it will reappear a bit later. No error is visible in the logs.

The Database is also only accessible in read, any try to write will hang forever. I'm considering dumping and reinstalling the database.

EDIT 1

Here's the log when the server crashed :

Apr 12 22:51:21 my-server mariadbd[23495]: 2023-04-12 22:51:21 0 [ERROR] [FATAL] InnoDB: Page old data size 15834 new data size 13676, page old max ins size 40 new max ins size 2198
Apr 12 22:51:21 my-server mariadbd[23495]: 230412 22:51:21 [ERROR] mysqld got signal 6 ;
Apr 12 22:51:21 my-server mariadbd[23495]: This could be because you hit a bug. It is also possible that this binary
Apr 12 22:51:21 my-server mariadbd[23495]: or one of the libraries it was linked against is corrupt, improperly built,
Apr 12 22:51:21 my-server mariadbd[23495]: or misconfigured. This error can also be caused by malfunctioning hardware.
Apr 12 22:51:21 my-server mariadbd[23495]: To report this bug, see https://mariadb.com/kb/en/reporting-bugs
Apr 12 22:51:21 my-server mariadbd[23495]: We will try our best to scrape up some info that will hopefully help
Apr 12 22:51:21 my-server mariadbd[23495]: diagnose the problem, but since we have already crashed,
Apr 12 22:51:21 my-server mariadbd[23495]: something is definitely wrong and this may fail.
ua flag
What led to the crash? (This might be a clue of what is happening now.)
Wilson Hauck avatar
jp flag
The process 27618 is involved with Ssl activities, did you recently add SSL options in your configuration?
A.B avatar
cl flag
A.B
@WilsonHauck "Ssl" means: "interruptible sleep" + "is a session leader" + "is multi-threaded". (man ps).
Wilson Hauck avatar
jp flag
@Ror If Performance_schema is ON, you may be able to find detail in Performance_Schema tables about what is being done by these two processes. General Log could be helpful if ON at STARTUP and turned OFF 30 seconds after STARTUP to avoid filling your media.
Ror avatar
om flag
Ror
I added the log of the crash. Performance Schema is off and general log didn't give use more info sadly.
Score:0
dz flag

First, its not a subprocess, its a previous version of MariaDB that was running before. Most likely its from a instance that failed to stop within the timeout.

Obviously MariaDB isn't meant to run like this. The result is two instances without awareness of each other modifying the same files which as you can see is fatal. You will need to restore from backup.

Newer versions of MariaDB (10.6.9+) lock aria_log_control and ibdata1 to prevent such corruption. Also newer versions of systemd (v242+) combined with a newer service file that included SendSIGKILL=no also prevent duplicate starting by the same service(ref).

I'm sorry you ended up in a situation without these protections.

Ror avatar
om flag
Ror
Systemctl status mariadb listed the process as a subprocess so I thought it was. I don't really understand why it is a previous instance since I killed -9 every mariadb process before restarting it (The second process appears some time after the first one, both have different PIDs than the killed processes from before). Thanks for your answer, I'll make sure to update my databases to newer version to prevent this kind of behavior.
danblack avatar
dz flag
`systemctl status` will list processes in the same cgroup. Since the first process was created in the same cgroup name its there too.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.