Reduce size of MariaDB undo logs
Firewall Threat Defense devices may experience high disk utilization and degraded performance when MariaDB undo logs grow to an unacceptable size. A normal and acceptable size for these undo files is approximately 10 MB. Files over 1 GB may trigger health alerts on the Firewall Management Center. When the undo files exceed the 1 GB threshold, they consume critical disk space and require manual intervention to re-initialize the database files and restore the logs to their normal operating size.
Before you begin
Verify that the Firewall Threat Defense device has enough disk space to perform a backup. The available space in the Volume must be at least twice the size of the directory /ngfw/var/lib/mysql/sfsnort.
-
Run
du -sh /ngfw/var/lib/mysql/sfsnortcommand to determine the size of the/ngfw/var/lib/mysql/sfsnortdirectory.root@firepower:/home/admin# du -sh /ngfw/var/lib/mysql/sfsnort 414M /ngfw/var/lib/mysql/sfsnort -
Run
df -hcommand to check the available disk space in/ngfw/Volume. Ensure that it is at least twice the size of the directory.
Procedure
Step 1 | Disable the Data Correlator service and verify that it is successfully disabled.
|
Step 2 | Set the necessary environment variables for your database session.
Note that these variables must be reset if your SSH connection disconnects. |
Step 3 | Create a full database backup using the
|
Step 4 | Validate that the backup file size is appropriate and confirm the dump is complete by running the If the backup file contains warnings regarding the max_allowed_packet option at the beginning of the file, open the file and comment out those lines by adding two dashes in front of each line. |
Step 5 | Stop the MariaDB service and ensure that no active
|
Step 6 | Archive the existing MariaDB error logs for future analysis by running this command:
|
Step 7 | Delete all contents within the |
Step 8 | Re-initialize the MariaDB database structure and set the correct permissions.
|
Step 9 | Set the correct ownership permissions for the MySQL directory by running the command |
Step 10 | Restart the MariaDB service and verify that it starts correctly.
|
Step 11 | Restore the database from the backup file created in step 4 and verify that the restoration completed successfully. |
Step 12 | Reset the MariaDB privileges by executing the command |
Step 13 | Re-enable the Data Correlator service by running |
Step 14 | Confirm that the Data Correlator service has started successfully by checking its status with |
What to do next
-
Navigate to the
/ngfw/var/lib/mysql/directory and check the size of the undo files using the commandls -lrth *undo*. The procedure is successful if the undo files, such asundo001andundo002, return to their normal size of approximately 10 MB. -
Verify that the Firewall Management Center no longer displays health alerts regarding MariaDB undo log thresholds.