MariaDB / mariadb-docker

Docker Official Image packaging for MariaDB
https://mariadb.org
GNU General Public License v2.0
759 stars 438 forks source link

Temp server start timeout #485

Closed eastyu closed 10 months ago

eastyu commented 1 year ago

When I upgrade or deploy an instance, the entrypoint.sh will start a temp server. But it will be timeout in 30 seconds which is hard coded. For some unknown reasons, in my lab, it doesn't startup in 30 seconds and failed to upgrade. I think this value should be parameterized.

grooverdan commented 1 year ago

Can you include the log to see how far the server startup occurred or if there's a connection problem of some sort?

eastyu commented 1 year ago

I start it from k8s:

2023-01-28 12:53:42+00:00 [Note] [Entrypoint]: Database files initialized
2023-01-28 12:53:42+00:00 [Note] [Entrypoint]: Starting temporary server
2023-01-28 12:53:42+00:00 [Note] [Entrypoint]: Waiting for server startup
2023-01-28 12:53:42 0 [Note] mariadbd (server 10.10.2-MariaDB-1:10.10.2+maria~ubu2204) starting as process 72 ...
2023-01-28 12:53:42 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-01-28 12:53:42 0 [Note] InnoDB: Number of transaction pools: 1
2023-01-28 12:53:42 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2023-01-28 12:53:42 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-01-28 12:53:42 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2023-01-28 12:53:42 0 [Note] InnoDB: Completed initialization of buffer pool
2023-01-28 12:53:42 0 [Note] InnoDB: Buffered log writes (block size=512 bytes)
2023-01-28 12:53:42 0 [Note] InnoDB: 128 rollback segments are active.
2023-01-28 12:53:42 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2023-01-28 12:54:12 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2023-01-28 12:54:12 0 [Note] InnoDB: log sequence number 46472; transaction id 14
2023-01-28 12:54:12 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-01-28 12:54:12 0 [Warning] 'user' entry 'root@mariadb-master-0' ignored in --skip-name-resolve mode.
2023-01-28 12:54:12 0 [Warning] 'proxies_priv' entry '@% root@mariadb-master-0' ignored in --skip-name-resolve mode.
2023-01-28 12:54:13 0 [Note] mariadbd: ready for connections.
Version: '10.10.2-MariaDB-1:10.10.2+maria~ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 0  mariadb.org binary distribution
2023-01-28 12:54:13+00:00 [ERROR] [Entrypoint]: Unable to start server.
grooverdan commented 1 year ago

30 seconds to write a 12MiB file doesn't bode particularly well for a DB.

There's some work arounds (particularly innodb_temp_data_file_path=/tmp/ibtmp1:12M:autoextend)/discussion in #420. What is your storage protocol and mount options?

eastyu commented 1 year ago

I mount a NFS volume on /var/lib/mysql to store the data. The version is 4.1 and the only customized mount options is -rw. The interesting thing is that it's not always fail, sometimes it can be done in time.

grooverdan commented 1 year ago

Your log shows exactly 30 seconds to complete, in fact it just completed starting but the timer timed out still in that last second. So its not surprising that sometimes succeeds/sometimes fails. Do try the innodb_temp_data_file_path option.

grooverdan commented 1 year ago

Did it help?

eastyu commented 1 year ago

Did it help?

yes, it helped. I pointed it to an empty dir PV and it did help. is there any chance to make that 30 seconds configurable in the future?

grooverdan commented 1 year ago

Did it help?

yes, it helped. I pointed it to an empty dir PV and it did help.

Exceptionally glad to hear it.

is there any chance to make that 30 seconds configurable in the future?

On #420 I could bump it to 60. I'd rather not overpopulate the container with configuration parameters that ultimately shouldn't be needed. I'll try to solve this in the server, or as a last preference, the container itself.