Commit 91f8a3dd authored by marko's avatar marko

branches/zip: Remove many fil_space_get_zip_size() calls.

ibuf_page(), ibuf_page_low(), ibuf_free_excess_pages(), ibuf_insert(),
buf_read_page(), buf_read_ahead_linear(), buf_read_recv_pages():
Add parameter zip_size.
parent a3860f71
...@@ -468,8 +468,9 @@ btr_cur_search_to_nth_level( ...@@ -468,8 +468,9 @@ btr_cur_search_to_nth_level(
ut_ad(cursor->thr); ut_ad(cursor->thr);
if (ibuf_should_try(index, ignore_sec_unique) if (ibuf_should_try(index, ignore_sec_unique)
&& ibuf_insert(tuple, index, space, page_no, && ibuf_insert(tuple, index, space,
cursor->thr)) { dict_table_zip_size(index->table),
page_no, cursor->thr)) {
/* Insertion to the insert buffer succeeded */ /* Insertion to the insert buffer succeeded */
cursor->flag = BTR_CUR_INSERT_TO_IBUF; cursor->flag = BTR_CUR_INSERT_TO_IBUF;
if (UNIV_LIKELY_NULL(heap)) { if (UNIV_LIKELY_NULL(heap)) {
......
...@@ -1185,7 +1185,8 @@ buf_page_get_gen( ...@@ -1185,7 +1185,8 @@ buf_page_get_gen(
ut_ad((mode == BUF_GET) || (mode == BUF_GET_IF_IN_POOL) ut_ad((mode == BUF_GET) || (mode == BUF_GET_IF_IN_POOL)
|| (mode == BUF_GET_NO_LATCH) || (mode == BUF_GET_NOWAIT)); || (mode == BUF_GET_NO_LATCH) || (mode == BUF_GET_NOWAIT));
#ifndef UNIV_LOG_DEBUG #ifndef UNIV_LOG_DEBUG
ut_ad(!ibuf_inside() || ibuf_page(space, offset)); ut_ad(!ibuf_inside()
|| ibuf_page(space, fil_space_get_zip_size(space), offset));
#endif #endif
buf_pool->n_page_gets++; buf_pool->n_page_gets++;
loop: loop:
...@@ -1217,7 +1218,7 @@ buf_page_get_gen( ...@@ -1217,7 +1218,7 @@ buf_page_get_gen(
return(NULL); return(NULL);
} }
buf_read_page(space, offset); buf_read_page(space, fil_space_get_zip_size(space), offset);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
buf_dbg_counter++; buf_dbg_counter++;
...@@ -1353,7 +1354,8 @@ buf_page_get_gen( ...@@ -1353,7 +1354,8 @@ buf_page_get_gen(
/* In the case of a first access, try to apply linear /* In the case of a first access, try to apply linear
read-ahead */ read-ahead */
buf_read_ahead_linear(space, offset); buf_read_ahead_linear(space, buf_block_get_zip_size(block),
offset);
} }
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
...@@ -1414,7 +1416,9 @@ buf_page_optimistic_get_func( ...@@ -1414,7 +1416,9 @@ buf_page_optimistic_get_func(
mutex_exit(&(buf_pool->mutex)); mutex_exit(&(buf_pool->mutex));
ut_ad(!ibuf_inside() || ibuf_page(block->space, block->offset)); ut_ad(!ibuf_inside()
|| ibuf_page(block->space, buf_block_get_zip_size(block),
block->offset));
if (rw_latch == RW_S_LATCH) { if (rw_latch == RW_S_LATCH) {
success = rw_lock_s_lock_func_nowait(&(block->lock), success = rw_lock_s_lock_func_nowait(&(block->lock),
...@@ -1474,8 +1478,9 @@ buf_page_optimistic_get_func( ...@@ -1474,8 +1478,9 @@ buf_page_optimistic_get_func(
/* In the case of a first access, try to apply linear /* In the case of a first access, try to apply linear
read-ahead */ read-ahead */
buf_read_ahead_linear(page_get_space_id(guess), buf_read_ahead_linear(buf_block_get_space(block),
page_get_page_no(guess)); buf_block_get_zip_size(block),
buf_block_get_page_no(block));
} }
#ifdef UNIV_IBUF_DEBUG #ifdef UNIV_IBUF_DEBUG
...@@ -1740,7 +1745,7 @@ buf_page_init_for_read( ...@@ -1740,7 +1745,7 @@ buf_page_init_for_read(
mtr_start(&mtr); mtr_start(&mtr);
if (!ibuf_page_low(space, offset, &mtr)) { if (!ibuf_page_low(space, zip_size, offset, &mtr)) {
mtr_commit(&mtr); mtr_commit(&mtr);
......
...@@ -170,11 +170,11 @@ buf_read_ahead_random( ...@@ -170,11 +170,11 @@ buf_read_ahead_random(
the page at the given page number does not get the page at the given page number does not get
read even if we return a value > 0! */ read even if we return a value > 0! */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint offset) /* in: page number of a page which the current thread ulint offset) /* in: page number of a page which the current thread
wants to access */ wants to access */
{ {
ib_longlong tablespace_version; ib_longlong tablespace_version;
ulint zip_size;
buf_block_t* block; buf_block_t* block;
ulint recent_blocks = 0; ulint recent_blocks = 0;
ulint count; ulint count;
...@@ -189,10 +189,8 @@ buf_read_ahead_random( ...@@ -189,10 +189,8 @@ buf_read_ahead_random(
return(0); return(0);
} }
zip_size = fil_space_get_zip_size(space);
if (ibuf_bitmap_page(zip_size, offset) if (ibuf_bitmap_page(zip_size, offset)
|| trx_sys_hdr_page(space, offset)) { || trx_sys_hdr_page(space, offset)) {
/* If it is an ibuf bitmap page or trx sys hdr, we do /* If it is an ibuf bitmap page or trx sys hdr, we do
no read-ahead, as that could break the ibuf page access no read-ahead, as that could break the ibuf page access
...@@ -317,18 +315,17 @@ buf_read_page( ...@@ -317,18 +315,17 @@ buf_read_page(
/* out: number of page read requests issued: this can /* out: number of page read requests issued: this can
be > 1 if read-ahead occurred */ be > 1 if read-ahead occurred */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint offset) /* in: page number */ ulint offset) /* in: page number */
{ {
ib_longlong tablespace_version; ib_longlong tablespace_version;
ulint zip_size;
ulint count; ulint count;
ulint count2; ulint count2;
ulint err; ulint err;
zip_size = fil_space_get_zip_size(space);
tablespace_version = fil_space_get_version(space); tablespace_version = fil_space_get_version(space);
count = buf_read_ahead_random(space, offset); count = buf_read_ahead_random(space, zip_size, offset);
/* We do the i/o in the synchronous aio mode to save thread /* We do the i/o in the synchronous aio mode to save thread
switches: hence TRUE */ switches: hence TRUE */
...@@ -381,11 +378,11 @@ buf_read_ahead_linear( ...@@ -381,11 +378,11 @@ buf_read_ahead_linear(
/*==================*/ /*==================*/
/* out: number of page read requests issued */ /* out: number of page read requests issued */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint offset) /* in: page number of a page; NOTE: the current thread ulint offset) /* in: page number of a page; NOTE: the current thread
must want access to this page (see NOTE 3 above) */ must want access to this page (see NOTE 3 above) */
{ {
ib_longlong tablespace_version; ib_longlong tablespace_version;
ulint zip_size;
buf_block_t* block; buf_block_t* block;
buf_frame_t* frame; buf_frame_t* frame;
buf_block_t* pred_block = NULL; buf_block_t* pred_block = NULL;
...@@ -416,10 +413,8 @@ buf_read_ahead_linear( ...@@ -416,10 +413,8 @@ buf_read_ahead_linear(
return(0); return(0);
} }
zip_size = fil_space_get_zip_size(space);
if (ibuf_bitmap_page(zip_size, offset) if (ibuf_bitmap_page(zip_size, offset)
|| trx_sys_hdr_page(space, offset)) { || trx_sys_hdr_page(space, offset)) {
/* If it is an ibuf bitmap page or trx sys hdr, we do /* If it is an ibuf bitmap page or trx sys hdr, we do
no read-ahead, as that could break the ibuf page access no read-ahead, as that could break the ibuf page access
...@@ -688,16 +683,22 @@ Issues read requests for pages which recovery wants to read in. */ ...@@ -688,16 +683,22 @@ Issues read requests for pages which recovery wants to read in. */
void void
buf_read_recv_pages( buf_read_recv_pages(
/*================*/ /*================*/
ibool sync, /* in: TRUE if the caller wants this function ibool sync, /* in: TRUE if the caller
to wait for the highest address page to get wants this function to wait
read in, before this function returns */ for the highest address page
ulint space, /* in: space id */ to get read in, before this
ulint* page_nos, /* in: array of page numbers to read, with the function returns */
highest page number the last in the array */ ulint space, /* in: space id */
ulint n_stored) /* in: number of page numbers in the array */ ulint zip_size, /* in: compressed page size in
bytes, or 0 */
const ulint* page_nos, /* in: array of page numbers
to read, with the highest page
number the last in the
array */
ulint n_stored) /* in: number of page numbers
in the array */
{ {
ib_longlong tablespace_version; ib_longlong tablespace_version;
ulint zip_size;
ulint count; ulint count;
ulint err; ulint err;
ulint i; ulint i;
......
...@@ -4237,13 +4237,13 @@ fil_io( ...@@ -4237,13 +4237,13 @@ fil_io(
|| sync || is_log); || sync || is_log);
#ifdef UNIV_SYNC_DEBUG #ifdef UNIV_SYNC_DEBUG
ut_ad(!ibuf_inside() || is_log || (type == OS_FILE_WRITE) ut_ad(!ibuf_inside() || is_log || (type == OS_FILE_WRITE)
|| ibuf_page(space_id, block_offset)); || ibuf_page(space_id, zip_size, block_offset));
#endif #endif
#endif #endif
if (sync) { if (sync) {
mode = OS_AIO_SYNC; mode = OS_AIO_SYNC;
} else if (type == OS_FILE_READ && !is_log } else if (type == OS_FILE_READ && !is_log
&& ibuf_page(space_id, block_offset)) { && ibuf_page(space_id, zip_size, block_offset)) {
mode = OS_AIO_IBUF; mode = OS_AIO_IBUF;
} else if (is_log) { } else if (is_log) {
mode = OS_AIO_LOG; mode = OS_AIO_LOG;
......
...@@ -2176,7 +2176,7 @@ fseg_create_general( ...@@ -2176,7 +2176,7 @@ fseg_create_general(
excess pages from the insert buffer free list */ excess pages from the insert buffer free list */
if (space == 0) { if (space == 0) {
ibuf_free_excess_pages(space); ibuf_free_excess_pages(0, 0);
} }
} }
...@@ -2730,7 +2730,7 @@ fseg_alloc_free_page_general( ...@@ -2730,7 +2730,7 @@ fseg_alloc_free_page_general(
excess pages from the insert buffer free list */ excess pages from the insert buffer free list */
if (space == 0) { if (space == 0) {
ibuf_free_excess_pages(space); ibuf_free_excess_pages(0, 0);
} }
} }
......
...@@ -1001,12 +1001,12 @@ ibuf_page( ...@@ -1001,12 +1001,12 @@ ibuf_page(
/*======*/ /*======*/
/* out: TRUE if level 2 or level 3 page */ /* out: TRUE if level 2 or level 3 page */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no)/* in: page number */ ulint page_no)/* in: page number */
{ {
page_t* bitmap_page; page_t* bitmap_page;
mtr_t mtr; mtr_t mtr;
ibool ret; ibool ret;
ulint zip_size;
if (recv_no_ibuf_operations) { if (recv_no_ibuf_operations) {
/* Recovery is running: no ibuf operations should be /* Recovery is running: no ibuf operations should be
...@@ -1015,8 +1015,6 @@ ibuf_page( ...@@ -1015,8 +1015,6 @@ ibuf_page(
return(FALSE); return(FALSE);
} }
zip_size = fil_space_get_zip_size(space);
if (ibuf_fixed_addr_page(space, zip_size, page_no)) { if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
return(TRUE); return(TRUE);
...@@ -1049,15 +1047,13 @@ ibuf_page_low( ...@@ -1049,15 +1047,13 @@ ibuf_page_low(
/*==========*/ /*==========*/
/* out: TRUE if level 2 or level 3 page */ /* out: TRUE if level 2 or level 3 page */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no,/* in: page number */ ulint page_no,/* in: page number */
mtr_t* mtr) /* in: mtr which will contain an x-latch to the mtr_t* mtr) /* in: mtr which will contain an x-latch to the
bitmap page if the page is not one of the fixed bitmap page if the page is not one of the fixed
address ibuf pages */ address ibuf pages */
{ {
page_t* bitmap_page; page_t* bitmap_page;
ulint zip_size;
zip_size = fil_space_get_zip_size(space);
if (ibuf_fixed_addr_page(space, zip_size, page_no)) { if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
...@@ -1662,6 +1658,8 @@ ibuf_add_free_page( ...@@ -1662,6 +1658,8 @@ ibuf_add_free_page(
/* out: DB_SUCCESS, or DB_STRONG_FAIL /* out: DB_SUCCESS, or DB_STRONG_FAIL
if no space left */ if no space left */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size, /* in: compressed page size in
bytes, or 0 */
ibuf_data_t* ibuf_data) /* in: ibuf data for the space */ ibuf_data_t* ibuf_data) /* in: ibuf data for the space */
{ {
mtr_t mtr; mtr_t mtr;
...@@ -1670,7 +1668,6 @@ ibuf_add_free_page( ...@@ -1670,7 +1668,6 @@ ibuf_add_free_page(
page_t* page; page_t* page;
page_t* root; page_t* root;
page_t* bitmap_page; page_t* bitmap_page;
ulint zip_size;
ut_a(space == 0); ut_a(space == 0);
...@@ -1730,8 +1727,6 @@ ibuf_add_free_page( ...@@ -1730,8 +1727,6 @@ ibuf_add_free_page(
/* Set the bit indicating that this page is now an ibuf tree page /* Set the bit indicating that this page is now an ibuf tree page
(level 2 page) */ (level 2 page) */
zip_size = fil_space_get_zip_size(space);
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &mtr); bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &mtr);
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size, ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
...@@ -1752,13 +1747,14 @@ void ...@@ -1752,13 +1747,14 @@ void
ibuf_remove_free_page( ibuf_remove_free_page(
/*==================*/ /*==================*/
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size, /* in: compressed page size in
bytes, or 0 */
ibuf_data_t* ibuf_data) /* in: ibuf data for the space */ ibuf_data_t* ibuf_data) /* in: ibuf data for the space */
{ {
mtr_t mtr; mtr_t mtr;
mtr_t mtr2; mtr_t mtr2;
page_t* header_page; page_t* header_page;
ulint page_no; ulint page_no;
ulint zip_size;
page_t* page; page_t* page;
page_t* root; page_t* root;
page_t* bitmap_page; page_t* bitmap_page;
...@@ -1853,8 +1849,6 @@ ibuf_remove_free_page( ...@@ -1853,8 +1849,6 @@ ibuf_remove_free_page(
/* Set the bit indicating that this page is no more an ibuf tree page /* Set the bit indicating that this page is no more an ibuf tree page
(level 2 page) */ (level 2 page) */
zip_size = fil_space_get_zip_size(space);
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &mtr); bitmap_page = ibuf_bitmap_get_map_page(space, page_no, zip_size, &mtr);
ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size, ibuf_bitmap_page_set_bits(bitmap_page, page_no, zip_size,
...@@ -1877,7 +1871,8 @@ file segment, and the thread did not own the fsp latch before this call. */ ...@@ -1877,7 +1871,8 @@ file segment, and the thread did not own the fsp latch before this call. */
void void
ibuf_free_excess_pages( ibuf_free_excess_pages(
/*===================*/ /*===================*/
ulint space) /* in: space id */ ulint space, /* in: space id */
ulint zip_size) /* in: compressed page size in bytes, or 0 */
{ {
ibuf_data_t* ibuf_data; ibuf_data_t* ibuf_data;
ulint i; ulint i;
...@@ -1928,7 +1923,7 @@ ibuf_free_excess_pages( ...@@ -1928,7 +1923,7 @@ ibuf_free_excess_pages(
mutex_exit(&ibuf_mutex); mutex_exit(&ibuf_mutex);
ibuf_remove_free_page(space, ibuf_data); ibuf_remove_free_page(space, zip_size, ibuf_data);
} }
} }
...@@ -2564,6 +2559,7 @@ ibuf_insert_low( ...@@ -2564,6 +2559,7 @@ ibuf_insert_low(
dict_index_t* index, /* in: index where to insert; must not be dict_index_t* index, /* in: index where to insert; must not be
unique or clustered */ unique or clustered */
ulint space, /* in: space id where to insert */ ulint space, /* in: space id where to insert */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no,/* in: page number where to insert */ ulint page_no,/* in: page number where to insert */
que_thr_t* thr) /* in: query thread */ que_thr_t* thr) /* in: query thread */
{ {
...@@ -2587,7 +2583,6 @@ ibuf_insert_low( ...@@ -2587,7 +2583,6 @@ ibuf_insert_low(
ulint page_nos[IBUF_MAX_N_PAGES_MERGED]; ulint page_nos[IBUF_MAX_N_PAGES_MERGED];
ulint n_stored; ulint n_stored;
ulint bits; ulint bits;
ulint zip_size;
mtr_t mtr; mtr_t mtr;
mtr_t bitmap_mtr; mtr_t bitmap_mtr;
...@@ -2639,7 +2634,7 @@ ibuf_insert_low( ...@@ -2639,7 +2634,7 @@ ibuf_insert_low(
mutex_exit(&ibuf_pessimistic_insert_mutex); mutex_exit(&ibuf_pessimistic_insert_mutex);
err = ibuf_add_free_page(0, ibuf_data); err = ibuf_add_free_page(0, zip_size, ibuf_data);
if (err == DB_STRONG_FAIL) { if (err == DB_STRONG_FAIL) {
...@@ -2683,8 +2678,6 @@ ibuf_insert_low( ...@@ -2683,8 +2678,6 @@ ibuf_insert_low(
#endif #endif
mtr_start(&bitmap_mtr); mtr_start(&bitmap_mtr);
zip_size = fil_space_get_zip_size(space);
bitmap_page = ibuf_bitmap_get_map_page(space, page_no, bitmap_page = ibuf_bitmap_get_map_page(space, page_no,
zip_size, &bitmap_mtr); zip_size, &bitmap_mtr);
...@@ -2829,6 +2822,7 @@ ibuf_insert( ...@@ -2829,6 +2822,7 @@ ibuf_insert(
dtuple_t* entry, /* in: index entry to insert */ dtuple_t* entry, /* in: index entry to insert */
dict_index_t* index, /* in: index where to insert */ dict_index_t* index, /* in: index where to insert */
ulint space, /* in: space id where to insert */ ulint space, /* in: space id where to insert */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no,/* in: page number where to insert */ ulint page_no,/* in: page number where to insert */
que_thr_t* thr) /* in: query thread */ que_thr_t* thr) /* in: query thread */
{ {
...@@ -2846,11 +2840,11 @@ ibuf_insert( ...@@ -2846,11 +2840,11 @@ ibuf_insert(
return(FALSE); return(FALSE);
} }
err = ibuf_insert_low(BTR_MODIFY_PREV, entry, index, space, page_no, err = ibuf_insert_low(BTR_MODIFY_PREV, entry, index,
thr); space, zip_size, page_no, thr);
if (err == DB_FAIL) { if (err == DB_FAIL) {
err = ibuf_insert_low(BTR_MODIFY_TREE, entry, index, space, err = ibuf_insert_low(BTR_MODIFY_TREE, entry, index,
page_no, thr); space, zip_size, page_no, thr);
} }
if (err == DB_SUCCESS) { if (err == DB_SUCCESS) {
...@@ -2973,7 +2967,7 @@ ibuf_insert_to_index_page( ...@@ -2973,7 +2967,7 @@ ibuf_insert_to_index_page(
"InnoDB: that table.\n", stderr); "InnoDB: that table.\n", stderr);
space = page_get_space_id(page); space = page_get_space_id(page);
zip_size = fil_space_get_zip_size(space); zip_size = buf_block_get_zip_size(block);
page_no = page_get_page_no(page); page_no = page_get_page_no(page);
bitmap_page = ibuf_bitmap_get_map_page( bitmap_page = ibuf_bitmap_get_map_page(
......
...@@ -25,6 +25,7 @@ buf_read_page( ...@@ -25,6 +25,7 @@ buf_read_page(
/* out: number of page read requests issued: this can /* out: number of page read requests issued: this can
be > 1 if read-ahead occurred */ be > 1 if read-ahead occurred */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint offset);/* in: page number */ ulint offset);/* in: page number */
/************************************************************************ /************************************************************************
Applies linear read-ahead if in the buf_pool the page is a border page of Applies linear read-ahead if in the buf_pool the page is a border page of
...@@ -55,6 +56,7 @@ buf_read_ahead_linear( ...@@ -55,6 +56,7 @@ buf_read_ahead_linear(
/*==================*/ /*==================*/
/* out: number of page read requests issued */ /* out: number of page read requests issued */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint offset);/* in: page number of a page; NOTE: the current thread ulint offset);/* in: page number of a page; NOTE: the current thread
must want access to this page (see NOTE 3 above) */ must want access to this page (see NOTE 3 above) */
/************************************************************************ /************************************************************************
...@@ -90,13 +92,20 @@ Issues read requests for pages which recovery wants to read in. */ ...@@ -90,13 +92,20 @@ Issues read requests for pages which recovery wants to read in. */
void void
buf_read_recv_pages( buf_read_recv_pages(
/*================*/ /*================*/
ibool sync, /* in: TRUE if the caller wants this function ibool sync, /* in: TRUE if the caller
to wait for the highest address page to get wants this function to wait
read in, before this function returns */ for the highest address page
ulint space, /* in: space id */ to get read in, before this
ulint* page_nos, /* in: array of page numbers to read, with the function returns */
highest page number the last in the array */ ulint space, /* in: space id */
ulint n_stored); /* in: number of page numbers in the array */ ulint zip_size, /* in: compressed page size in
bytes, or 0 */
const ulint* page_nos, /* in: array of page numbers
to read, with the highest page
number the last in the
array */
ulint n_stored); /* in: number of page numbers
in the array */
/* The size in pages of the area which the read-ahead algorithms read if /* The size in pages of the area which the read-ahead algorithms read if
invoked */ invoked */
......
...@@ -153,6 +153,7 @@ ibuf_page( ...@@ -153,6 +153,7 @@ ibuf_page(
/*======*/ /*======*/
/* out: TRUE if level 2 or level 3 page */ /* out: TRUE if level 2 or level 3 page */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no);/* in: page number */ ulint page_no);/* in: page number */
/*************************************************************************** /***************************************************************************
Checks if a page is a level 2 or 3 page in the ibuf hierarchy of pages. */ Checks if a page is a level 2 or 3 page in the ibuf hierarchy of pages. */
...@@ -162,6 +163,7 @@ ibuf_page_low( ...@@ -162,6 +163,7 @@ ibuf_page_low(
/*==========*/ /*==========*/
/* out: TRUE if level 2 or level 3 page */ /* out: TRUE if level 2 or level 3 page */
ulint space, /* in: space id */ ulint space, /* in: space id */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no,/* in: page number */ ulint page_no,/* in: page number */
mtr_t* mtr); /* in: mtr which will contain an x-latch to the mtr_t* mtr); /* in: mtr which will contain an x-latch to the
bitmap page if the page is not one of the fixed bitmap page if the page is not one of the fixed
...@@ -174,7 +176,8 @@ file segment, and the thread did not own the fsp latch before this call. */ ...@@ -174,7 +176,8 @@ file segment, and the thread did not own the fsp latch before this call. */
void void
ibuf_free_excess_pages( ibuf_free_excess_pages(
/*===================*/ /*===================*/
ulint space); /* in: space id */ ulint space, /* in: space id */
ulint zip_size); /* in: compressed page size in bytes, or 0 */
/************************************************************************* /*************************************************************************
Makes an index insert to the insert buffer, instead of directly to the disk Makes an index insert to the insert buffer, instead of directly to the disk
page, if this is possible. Does not do insert if the index is clustered page, if this is possible. Does not do insert if the index is clustered
...@@ -187,6 +190,7 @@ ibuf_insert( ...@@ -187,6 +190,7 @@ ibuf_insert(
dtuple_t* entry, /* in: index entry to insert */ dtuple_t* entry, /* in: index entry to insert */
dict_index_t* index, /* in: index where to insert */ dict_index_t* index, /* in: index where to insert */
ulint space, /* in: space id where to insert */ ulint space, /* in: space id where to insert */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no,/* in: page number where to insert */ ulint page_no,/* in: page number where to insert */
que_thr_t* thr); /* in: query thread */ que_thr_t* thr); /* in: query thread */
/************************************************************************* /*************************************************************************
......
...@@ -1359,6 +1359,7 @@ recv_read_in_area( ...@@ -1359,6 +1359,7 @@ recv_read_in_area(
/*==============*/ /*==============*/
/* out: number of pages found */ /* out: number of pages found */
ulint space, /* in: space */ ulint space, /* in: space */
ulint zip_size,/* in: compressed page size in bytes, or 0 */
ulint page_no)/* in: page number */ ulint page_no)/* in: page number */
{ {
recv_addr_t* recv_addr; recv_addr_t* recv_addr;
...@@ -1390,7 +1391,7 @@ recv_read_in_area( ...@@ -1390,7 +1391,7 @@ recv_read_in_area(
} }
} }
buf_read_recv_pages(FALSE, space, page_nos, n); buf_read_recv_pages(FALSE, space, zip_size, page_nos, n);
/* /*
fprintf(stderr, "Recv pages at %lu n %lu\n", page_nos[0], n); fprintf(stderr, "Recv pages at %lu n %lu\n", page_nos[0], n);
*/ */
...@@ -1416,8 +1417,6 @@ recv_apply_hashed_log_recs( ...@@ -1416,8 +1417,6 @@ recv_apply_hashed_log_recs(
{ {
recv_addr_t* recv_addr; recv_addr_t* recv_addr;
ulint i; ulint i;
ulint space;
ulint page_no;
ulint n_pages; ulint n_pages;
ibool has_printed = FALSE; ibool has_printed = FALSE;
mtr_t mtr; mtr_t mtr;
...@@ -1448,8 +1447,9 @@ recv_apply_hashed_log_recs( ...@@ -1448,8 +1447,9 @@ recv_apply_hashed_log_recs(
recv_addr = HASH_GET_FIRST(recv_sys->addr_hash, i); recv_addr = HASH_GET_FIRST(recv_sys->addr_hash, i);
while (recv_addr) { while (recv_addr) {
space = recv_addr->space; ulint space = recv_addr->space;
page_no = recv_addr->page_no; ulint zip_size = fil_space_get_zip_size(space);
ulint page_no = recv_addr->page_no;
if (recv_addr->state == RECV_NOT_PROCESSED) { if (recv_addr->state == RECV_NOT_PROCESSED) {
if (!has_printed) { if (!has_printed) {
...@@ -1478,7 +1478,8 @@ recv_apply_hashed_log_recs( ...@@ -1478,7 +1478,8 @@ recv_apply_hashed_log_recs(
recv_recover_page(FALSE, FALSE, block); recv_recover_page(FALSE, FALSE, block);
mtr_commit(&mtr); mtr_commit(&mtr);
} else { } else {
recv_read_in_area(space, page_no); recv_read_in_area(space, zip_size,
page_no);
} }
mutex_enter(&(recv_sys->mutex)); mutex_enter(&(recv_sys->mutex));
...@@ -1654,9 +1655,7 @@ recv_apply_log_recs_for_backup(void) ...@@ -1654,9 +1655,7 @@ recv_apply_log_recs_for_backup(void)
} }
/* Apply the log records to this page */ /* Apply the log records to this page */
recv_recover_page(TRUE, FALSE, block->frame, recv_recover_page(TRUE, FALSE, block);
recv_addr->space,
recv_addr->page_no);
/* Write the page back to the tablespace file using the /* Write the page back to the tablespace file using the
fil0fil.c routines */ fil0fil.c routines */
......
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