From b55e79910c5690862978f9d2927e60db2d895dee Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 1 Apr 2010 15:22:39 +0400 Subject: [PATCH] Applying InnoDB snapshot Detailed revision comments: r6463 | marko | 2010-01-14 15:43:37 +0200 (Thu, 14 Jan 2010) | 5 lines branches/zip: page_copy_rec_list_end(), page_copy_rec_list_start(): Update PAGE_MAX_TRX_ID before attempting to compress the page. This fixes Issue #382 (a debug assertion failure in page_zip_reorganize()) and reduces the generated redo log. There was no bug or crash in non-debug builds. --- storage/innodb_plugin/page/page0page.c | 34 +++++++++++++++----------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/storage/innodb_plugin/page/page0page.c b/storage/innodb_plugin/page/page0page.c index ab2ba60570e..17c40170e14 100644 --- a/storage/innodb_plugin/page/page0page.c +++ b/storage/innodb_plugin/page/page0page.c @@ -658,6 +658,14 @@ page_copy_rec_list_end( index, mtr); } + /* Update PAGE_MAX_TRX_ID on the uncompressed page. + Modifications will be redo logged and copied to the compressed + page in page_zip_compress() or page_zip_reorganize() below. */ + if (dict_index_is_sec_or_ibuf(index) && page_is_leaf(page)) { + page_update_max_trx_id(new_block, NULL, + page_get_max_trx_id(page), mtr); + } + if (UNIV_LIKELY_NULL(new_page_zip)) { mtr_set_log_mode(mtr, log_mode); @@ -696,15 +704,10 @@ page_copy_rec_list_end( } } - /* Update the lock table, MAX_TRX_ID, and possible hash index */ + /* Update the lock table and possible hash index */ lock_move_rec_list_end(new_block, block, rec); - if (dict_index_is_sec_or_ibuf(index) && page_is_leaf(page)) { - page_update_max_trx_id(new_block, new_page_zip, - page_get_max_trx_id(page), mtr); - } - btr_search_move_or_delete_hash_entries(new_block, block, index); return(ret); @@ -772,6 +775,16 @@ page_copy_rec_list_start( mem_heap_free(heap); } + /* Update PAGE_MAX_TRX_ID on the uncompressed page. + Modifications will be redo logged and copied to the compressed + page in page_zip_compress() or page_zip_reorganize() below. */ + if (dict_index_is_sec_or_ibuf(index) + && page_is_leaf(page_align(rec))) { + page_update_max_trx_id(new_block, NULL, + page_get_max_trx_id(page_align(rec)), + mtr); + } + if (UNIV_LIKELY_NULL(new_page_zip)) { mtr_set_log_mode(mtr, log_mode); @@ -809,14 +822,7 @@ page_copy_rec_list_start( } } - /* Update MAX_TRX_ID, the lock table, and possible hash index */ - - if (dict_index_is_sec_or_ibuf(index) - && page_is_leaf(page_align(rec))) { - page_update_max_trx_id(new_block, new_page_zip, - page_get_max_trx_id(page_align(rec)), - mtr); - } + /* Update the lock table and possible hash index */ lock_move_rec_list_start(new_block, block, rec, ret);