3

I'm preparing for a major version upgrade on a fleet of MariaDB databases from 10.11 and 11.4 to 11.8. A clean shutdown is critical for data integrity in MariaDB as the new major version will refuse to start and do crash recovery if the previous shutdown before the upgrade wasn't clean.

What are the best ways to confirm a clean shutdown by checking the MariaDB logs or files in /var/log/mysql? Specifically, what log entries or patterns in the MariaDB logs indicate a clean shutdown?

Additionally, are there particular files or indicators in /var/log/mysql that reliably show the clean shutdown status? For example, if all buffers were flushed, should I expect that some files have size zero?

Otto
  • 444
  • 10

1 Answers1

1

A normal/clean shutdown I would consider the following logs:

2025-06-18 16:27:29 0 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2025-06-18 16:27:29 0 [Note] InnoDB: FTS optimize thread exiting.
2025-06-18 16:27:29 0 [Note] InnoDB: Starting shutdown...
2025-06-18 16:27:29 0 [Note] InnoDB: Dumping buffer pool(s) to /srv/mysql/data/ib_buffer_pool
2025-06-18 16:27:29 0 [Note] InnoDB: Buffer pool(s) dump completed at 250618 16:27:29
2025-06-18 16:27:30 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2025-06-18 16:27:30 0 [Note] InnoDB: Shutdown completed; log sequence number 45814; transaction id 23
2025-06-18 16:27:30 0 [Note] /usr/sbin/mysqld: Shutdown complete

This was done by using log_warnings=2, set the verbosity to 9 for more detailed logs to be printed. See Error Log

After a few tries of systemctl stop mariadb.service the logs were the same.


The same logs were printed when SHUTDOWN WAIT FOR ALL REPLICAS; was applied.

2025-06-18 16:58:27 0 [Note] /usr/sbin/mysqld (initiated by: root[root] @ localhost []): Normal shutdown
2025-06-18 16:58:27 0 [Note] InnoDB: FTS optimize thread exiting.
2025-06-18 16:58:27 0 [Note] InnoDB: Starting shutdown...
2025-06-18 16:58:27 0 [Note] InnoDB: Dumping buffer pool(s) to /srv/mysql/data/ib_buffer_pool
2025-06-18 16:58:27 0 [Note] InnoDB: Buffer pool(s) dump completed at 250618 16:58:27
2025-06-18 16:58:27 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2025-06-18 16:58:27 0 [Note] InnoDB: Shutdown completed; log sequence number 45814; transaction id 23
2025-06-18 16:58:27 0 [Note] /usr/sbin/mysqld: Shutdown complete

See if any major Changelogs happened which might affect you application.

Before any upgrades I saved a physical backup, usually using mysqldump/mariadb-dump.

For any major upgrades I recommend you install the new version on a new fresh server and set up the server as a replica.

In this case you will not have any 'major' downtime in production, you would verify if your app is fully compatible with the new version and will be zero risk to the primary data.

When you are completely sure that the new version is fully compatible and the replica has caught up, promote replica to master.

Ergest Basha
  • 5,369
  • 3
  • 7
  • 22