[MDEV-21292] MariaDB fails with timeout on boot Created: 2019-12-11 Updated: 2020-05-05 Resolved: 2020-05-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.3.17 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Matthias S | Assignee: | Axel Schwenke |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | need_feedback | ||
| Environment: |
Raspian Buster (10) on Raspberry Pi |
||
| Description |
|
I moved my data directory to another location. It works if this is on the same disk, just at a different location (i.e., moved /var/lib/mysql/ and edited the datadir entry in the server.cnf). However, when the data directory is on a mounted drive it does not work well. It generally works, but when the system boots, MariaDB times out. I changed the systemd service for mariadb to ensure that mounting took place: I added RequiresMountsFor=/mnt/foo. I can see by the timestamps that the service is started as soon as the disk is mounted. Starting MariaDB works occasionally, but most times mariadb times out:
Starting it manually after works fine. |
| Comments |
| Comment by Axel Schwenke [ 2019-12-13 ] | ||||||||||||||||||||||
|
Hello mattsch, if MariaDB comes up occasionally, this might simply be a case where the startup time is near the default timeout of 90 seconds. Sometimes it's faster and works, sometimes it's slower and fails. Then it would be enough to increase the timeout. This is described in this Knowledge Base article. On the other hand this might be a more serious problem. Do you happen to know how long MariaDB takes to start when it works? Please also check the MariaDB error log for anything unusual. | ||||||||||||||||||||||
| Comment by Matthias S [ 2019-12-14 ] | ||||||||||||||||||||||
|
Hello axel, it takes around 2 seconds to start MariaDB. It's a fresh installation. Setting the start timeout to infinite indeed helps in the sense that it eventually starts. However, it takes around 3 minutes. Here's the part of the error log:
In the case that it works (datadir in /var/lib/mysql) I see the same in the error log just without the long pause in between. | ||||||||||||||||||||||
| Comment by Matthias S [ 2019-12-29 ] | ||||||||||||||||||||||
|
Through a coincidence I found out that this is caused by the disk taking forever to read from after mounting. It is caused by an "UAS incompatibility" of the SATA-to-USB interface and the Raspberry Pi 4. Once I enabled the quirks mode for this drive MariaDB started without a problem after booting. Please close this issue. |