Hi Otto,
If you have the complete server error log, then one could check
the following ...
1. Then looking for following pattern would ensure that server
was shutdown by a command and is not killed abnormally.
2025-06-20 21:11:51 0 [Note] mariadbd (initiated by:
debanerj[debanerj] @ localhost []): Normal shutdown
2025-06-20 21:11:51 0 [Note] InnoDB: Starting shutdown...
2025-06-20 21:11:52 0 [Note] InnoDB: Shutdown completed; log
sequence number 390485542; transaction id 1078
2. When innodb_fast_shutdown=2 is set, a recovery would be needed even after shutdown is triggered. Then the log should contain a line warning about that.
2025-06-20 21:14:51 0 [Note] mariadbd (initiated by:
debanerj[debanerj] @ localhost []): Normal shutdown
2025-06-20 21:14:51 0 [Note] InnoDB: Starting shutdown...
2025-06-20 21:14:51 0 [Note] InnoDB: Executing
innodb_fast_shutdown=2. Next startup will execute crash
recovery!
2025-06-20 21:14:51 0 [Note] InnoDB: Removed temporary
tablespace data file: "./ibtmp1"
2025-06-20 21:14:51 0 [Note] InnoDB: Shutdown completed; log
sequence number 0; transaction id 1078
2025-06-20 21:14:51 0 [Note] mariadbd: Shutdown complete
There is inherent risk here that we may not be looking at the latest server log. Unfortunately, AFAIK, there is no easy way to find out whether recovery is needed by looking at files in data directory. It would need parsing the redo logs.
The safest way for a DBA is to start the server once and shutdown again with innodb_fast_shutdown=0 (slow shutdown) before going for an upgrade.
1. Start server and check the error log for the recovery message.
2025-06-20 21:24:14 0 [Note] InnoDB: Starting crash recovery
from checkpoint LSN=390485526
2. Connect to the server
MariaDB [(none)]> set global innodb_fast_shutdown=0;
MariaDB [(none)]> shutdown;
3. If step [1] shows the recovery message then repeat the steps
from [1] once more to confirm that no recovery message appears.
* In above steps, innodb_fast_shutdown=1 (default) would also
work and could be a bit faster but I recommend the slow shutdown
which also takes care of purging any left over undo records.
Regards,
Deb