Undo logs are not truncating even the parameter is set to ON

62 views Asked by At

we have configured the below settings in our configuration file.

--innodb_file_per_table=1
--innodb_undo_tablespaces=3
--innodb_undo_directory=/var/lib/mysql/
--innodb_undo_log_truncate=ON
--innodb_max_undo_log_size=10737418240

However, the size of undo log files have reached more than 15GB and they are not truncating as per the set size of 10GB.

Can not restart or shutdown server. Any advise, what needs to be changed or add will be appreciated.

I have enabled the possible parameters that can solve the issue. I would like to truncate the undo log once they reached 10GB

1

There are 1 answers

0
Rick James On

https://mariadb.com/kb/en/innodb-system-variables/#innodb_max_undo_log_size

innodb_max_undo_log_size

Description: If an undo tablespace is larger than this, it will be marked for truncation if innodb_undo_log_truncate is set.

https://mariadb.com/kb/en/innodb-system-variables/#innodb_undo_log_truncate

innodb_undo_log_truncate

Description: When enabled, innodb_undo_tablespaces that are larger than innodb_max_undo_log_size will be marked for truncation. See also innodb_purge_rseg_truncate_frequency. Enabling this setting may cause stalls during heavy write workloads.

https://mariadb.com/kb/en/innodb-system-variables/#innodb_purge_rseg_truncate_frequency

innodb_purge_rseg_truncate_frequency

Description: Frequency with which undo records are purged. Set by default to every 128 times, reducing this increases the frequency at which rollback segments are freed. See also innodb_undo_log_truncate. The motivation for introducing this in MySQL seems to have been to avoid stalls due to freeing undo log pages or truncating undo log tablespaces. In MariaDB, innodb_undo_log_truncate=ON should be a much lighter operation because it will not involve any log checkpoint, hence this is deprecated and ignored from MariaDB 10.6.16, MariaDB 10.10.7, MariaDB 10.11.6, MariaDB 11.0.4, MariaDB 11.1.3 and MariaDB 11.2.2. (MDEV-32050)

But note the change being made in 10.11.6.

Alas, these docs don't seem to answer your question.

There may be more insight here: https://jira.mariadb.org/browse/MDEV-32050