Commit bdcd7f79 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14916 InnoDB reports warning for "Purge reached the head of the history list"

The warning was originally added in
commit c6766305
(MySQL 4.1.12, 5.0.3) to trace claimed undo log corruption that
was analyzed in https://lists.mysql.com/mysql/176250
on November 9, 2004.

Originally, the limit was 20,000 undo log headers or transactions,
but in commit 9d6d1902
in MySQL 5.5.11 it was increased to 2,000,000.

The message can be triggered when the progress of purge is prevented
by a long-running transaction (or just an idle transaction whose
read view was started a long time ago), by running many transactions
that UPDATE or DELETE some records, then starting another transaction
with a read view, and finally by executing more than 2,000,000
transactions that UPDATE or DELETE records in InnoDB tables. Finally,
when the oldest long-running transaction is completed, purge would
run up to the next-oldest transaction, and there would still be more
than 2,000,000 transactions to purge.

Because the message can be triggered when the database is obviously
not corrupted, it should be removed. Heavy users of InnoDB should be
monitoring the "History list length" in SHOW ENGINE INNODB STATUS;
there is no need to spam the error log.
parent 9c9cf556
...@@ -720,32 +720,6 @@ trx_purge_rseg_get_next_history_log( ...@@ -720,32 +720,6 @@ trx_purge_rseg_get_next_history_log(
mutex_exit(&(rseg->mutex)); mutex_exit(&(rseg->mutex));
mtr_commit(&mtr); mtr_commit(&mtr);
mutex_enter(&kernel_mutex);
/* Add debug code to track history list corruption reported
on the MySQL mailing list on Nov 9, 2004. The fut0lst.c
file-based list was corrupt. The prev node pointer was
FIL_NULL, even though the list length was over 8 million nodes!
We assume that purge truncates the history list in large
size pieces, and if we here reach the head of the list, the
list cannot be longer than 2000 000 undo logs now. */
if (trx_sys->rseg_history_len > 2000000) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: purge reached the"
" head of the history list,\n"
"InnoDB: but its length is still"
" reported as %lu! Make a detailed bug\n"
"InnoDB: report, and submit it"
" to https://jira.mariadb.org/\n",
(ulong) trx_sys->rseg_history_len);
ut_ad(0);
}
mutex_exit(&kernel_mutex);
return; return;
} }
......
...@@ -728,32 +728,6 @@ trx_purge_rseg_get_next_history_log( ...@@ -728,32 +728,6 @@ trx_purge_rseg_get_next_history_log(
mutex_exit(&(rseg->mutex)); mutex_exit(&(rseg->mutex));
mtr_commit(&mtr); mtr_commit(&mtr);
mutex_enter(&kernel_mutex);
/* Add debug code to track history list corruption reported
on the MySQL mailing list on Nov 9, 2004. The fut0lst.c
file-based list was corrupt. The prev node pointer was
FIL_NULL, even though the list length was over 8 million nodes!
We assume that purge truncates the history list in large
size pieces, and if we here reach the head of the list, the
list cannot be longer than 2000 000 undo logs now. */
if (trx_sys->rseg_history_len > 2000000) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: Warning: purge reached the"
" head of the history list,\n"
"InnoDB: but its length is still"
" reported as %lu! Make a detailed bug\n"
"InnoDB: report, and submit it"
" to https://jira.mariadb.org/\n",
(ulong) trx_sys->rseg_history_len);
ut_ad(0);
}
mutex_exit(&kernel_mutex);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment