MySQL undo logs not truncating

Description

I have mysql with 3 undo logs, but truncation is not working.

I enabled innodb_undo_log_truncate, decreased innodb_purge_rseg_truncate_frequency to 32

show global variables like '%undo%'

innodb_max_undo_log_size 1073741824
innodb_undo_directory /data/mysql/
innodb_undo_log_truncate ON
innodb_undo_logs 128
innodb_undo_tablespaces 3

show global variables like '%truncate%'

innodb_purge_rseg_truncate_frequency 32
innodb_undo_log_truncate ON

Executing show engine innodb status doesn't show any long running rollback transaction.

But my undo logs keep growing.

root@server:/data/mysql# du -h -c undo00*
598G undo001
747G undo002
346G undo003

Environment

Ubuntu 16.04.1 LTS

Smart Checklist

Activity

Show:

Lalit Choudhary February 12, 2021 at 2:21 PM

Hi

Thank you for the update.

Giuseppe Liguori February 12, 2021 at 1:49 PM

Hi Lalit,

i found the culprit.

trx_rseg_history_len was very higher, so i reduced the load of server with innodb_max_purge_lag greater than 0 and waited the history purged.

Lalit Choudhary February 12, 2021 at 12:26 PM

Hi

Thank you for the report.

can send error log entries as well for review. If it's adding any message for undo trucation. 

Not a Bug

Details

Assignee

Reporter

Labels

Affects versions

Priority

Smart Checklist

Created January 18, 2021 at 8:11 PM
Updated March 6, 2024 at 10:45 AM
Resolved February 12, 2021 at 2:21 PM