Commit 17234d60 authored by MySQL Build Team's avatar MySQL Build Team

Backport into build-201102032246-5.1.52sp1

> ------------------------------------------------------------
> revno: 3351.14.280
> revision-id: inaam.rana@oracle.com-20101026205418-aq835zpvxdskdf4c
> parent: jimmy.yang@oracle.com-20101025055121-j319j363abfgdh6n
> committer: Inaam Rana <inaam.rana@oracle.com>
> branch nick: mysql-5.1-innodb
> timestamp: Tue 2010-10-26 16:54:18 -0400
> message:
>   Bug #57611	ibdata file and continuous growing undo logs
>   rb://498
>   
>   Fix handling of update_undo_logs at trx commit. Previously, when
>   rseg->update_undo_list grows beyond 500 the update_undo_logs were
>   marked with state TRX_UNDO_TO_FREE which should have been
>   TRX_UNDO_TO_PURGE.
>   
>   Approved by: Sunny Bains
parent 34812d0f
...@@ -1752,21 +1752,11 @@ trx_undo_set_state_at_finish( ...@@ -1752,21 +1752,11 @@ trx_undo_set_state_at_finish(
if (undo->size == 1 if (undo->size == 1
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE) && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
< TRX_UNDO_PAGE_REUSE_LIMIT) { < TRX_UNDO_PAGE_REUSE_LIMIT
&& UT_LIST_GET_LEN(rseg->update_undo_list) < 500
&& UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
/* This is a heuristic to avoid the problem of all UNDO state = TRX_UNDO_CACHED;
slots ending up in one of the UNDO lists. Previously if
the server crashed with all the slots in one of the lists,
transactions that required the slots of a different type
would fail for lack of slots. */
if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
&& UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
state = TRX_UNDO_CACHED;
} else {
state = TRX_UNDO_TO_FREE;
}
} else if (undo->type == TRX_UNDO_INSERT) { } else if (undo->type == TRX_UNDO_INSERT) {
......
...@@ -1823,21 +1823,11 @@ trx_undo_set_state_at_finish( ...@@ -1823,21 +1823,11 @@ trx_undo_set_state_at_finish(
if (undo->size == 1 if (undo->size == 1
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE) && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
< TRX_UNDO_PAGE_REUSE_LIMIT) { < TRX_UNDO_PAGE_REUSE_LIMIT
&& UT_LIST_GET_LEN(rseg->update_undo_list) < 500
&& UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
/* This is a heuristic to avoid the problem of all UNDO state = TRX_UNDO_CACHED;
slots ending up in one of the UNDO lists. Previously if
the server crashed with all the slots in one of the lists,
transactions that required the slots of a different type
would fail for lack of slots. */
if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
&& UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
state = TRX_UNDO_CACHED;
} else {
state = TRX_UNDO_TO_FREE;
}
} else if (undo->type == TRX_UNDO_INSERT) { } else if (undo->type == TRX_UNDO_INSERT) {
......
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