mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
branches/zip: Remove the fil_space_get_zip_size() call from
buf_page_get_gen(). This saves one mutex operation per block request. buf_page_get_gen(), various macros and functions: Add parameter zip_size. btr_node_ptr_get_child(): Add parameter index. fil_space_get_latch(): Add optional output parameter zip_size. fil_space_get_zip_size(): Return 0 for space id==0, because the system tablespace is never compressed. fsp_header_init(): Remove the parameter zip_size. ibuf_free_excess_pages(): Remove the parameter zip_size. trx_rseg_t, trx_undo_t: Add field zip_size. xdes_lst_get_next(): Remove, unused.
This commit is contained in:
parent
65f5052455
commit
fff329cd3d
37 changed files with 736 additions and 446 deletions
130
btr/btr0btr.c
130
btr/btr0btr.c
|
@ -89,13 +89,15 @@ btr_root_block_get(
|
|||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint root_page_no;
|
||||
buf_block_t* block;
|
||||
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
root_page_no = dict_index_get_page(index);
|
||||
|
||||
block = btr_block_get(space, root_page_no, RW_X_LATCH, mtr);
|
||||
block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
|
||||
ut_a((ibool)!!page_is_comp(buf_block_get_frame(block))
|
||||
== dict_table_is_comp(index->table));
|
||||
|
||||
|
@ -130,7 +132,6 @@ btr_get_prev_user_rec(
|
|||
page_t* page;
|
||||
page_t* prev_page;
|
||||
ulint prev_page_no;
|
||||
ulint space;
|
||||
|
||||
if (!page_rec_is_infimum(rec)) {
|
||||
|
||||
|
@ -144,14 +145,18 @@ btr_get_prev_user_rec(
|
|||
|
||||
page = page_align(rec);
|
||||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
space = page_get_space_id(page);
|
||||
|
||||
if (prev_page_no != FIL_NULL) {
|
||||
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
buf_block_t* prev_block;
|
||||
|
||||
prev_block = buf_page_get_with_no_latch(space, prev_page_no,
|
||||
mtr);
|
||||
space = page_get_space_id(page);
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
prev_block = buf_page_get_with_no_latch(space, zip_size,
|
||||
prev_page_no, mtr);
|
||||
prev_page = buf_block_get_frame(prev_block);
|
||||
/* The caller must already have a latch to the brother */
|
||||
ut_ad(mtr_memo_contains(mtr, prev_block,
|
||||
|
@ -185,7 +190,6 @@ btr_get_next_user_rec(
|
|||
page_t* page;
|
||||
page_t* next_page;
|
||||
ulint next_page_no;
|
||||
ulint space;
|
||||
|
||||
if (!page_rec_is_supremum(rec)) {
|
||||
|
||||
|
@ -199,13 +203,17 @@ btr_get_next_user_rec(
|
|||
|
||||
page = page_align(rec);
|
||||
next_page_no = btr_page_get_next(page, mtr);
|
||||
space = page_get_space_id(page);
|
||||
|
||||
if (next_page_no != FIL_NULL) {
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
buf_block_t* next_block;
|
||||
|
||||
next_block = buf_page_get_with_no_latch(space, next_page_no,
|
||||
mtr);
|
||||
space = page_get_space_id(page);
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
next_block = buf_page_get_with_no_latch(space, zip_size,
|
||||
next_page_no, mtr);
|
||||
next_page = buf_block_get_frame(next_block);
|
||||
/* The caller must already have a latch to the brother */
|
||||
ut_ad(mtr_memo_contains(mtr, next_block, MTR_MEMO_PAGE_S_FIX)
|
||||
|
@ -275,8 +283,9 @@ btr_page_alloc_for_ibuf(
|
|||
+ PAGE_BTR_IBUF_FREE_LIST, mtr);
|
||||
ut_a(node_addr.page != FIL_NULL);
|
||||
|
||||
new_block = buf_page_get(dict_index_get_space(index), node_addr.page,
|
||||
RW_X_LATCH, mtr);
|
||||
new_block = buf_page_get(dict_index_get_space(index),
|
||||
dict_table_zip_size(index->table),
|
||||
node_addr.page, RW_X_LATCH, mtr);
|
||||
new_page = buf_block_get_frame(new_block);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(new_block, SYNC_TREE_NODE_NEW);
|
||||
|
@ -337,8 +346,9 @@ btr_page_alloc(
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
new_block = buf_page_get(dict_index_get_space(index), new_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
new_block = buf_page_get(dict_index_get_space(index),
|
||||
dict_table_zip_size(index->table),
|
||||
new_page_no, RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(new_block, SYNC_TREE_NODE_NEW);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -517,17 +527,19 @@ btr_node_ptr_get_child(
|
|||
/*===================*/
|
||||
/* out: child page, x-latched */
|
||||
const rec_t* node_ptr,/* in: node pointer */
|
||||
dict_index_t* index, /* in: index */
|
||||
const ulint* offsets,/* in: array returned by rec_get_offsets() */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint page_no;
|
||||
ulint space;
|
||||
|
||||
ut_ad(rec_offs_validate(node_ptr, NULL, offsets));
|
||||
ut_ad(rec_offs_validate(node_ptr, index, offsets));
|
||||
space = page_get_space_id(page_align((rec_t*) node_ptr));
|
||||
page_no = btr_node_ptr_get_child_page_no(node_ptr, offsets);
|
||||
|
||||
return(btr_block_get(space, page_no, RW_X_LATCH, mtr));
|
||||
return(btr_block_get(space, dict_table_zip_size(index->table),
|
||||
page_no, RW_X_LATCH, mtr));
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
|
@ -674,6 +686,8 @@ btr_create(
|
|||
FIL_NULL if did not succeed */
|
||||
ulint type, /* in: type of the index */
|
||||
ulint space, /* in: space where created */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
dulint index_id,/* in: index id */
|
||||
dict_index_t* index, /* in: index */
|
||||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
|
@ -692,7 +706,8 @@ btr_create(
|
|||
if (type & DICT_IBUF) {
|
||||
/* Allocate first the ibuf header page */
|
||||
buf_block_t* ibuf_hdr_block = fseg_create(
|
||||
space, 0, IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
|
||||
space, 0,
|
||||
IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(ibuf_hdr_block, SYNC_TREE_NODE_NEW);
|
||||
|
@ -710,10 +725,11 @@ btr_create(
|
|||
FSP_UP, mtr);
|
||||
ut_ad(page_no == IBUF_TREE_ROOT_PAGE_NO);
|
||||
|
||||
block = buf_page_get(space, page_no, RW_X_LATCH, mtr);
|
||||
block = buf_page_get(space, zip_size, page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
} else {
|
||||
block = fseg_create(space, 0, PAGE_HEADER + PAGE_BTR_SEG_TOP,
|
||||
mtr);
|
||||
block = fseg_create(space, 0,
|
||||
PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
|
||||
}
|
||||
|
||||
if (block == NULL) {
|
||||
|
@ -737,8 +753,8 @@ btr_create(
|
|||
} else {
|
||||
/* It is a non-ibuf tree: create a file segment for leaf
|
||||
pages */
|
||||
fseg_create(space, page_no, PAGE_HEADER + PAGE_BTR_SEG_LEAF,
|
||||
mtr);
|
||||
fseg_create(space, page_no,
|
||||
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr);
|
||||
/* The fseg create acquires a second latch on the page,
|
||||
therefore we must declare it: */
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -790,6 +806,8 @@ void
|
|||
btr_free_but_not_root(
|
||||
/*==================*/
|
||||
ulint space, /* in: space where created */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint root_page_no) /* in: root page number */
|
||||
{
|
||||
ibool finished;
|
||||
|
@ -799,7 +817,7 @@ btr_free_but_not_root(
|
|||
leaf_loop:
|
||||
mtr_start(&mtr);
|
||||
|
||||
root = btr_page_get(space, root_page_no, RW_X_LATCH, &mtr);
|
||||
root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
|
||||
|
||||
/* NOTE: page hash indexes are dropped when a page is freed inside
|
||||
fsp0fsp. */
|
||||
|
@ -815,7 +833,7 @@ leaf_loop:
|
|||
top_loop:
|
||||
mtr_start(&mtr);
|
||||
|
||||
root = btr_page_get(space, root_page_no, RW_X_LATCH, &mtr);
|
||||
root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
|
||||
|
||||
finished = fseg_free_step_not_header(
|
||||
root + PAGE_HEADER + PAGE_BTR_SEG_TOP, &mtr);
|
||||
|
@ -834,6 +852,8 @@ void
|
|||
btr_free_root(
|
||||
/*==========*/
|
||||
ulint space, /* in: space where created */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint root_page_no, /* in: root page number */
|
||||
mtr_t* mtr) /* in: a mini-transaction which has already
|
||||
been started */
|
||||
|
@ -841,7 +861,7 @@ btr_free_root(
|
|||
buf_block_t* block;
|
||||
fseg_header_t* header;
|
||||
|
||||
block = btr_block_get(space, root_page_no, RW_X_LATCH, mtr);
|
||||
block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
|
||||
|
||||
btr_search_drop_page_hash_index(block);
|
||||
|
||||
|
@ -1565,6 +1585,7 @@ btr_attach_half_pages(
|
|||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint prev_page_no;
|
||||
ulint next_page_no;
|
||||
ulint level;
|
||||
|
@ -1640,11 +1661,13 @@ btr_attach_half_pages(
|
|||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
next_page_no = btr_page_get_next(page, mtr);
|
||||
space = buf_block_get_space(block);
|
||||
zip_size = buf_block_get_zip_size(block);
|
||||
|
||||
/* Update page links of the level */
|
||||
|
||||
if (prev_page_no != FIL_NULL) {
|
||||
buf_block_t* prev_block = btr_block_get(space, prev_page_no,
|
||||
buf_block_t* prev_block = btr_block_get(space, zip_size,
|
||||
prev_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(prev_block->frame) == page_is_comp(page));
|
||||
|
@ -1658,7 +1681,8 @@ btr_attach_half_pages(
|
|||
}
|
||||
|
||||
if (next_page_no != FIL_NULL) {
|
||||
buf_block_t* next_block = btr_block_get(space, next_page_no,
|
||||
buf_block_t* next_block = btr_block_get(space, zip_size,
|
||||
next_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(next_block->frame) == page_is_comp(page));
|
||||
|
@ -1993,26 +2017,29 @@ static
|
|||
void
|
||||
btr_level_list_remove(
|
||||
/*==================*/
|
||||
ulint space, /* in: space where removed */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
page_t* page, /* in: page to remove */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint space;
|
||||
ulint prev_page_no;
|
||||
ulint next_page_no;
|
||||
|
||||
ut_ad(page && mtr);
|
||||
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
|
||||
ut_ad(space == page_get_space_id(page));
|
||||
/* Get the previous and next page numbers of page */
|
||||
|
||||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
next_page_no = btr_page_get_next(page, mtr);
|
||||
space = page_get_space_id(page);
|
||||
|
||||
/* Update page links of the level */
|
||||
|
||||
if (prev_page_no != FIL_NULL) {
|
||||
buf_block_t* prev_block
|
||||
= btr_block_get(space, prev_page_no, RW_X_LATCH, mtr);
|
||||
= btr_block_get(space, zip_size, prev_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
page_t* prev_page
|
||||
= buf_block_get_frame(prev_block);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
|
@ -2028,7 +2055,8 @@ btr_level_list_remove(
|
|||
|
||||
if (next_page_no != FIL_NULL) {
|
||||
buf_block_t* next_block
|
||||
= btr_block_get(space, next_page_no, RW_X_LATCH, mtr);
|
||||
= btr_block_get(space, zip_size, next_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
page_t* next_page
|
||||
= buf_block_get_frame(next_block);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
|
@ -2275,6 +2303,7 @@ btr_compress(
|
|||
{
|
||||
dict_index_t* index;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint left_page_no;
|
||||
ulint right_page_no;
|
||||
buf_block_t* merge_block;
|
||||
|
@ -2302,6 +2331,7 @@ btr_compress(
|
|||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
level = btr_page_get_level(page, mtr);
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
|
||||
left_page_no = btr_page_get_prev(page, mtr);
|
||||
right_page_no = btr_page_get_next(page, mtr);
|
||||
|
@ -2322,8 +2352,8 @@ btr_compress(
|
|||
|
||||
if (is_left) {
|
||||
|
||||
merge_block = btr_block_get(space, left_page_no, RW_X_LATCH,
|
||||
mtr);
|
||||
merge_block = btr_block_get(space, zip_size, left_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
merge_page = buf_block_get_frame(merge_block);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(btr_page_get_next(merge_page, mtr)
|
||||
|
@ -2331,8 +2361,8 @@ btr_compress(
|
|||
#endif /* UNIV_BTR_DEBUG */
|
||||
} else if (right_page_no != FIL_NULL) {
|
||||
|
||||
merge_block = btr_block_get(space, right_page_no, RW_X_LATCH,
|
||||
mtr);
|
||||
merge_block = btr_block_get(space, zip_size, right_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
merge_page = buf_block_get_frame(merge_block);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(btr_page_get_prev(merge_page, mtr)
|
||||
|
@ -2411,7 +2441,7 @@ err_exit:
|
|||
btr_search_drop_page_hash_index(block);
|
||||
|
||||
/* Remove the page from the level list */
|
||||
btr_level_list_remove(page, mtr);
|
||||
btr_level_list_remove(space, zip_size, page, mtr);
|
||||
|
||||
btr_node_ptr_delete(index, block, mtr);
|
||||
lock_update_merge_left(merge_block, orig_pred, block);
|
||||
|
@ -2464,7 +2494,7 @@ err_exit:
|
|||
#endif /* UNIV_BTR_DEBUG */
|
||||
|
||||
/* Remove the page from the level list */
|
||||
btr_level_list_remove(page, mtr);
|
||||
btr_level_list_remove(space, zip_size, page, mtr);
|
||||
|
||||
/* Replace the address of the old child node (= page) with the
|
||||
address of the merge page to the right */
|
||||
|
@ -2558,6 +2588,7 @@ btr_discard_page(
|
|||
{
|
||||
dict_index_t* index;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint left_page_no;
|
||||
ulint right_page_no;
|
||||
buf_block_t* merge_block;
|
||||
|
@ -2574,6 +2605,7 @@ btr_discard_page(
|
|||
MTR_MEMO_X_LOCK));
|
||||
ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX));
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
|
||||
/* Decide the page which will inherit the locks */
|
||||
|
||||
|
@ -2581,16 +2613,16 @@ btr_discard_page(
|
|||
right_page_no = btr_page_get_next(buf_block_get_frame(block), mtr);
|
||||
|
||||
if (left_page_no != FIL_NULL) {
|
||||
merge_block = btr_block_get(space, left_page_no, RW_X_LATCH,
|
||||
mtr);
|
||||
merge_block = btr_block_get(space, zip_size, left_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
merge_page = buf_block_get_frame(merge_block);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(btr_page_get_next(merge_page, mtr)
|
||||
== buf_block_get_page_no(block));
|
||||
#endif /* UNIV_BTR_DEBUG */
|
||||
} else if (right_page_no != FIL_NULL) {
|
||||
merge_block = btr_block_get(space, right_page_no, RW_X_LATCH,
|
||||
mtr);
|
||||
merge_block = btr_block_get(space, zip_size, right_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
merge_page = buf_block_get_frame(merge_block);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(btr_page_get_prev(merge_page, mtr)
|
||||
|
@ -2625,7 +2657,7 @@ btr_discard_page(
|
|||
btr_node_ptr_delete(index, block, mtr);
|
||||
|
||||
/* Remove the page from the level list */
|
||||
btr_level_list_remove(page, mtr);
|
||||
btr_level_list_remove(space, zip_size, page, mtr);
|
||||
#ifdef UNIV_ZIP_DEBUG
|
||||
{
|
||||
page_zip_des_t* merge_page_zip
|
||||
|
@ -2740,6 +2772,7 @@ btr_print_recursive(
|
|||
ULINT_UNDEFINED, heap);
|
||||
btr_print_recursive(index,
|
||||
btr_node_ptr_get_child(node_ptr,
|
||||
index,
|
||||
*offsets,
|
||||
&mtr2),
|
||||
width, heap, offsets, &mtr2);
|
||||
|
@ -3041,6 +3074,7 @@ btr_validate_level(
|
|||
ulint level) /* in: level number */
|
||||
{
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
buf_block_t* block;
|
||||
page_t* page;
|
||||
buf_block_t* right_block = 0; /* remove warning */
|
||||
|
@ -3069,11 +3103,14 @@ btr_validate_level(
|
|||
block = btr_root_block_get(index, &mtr);
|
||||
page = buf_block_get_frame(block);
|
||||
|
||||
space = page_get_space_id(page);
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
|
||||
while (level != btr_page_get_level(page, &mtr)) {
|
||||
const rec_t* node_ptr;
|
||||
|
||||
ut_a(space == buf_block_get_space(block));
|
||||
ut_a(space == page_get_space_id(page));
|
||||
#ifdef UNIV_ZIP_DEBUG
|
||||
page_zip = buf_block_get_page_zip(block);
|
||||
ut_a(!page_zip || page_zip_validate(page_zip, page));
|
||||
|
@ -3086,7 +3123,7 @@ btr_validate_level(
|
|||
node_ptr = page_cur_get_rec(&cursor);
|
||||
offsets = rec_get_offsets(node_ptr, index, offsets,
|
||||
ULINT_UNDEFINED, &heap);
|
||||
block = btr_node_ptr_get_child(node_ptr, offsets, &mtr);
|
||||
block = btr_node_ptr_get_child(node_ptr, index, offsets, &mtr);
|
||||
page = buf_block_get_frame(block);
|
||||
}
|
||||
|
||||
|
@ -3134,8 +3171,8 @@ loop:
|
|||
|
||||
if (right_page_no != FIL_NULL) {
|
||||
const rec_t* right_rec;
|
||||
right_block = btr_block_get(space, right_page_no, RW_X_LATCH,
|
||||
&mtr);
|
||||
right_block = btr_block_get(space, zip_size, right_page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
right_page = buf_block_get_frame(right_block);
|
||||
if (UNIV_UNLIKELY(btr_page_get_prev(right_page, &mtr)
|
||||
!= page_get_page_no(page))) {
|
||||
|
@ -3357,7 +3394,8 @@ node_ptr_fails:
|
|||
if (right_page_no != FIL_NULL) {
|
||||
mtr_start(&mtr);
|
||||
|
||||
block = btr_block_get(space, right_page_no, RW_X_LATCH, &mtr);
|
||||
block = btr_block_get(space, zip_size, right_page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
page = buf_block_get_frame(block);
|
||||
|
||||
goto loop;
|
||||
|
|
|
@ -172,6 +172,8 @@ btr_cur_latch_leaves(
|
|||
page_t* page, /* in: leaf page where the search
|
||||
converged */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number of the leaf */
|
||||
ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
|
||||
btr_cur_t* cursor, /* in: cursor */
|
||||
|
@ -188,7 +190,7 @@ btr_cur_latch_leaves(
|
|||
case BTR_SEARCH_LEAF:
|
||||
case BTR_MODIFY_LEAF:
|
||||
mode = latch_mode == BTR_SEARCH_LEAF ? RW_S_LATCH : RW_X_LATCH;
|
||||
get_block = btr_block_get(space, page_no, mode, mtr);
|
||||
get_block = btr_block_get(space, zip_size, page_no, mode, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
|
||||
#endif /* UNIV_BTR_DEBUG */
|
||||
|
@ -199,7 +201,8 @@ btr_cur_latch_leaves(
|
|||
left_page_no = btr_page_get_prev(page, mtr);
|
||||
|
||||
if (left_page_no != FIL_NULL) {
|
||||
get_block = btr_block_get(space, left_page_no,
|
||||
get_block = btr_block_get(space, zip_size,
|
||||
left_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(get_block->frame)
|
||||
|
@ -210,7 +213,8 @@ btr_cur_latch_leaves(
|
|||
get_block->check_index_page_at_flush = TRUE;
|
||||
}
|
||||
|
||||
get_block = btr_block_get(space, page_no, RW_X_LATCH, mtr);
|
||||
get_block = btr_block_get(space, zip_size, page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
|
||||
#endif /* UNIV_BTR_DEBUG */
|
||||
|
@ -219,7 +223,8 @@ btr_cur_latch_leaves(
|
|||
right_page_no = btr_page_get_next(page, mtr);
|
||||
|
||||
if (right_page_no != FIL_NULL) {
|
||||
get_block = btr_block_get(space, right_page_no,
|
||||
get_block = btr_block_get(space, zip_size,
|
||||
right_page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(get_block->frame)
|
||||
|
@ -239,8 +244,8 @@ btr_cur_latch_leaves(
|
|||
left_page_no = btr_page_get_prev(page, mtr);
|
||||
|
||||
if (left_page_no != FIL_NULL) {
|
||||
get_block = btr_block_get(space, left_page_no,
|
||||
mode, mtr);
|
||||
get_block = btr_block_get(space, zip_size,
|
||||
left_page_no, mode, mtr);
|
||||
cursor->left_block = get_block;
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(get_block->frame)
|
||||
|
@ -251,7 +256,7 @@ btr_cur_latch_leaves(
|
|||
get_block->check_index_page_at_flush = TRUE;
|
||||
}
|
||||
|
||||
get_block = btr_block_get(space, page_no, mode, mtr);
|
||||
get_block = btr_block_get(space, zip_size, page_no, mode, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
|
||||
#endif /* UNIV_BTR_DEBUG */
|
||||
|
@ -454,10 +459,13 @@ btr_cur_search_to_nth_level(
|
|||
/* Loop and search until we arrive at the desired level */
|
||||
|
||||
for (;;) {
|
||||
ulint zip_size;
|
||||
buf_block_t* block;
|
||||
retry_page_get:
|
||||
block = buf_page_get_gen(space, page_no, rw_latch, guess,
|
||||
buf_mode,
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
|
||||
block = buf_page_get_gen(space, zip_size, page_no,
|
||||
rw_latch, guess, buf_mode,
|
||||
__FILE__, __LINE__,
|
||||
mtr);
|
||||
if (block == NULL) {
|
||||
|
@ -469,8 +477,7 @@ retry_page_get:
|
|||
ut_ad(cursor->thr);
|
||||
|
||||
if (ibuf_should_try(index, ignore_sec_unique)
|
||||
&& ibuf_insert(tuple, index, space,
|
||||
dict_table_zip_size(index->table),
|
||||
&& ibuf_insert(tuple, index, space, zip_size,
|
||||
page_no, cursor->thr)) {
|
||||
/* Insertion to the insert buffer succeeded */
|
||||
cursor->flag = BTR_CUR_INSERT_TO_IBUF;
|
||||
|
@ -522,7 +529,7 @@ retry_page_get:
|
|||
if (height == 0) {
|
||||
if (rw_latch == RW_NO_LATCH) {
|
||||
|
||||
btr_cur_latch_leaves(page, space,
|
||||
btr_cur_latch_leaves(page, space, zip_size,
|
||||
page_no, latch_mode,
|
||||
cursor, mtr);
|
||||
}
|
||||
|
@ -558,7 +565,7 @@ retry_page_get:
|
|||
|
||||
if (level > 0) {
|
||||
/* x-latch the page */
|
||||
page = btr_page_get(space,
|
||||
page = btr_page_get(space, zip_size,
|
||||
page_no, RW_X_LATCH, mtr);
|
||||
ut_a((ibool)!!page_is_comp(page)
|
||||
== dict_table_is_comp(index->table));
|
||||
|
@ -641,6 +648,7 @@ btr_cur_open_at_index_side(
|
|||
page_cur_t* page_cursor;
|
||||
ulint page_no;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint height;
|
||||
ulint root_height = 0; /* remove warning */
|
||||
rec_t* node_ptr;
|
||||
|
@ -669,6 +677,7 @@ btr_cur_open_at_index_side(
|
|||
cursor->index = index;
|
||||
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
page_no = dict_index_get_page(index);
|
||||
|
||||
height = ULINT_UNDEFINED;
|
||||
|
@ -676,8 +685,8 @@ btr_cur_open_at_index_side(
|
|||
for (;;) {
|
||||
buf_block_t* block;
|
||||
page_t* page;
|
||||
block = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL,
|
||||
BUF_GET,
|
||||
block = buf_page_get_gen(space, zip_size, page_no,
|
||||
RW_NO_LATCH, NULL, BUF_GET,
|
||||
__FILE__, __LINE__,
|
||||
mtr);
|
||||
page = buf_block_get_frame(block);
|
||||
|
@ -694,7 +703,7 @@ btr_cur_open_at_index_side(
|
|||
}
|
||||
|
||||
if (height == 0) {
|
||||
btr_cur_latch_leaves(page, space, page_no,
|
||||
btr_cur_latch_leaves(page, space, zip_size, page_no,
|
||||
latch_mode, cursor, mtr);
|
||||
|
||||
/* In versions <= 3.23.52 we had forgotten to
|
||||
|
@ -769,6 +778,7 @@ btr_cur_open_at_rnd_pos(
|
|||
page_cur_t* page_cursor;
|
||||
ulint page_no;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint height;
|
||||
rec_t* node_ptr;
|
||||
mem_heap_t* heap = NULL;
|
||||
|
@ -786,6 +796,7 @@ btr_cur_open_at_rnd_pos(
|
|||
cursor->index = index;
|
||||
|
||||
space = dict_index_get_space(index);
|
||||
zip_size = dict_table_zip_size(index->table);
|
||||
page_no = dict_index_get_page(index);
|
||||
|
||||
height = ULINT_UNDEFINED;
|
||||
|
@ -794,8 +805,8 @@ btr_cur_open_at_rnd_pos(
|
|||
buf_block_t* block;
|
||||
page_t* page;
|
||||
|
||||
block = buf_page_get_gen(space, page_no, RW_NO_LATCH, NULL,
|
||||
BUF_GET,
|
||||
block = buf_page_get_gen(space, zip_size, page_no,
|
||||
RW_NO_LATCH, NULL, BUF_GET,
|
||||
__FILE__, __LINE__,
|
||||
mtr);
|
||||
page = buf_block_get_frame(block);
|
||||
|
@ -809,7 +820,7 @@ btr_cur_open_at_rnd_pos(
|
|||
}
|
||||
|
||||
if (height == 0) {
|
||||
btr_cur_latch_leaves(page, space, page_no,
|
||||
btr_cur_latch_leaves(page, space, zip_size, page_no,
|
||||
latch_mode, cursor, mtr);
|
||||
}
|
||||
|
||||
|
@ -1932,6 +1943,7 @@ btr_cur_pess_upd_restore_supremum(
|
|||
page_t* page;
|
||||
buf_block_t* prev_block;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint prev_page_no;
|
||||
|
||||
page = buf_block_get_frame(block);
|
||||
|
@ -1943,10 +1955,12 @@ btr_cur_pess_upd_restore_supremum(
|
|||
}
|
||||
|
||||
space = buf_block_get_space(block);
|
||||
zip_size = buf_block_get_zip_size(block);
|
||||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
|
||||
ut_ad(prev_page_no != FIL_NULL);
|
||||
prev_block = buf_page_get_with_no_latch(space, prev_page_no, mtr);
|
||||
prev_block = buf_page_get_with_no_latch(space, zip_size,
|
||||
prev_page_no, mtr);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
ut_a(btr_page_get_next(prev_block->frame, mtr)
|
||||
== page_get_page_no(page));
|
||||
|
@ -3597,6 +3611,7 @@ btr_store_big_rec_extern_fields(
|
|||
ulint store_len;
|
||||
ulint page_no;
|
||||
ulint space_id;
|
||||
ulint zip_size;
|
||||
ulint prev_page_no;
|
||||
ulint hint_page_no;
|
||||
ulint i;
|
||||
|
@ -3616,6 +3631,7 @@ btr_store_big_rec_extern_fields(
|
|||
== buf_block_get_zip_size(rec_block));
|
||||
|
||||
space_id = buf_block_get_space(rec_block);
|
||||
zip_size = buf_block_get_zip_size(rec_block);
|
||||
rec_page_no = buf_block_get_page_no(rec_block);
|
||||
|
||||
if (UNIV_LIKELY_NULL(page_zip)) {
|
||||
|
@ -3690,7 +3706,7 @@ btr_store_big_rec_extern_fields(
|
|||
buf_block_t* prev_block;
|
||||
page_t* prev_page;
|
||||
|
||||
prev_block = buf_page_get(space_id,
|
||||
prev_block = buf_page_get(space_id, zip_size,
|
||||
prev_page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -3783,7 +3799,8 @@ btr_store_big_rec_extern_fields(
|
|||
goto next_zip_page;
|
||||
}
|
||||
|
||||
rec_block = buf_page_get(space_id, rec_page_no,
|
||||
rec_block = buf_page_get(space_id, zip_size,
|
||||
rec_page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(rec_block,
|
||||
|
@ -3866,7 +3883,8 @@ next_zip_page:
|
|||
|
||||
extern_len -= store_len;
|
||||
|
||||
rec_block = buf_page_get(space_id, rec_page_no,
|
||||
rec_block = buf_page_get(space_id, zip_size,
|
||||
rec_page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(rec_block,
|
||||
|
@ -3951,6 +3969,8 @@ btr_free_externally_stored_field(
|
|||
{
|
||||
page_t* page;
|
||||
ulint space_id;
|
||||
ulint rec_zip_size = dict_table_zip_size(index->table);
|
||||
ulint ext_zip_size;
|
||||
ulint page_no;
|
||||
ulint next_page_no;
|
||||
mtr_t mtr;
|
||||
|
@ -3972,6 +3992,14 @@ btr_free_externally_stored_field(
|
|||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
space_id = mach_read_from_4(field_ref + BTR_EXTERN_SPACE_ID);
|
||||
|
||||
if (UNIV_UNLIKELY(space_id != dict_index_get_space(index))) {
|
||||
ext_zip_size = fil_space_get_zip_size(space_id);
|
||||
} else {
|
||||
ext_zip_size = rec_zip_size;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
buf_block_t* rec_block;
|
||||
buf_block_t* ext_block;
|
||||
|
@ -3980,14 +4008,13 @@ btr_free_externally_stored_field(
|
|||
|
||||
rec_block = buf_page_get(page_get_space_id(
|
||||
page_align(field_ref)),
|
||||
rec_zip_size,
|
||||
page_get_page_no(
|
||||
page_align(field_ref)),
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(rec_block, SYNC_NO_ORDER_CHECK);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
space_id = mach_read_from_4(field_ref + BTR_EXTERN_SPACE_ID);
|
||||
|
||||
page_no = mach_read_from_4(field_ref + BTR_EXTERN_PAGE_NO);
|
||||
|
||||
if (/* There is no external storage data */
|
||||
|
@ -4006,13 +4033,14 @@ btr_free_externally_stored_field(
|
|||
return;
|
||||
}
|
||||
|
||||
ext_block = buf_page_get(space_id, page_no, RW_X_LATCH, &mtr);
|
||||
ext_block = buf_page_get(space_id, ext_zip_size, page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(ext_block, SYNC_EXTERN_STORAGE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
page = buf_block_get_frame(ext_block);
|
||||
|
||||
if (dict_table_zip_size(index->table)) {
|
||||
if (ext_zip_size) {
|
||||
/* Note that page_zip will be NULL
|
||||
in row_purge_upd_exist_or_extern(). */
|
||||
next_page_no = mach_read_from_4(page + FIL_PAGE_NEXT);
|
||||
|
@ -4179,7 +4207,7 @@ btr_copy_blob_prefix(
|
|||
byte* buf, /* out: the externally stored part of
|
||||
the field, or a prefix of it */
|
||||
ulint len, /* in: length of buf, in bytes */
|
||||
ulint space_id,/* in: space id of the first BLOB page */
|
||||
ulint space_id,/* in: space id of the BLOB pages */
|
||||
ulint page_no,/* in: page number of the first BLOB page */
|
||||
ulint offset) /* in: offset on the first BLOB page */
|
||||
{
|
||||
|
@ -4195,7 +4223,7 @@ btr_copy_blob_prefix(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
block = buf_page_get(space_id, page_no, RW_S_LATCH, &mtr);
|
||||
block = buf_page_get(space_id, 0, page_no, RW_S_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_EXTERN_STORAGE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -4237,7 +4265,7 @@ btr_copy_zblob_prefix(
|
|||
/*==================*/
|
||||
z_stream* d_stream,/* in/out: the decompressing stream */
|
||||
ulint zip_size,/* in: compressed BLOB page size */
|
||||
ulint space_id,/* in: space id of the first BLOB page */
|
||||
ulint space_id,/* in: space id of the BLOB pages */
|
||||
ulint page_no,/* in: page number of the first BLOB page */
|
||||
ulint offset) /* in: offset on the first BLOB page */
|
||||
{
|
||||
|
@ -4255,7 +4283,8 @@ btr_copy_zblob_prefix(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
block = buf_page_get(space_id, page_no, RW_S_LATCH, &mtr);
|
||||
block = buf_page_get(space_id, zip_size, page_no,
|
||||
RW_S_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_EXTERN_STORAGE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
|
|
@ -376,6 +376,7 @@ btr_pcur_move_to_next_page(
|
|||
{
|
||||
ulint next_page_no;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
page_t* page;
|
||||
buf_block_t* next_block;
|
||||
page_t* next_page;
|
||||
|
@ -389,10 +390,11 @@ btr_pcur_move_to_next_page(
|
|||
page = btr_pcur_get_page(cursor);
|
||||
next_page_no = btr_page_get_next(page, mtr);
|
||||
space = buf_block_get_space(btr_pcur_get_block(cursor));
|
||||
zip_size = buf_block_get_zip_size(btr_pcur_get_block(cursor));
|
||||
|
||||
ut_ad(next_page_no != FIL_NULL);
|
||||
|
||||
next_block = btr_block_get(space, next_page_no,
|
||||
next_block = btr_block_get(space, zip_size, next_page_no,
|
||||
cursor->latch_mode, mtr);
|
||||
next_page = buf_block_get_frame(next_block);
|
||||
#ifdef UNIV_BTR_DEBUG
|
||||
|
|
|
@ -1107,6 +1107,8 @@ void
|
|||
btr_search_drop_page_hash_when_freed(
|
||||
/*=================================*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no) /* in: page number */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
@ -1124,7 +1126,7 @@ btr_search_drop_page_hash_when_freed(
|
|||
get here. Therefore we can acquire the s-latch to the page without
|
||||
having to fear a deadlock. */
|
||||
|
||||
block = buf_page_get_gen(space, page_no, RW_S_LATCH, NULL,
|
||||
block = buf_page_get_gen(space, zip_size, page_no, RW_S_LATCH, NULL,
|
||||
BUF_GET_IF_IN_POOL, __FILE__, __LINE__,
|
||||
&mtr);
|
||||
|
||||
|
|
|
@ -1479,6 +1479,8 @@ buf_page_get_gen(
|
|||
/*=============*/
|
||||
/* out: pointer to the block or NULL */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint offset, /* in: page number */
|
||||
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
|
||||
buf_block_t* guess, /* in: guessed block or NULL */
|
||||
|
@ -1493,7 +1495,6 @@ buf_page_get_gen(
|
|||
ulint fix_type;
|
||||
ibool success;
|
||||
ibool must_read;
|
||||
const ulint zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
ut_ad(mtr);
|
||||
ut_ad((rw_latch == RW_S_LATCH)
|
||||
|
@ -1502,6 +1503,7 @@ buf_page_get_gen(
|
|||
ut_ad((mode != BUF_GET_NO_LATCH) || (rw_latch == RW_NO_LATCH));
|
||||
ut_ad((mode == BUF_GET) || (mode == BUF_GET_IF_IN_POOL)
|
||||
|| (mode == BUF_GET_NO_LATCH) || (mode == BUF_GET_NOWAIT));
|
||||
ut_ad(zip_size == fil_space_get_zip_size(space));
|
||||
#ifndef UNIV_LOG_DEBUG
|
||||
ut_ad(!ibuf_inside() || ibuf_page(space, zip_size, offset));
|
||||
#endif
|
||||
|
@ -2322,7 +2324,8 @@ buf_page_create(
|
|||
|
||||
buf_block_free(free_block);
|
||||
|
||||
return(buf_page_get_with_no_latch(space, offset, mtr));
|
||||
return(buf_page_get_with_no_latch(space, zip_size,
|
||||
offset, mtr));
|
||||
}
|
||||
|
||||
/* If we get here, the page was not in buf_pool: init it there */
|
||||
|
|
|
@ -139,8 +139,10 @@ scan_again:
|
|||
/* Note that the following call will acquire
|
||||
an S-latch on the page */
|
||||
|
||||
btr_search_drop_page_hash_when_freed(id,
|
||||
page_no);
|
||||
btr_search_drop_page_hash_when_freed(
|
||||
id,
|
||||
buf_page_get_zip_size(bpage),
|
||||
page_no);
|
||||
goto scan_again;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ dict_hdr_get(
|
|||
buf_block_t* block;
|
||||
dict_hdr_t* header;
|
||||
|
||||
block = buf_page_get(DICT_HDR_SPACE, DICT_HDR_PAGE_NO,
|
||||
block = buf_page_get(DICT_HDR_SPACE, 0, DICT_HDR_PAGE_NO,
|
||||
RW_X_LATCH, mtr);
|
||||
header = DICT_HDR + buf_block_get_frame(block);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -146,7 +146,7 @@ dict_hdr_create(
|
|||
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_TABLES_ID,
|
||||
DICT_HDR_SPACE, 0, DICT_TABLES_ID,
|
||||
srv_sys->dummy_ind1, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
|
@ -156,7 +156,7 @@ dict_hdr_create(
|
|||
mlog_write_ulint(dict_header + DICT_HDR_TABLES, root_page_no,
|
||||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_UNIQUE, DICT_HDR_SPACE,
|
||||
root_page_no = btr_create(DICT_UNIQUE, DICT_HDR_SPACE, 0,
|
||||
DICT_TABLE_IDS_ID,
|
||||
srv_sys->dummy_ind1, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
@ -168,7 +168,7 @@ dict_hdr_create(
|
|||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_COLUMNS_ID,
|
||||
DICT_HDR_SPACE, 0, DICT_COLUMNS_ID,
|
||||
srv_sys->dummy_ind1, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
|
@ -179,7 +179,7 @@ dict_hdr_create(
|
|||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_INDEXES_ID,
|
||||
DICT_HDR_SPACE, 0, DICT_INDEXES_ID,
|
||||
srv_sys->dummy_ind1, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
|
@ -190,7 +190,7 @@ dict_hdr_create(
|
|||
MLOG_4BYTES, mtr);
|
||||
/*--------------------------*/
|
||||
root_page_no = btr_create(DICT_CLUSTERED | DICT_UNIQUE,
|
||||
DICT_HDR_SPACE, DICT_FIELDS_ID,
|
||||
DICT_HDR_SPACE, 0, DICT_FIELDS_ID,
|
||||
srv_sys->dummy_ind1, mtr);
|
||||
if (root_page_no == FIL_NULL) {
|
||||
|
||||
|
|
|
@ -272,8 +272,7 @@ dict_build_table_def_step(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
fsp_header_init(table->space, FIL_IBD_FILE_INITIAL_SIZE,
|
||||
dict_table_zip_size(table), &mtr);
|
||||
fsp_header_init(table->space, FIL_IBD_FILE_INITIAL_SIZE, &mtr);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
} else {
|
||||
|
@ -622,8 +621,9 @@ dict_create_index_tree_step(
|
|||
|
||||
btr_pcur_move_to_next_user_rec(&pcur, &mtr);
|
||||
|
||||
node->page_no = btr_create(index->type, index->space, index->id,
|
||||
index, &mtr);
|
||||
node->page_no = btr_create(index->type, index->space,
|
||||
dict_table_zip_size(index->table),
|
||||
index->id, index, &mtr);
|
||||
/* printf("Created a new index tree in space %lu root page %lu\n",
|
||||
index->space, index->page_no); */
|
||||
|
||||
|
@ -653,6 +653,7 @@ dict_drop_index_tree(
|
|||
{
|
||||
ulint root_page_no;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
const byte* ptr;
|
||||
ulint len;
|
||||
|
||||
|
@ -679,8 +680,9 @@ dict_drop_index_tree(
|
|||
ut_ad(len == 4);
|
||||
|
||||
space = mtr_read_ulint(ptr, MLOG_4BYTES, mtr);
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
if (!fil_tablespace_exists_in_mem(space)) {
|
||||
if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
|
||||
/* It is a single table tablespace and the .ibd file is
|
||||
missing: do nothing */
|
||||
|
||||
|
@ -690,7 +692,7 @@ dict_drop_index_tree(
|
|||
/* We free all the pages but the root page first; this operation
|
||||
may span several mini-transactions */
|
||||
|
||||
btr_free_but_not_root(space, root_page_no);
|
||||
btr_free_but_not_root(space, zip_size, root_page_no);
|
||||
|
||||
/* Then we free the root page in the same mini-transaction where
|
||||
we write FIL_NULL to the appropriate field in the SYS_INDEXES
|
||||
|
@ -698,7 +700,7 @@ dict_drop_index_tree(
|
|||
|
||||
/* printf("Dropping index tree in space %lu root page %lu\n", space,
|
||||
root_page_no); */
|
||||
btr_free_root(space, root_page_no, mtr);
|
||||
btr_free_root(space, zip_size, root_page_no, mtr);
|
||||
|
||||
page_rec_write_index_page_no(rec,
|
||||
DICT_SYS_INDEXES_PAGE_NO_FIELD,
|
||||
|
@ -724,6 +726,7 @@ dict_truncate_index_tree(
|
|||
{
|
||||
ulint root_page_no;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint type;
|
||||
dulint index_id;
|
||||
rec_t* rec;
|
||||
|
@ -759,8 +762,9 @@ dict_truncate_index_tree(
|
|||
ut_ad(len == 4);
|
||||
|
||||
space = mtr_read_ulint(ptr, MLOG_4BYTES, mtr);
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
if (!fil_tablespace_exists_in_mem(space)) {
|
||||
if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) {
|
||||
/* It is a single table tablespace and the .ibd file is
|
||||
missing: do nothing */
|
||||
|
||||
|
@ -782,17 +786,17 @@ dict_truncate_index_tree(
|
|||
/* We free all the pages but the root page first; this operation
|
||||
may span several mini-transactions */
|
||||
|
||||
btr_free_but_not_root(space, root_page_no);
|
||||
btr_free_but_not_root(space, zip_size, root_page_no);
|
||||
|
||||
/* Then we free the root page in the same mini-transaction where
|
||||
we create the b-tree and write its new root page number to the
|
||||
appropriate field in the SYS_INDEXES record: this mini-transaction
|
||||
marks the B-tree totally truncated */
|
||||
|
||||
comp = page_is_comp(btr_page_get(space, root_page_no, RW_X_LATCH,
|
||||
mtr));
|
||||
comp = page_is_comp(btr_page_get(space, zip_size, root_page_no,
|
||||
RW_X_LATCH, mtr));
|
||||
|
||||
btr_free_root(space, root_page_no, mtr);
|
||||
btr_free_root(space, zip_size, root_page_no, mtr);
|
||||
/* We will temporarily write FIL_NULL to the PAGE_NO field
|
||||
in SYS_INDEXES, so that the database will not get into an
|
||||
inconsistent state in case it crashes between the mtr_commit()
|
||||
|
@ -818,7 +822,7 @@ dict_truncate_index_tree(
|
|||
}
|
||||
}
|
||||
|
||||
root_page_no = btr_create(type, space, index_id, index, mtr);
|
||||
root_page_no = btr_create(type, space, zip_size, index_id, index, mtr);
|
||||
if (index) {
|
||||
index->page = root_page_no;
|
||||
} else {
|
||||
|
|
|
@ -389,7 +389,9 @@ rw_lock_t*
|
|||
fil_space_get_latch(
|
||||
/*================*/
|
||||
/* out: latch protecting storage allocation */
|
||||
ulint id) /* in: space id */
|
||||
ulint id, /* in: space id */
|
||||
ulint* zip_size)/* out: compressed page size, or
|
||||
0 for uncompressed tablespaces */
|
||||
{
|
||||
fil_system_t* system = fil_system;
|
||||
fil_space_t* space;
|
||||
|
@ -402,6 +404,10 @@ fil_space_get_latch(
|
|||
|
||||
ut_a(space);
|
||||
|
||||
if (zip_size) {
|
||||
*zip_size = space->zip_size;
|
||||
}
|
||||
|
||||
mutex_exit(&(system->mutex));
|
||||
|
||||
return(&(space->latch));
|
||||
|
@ -1385,6 +1391,10 @@ fil_space_get_zip_size(
|
|||
|
||||
ut_ad(system);
|
||||
|
||||
if (UNIV_UNLIKELY(!id)) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
fil_mutex_enter_and_prepare_for_io(id);
|
||||
|
||||
HASH_SEARCH(hash, system->spaces, id, space, space->id == id);
|
||||
|
|
470
fsp/fsp0fsp.c
470
fsp/fsp0fsp.c
File diff suppressed because it is too large
Load diff
|
@ -81,8 +81,10 @@ flst_add_last(
|
|||
if (last_addr.page == node_addr.page) {
|
||||
last_node = page_align(node) + last_addr.boffset;
|
||||
} else {
|
||||
last_node = fut_get_ptr(space, last_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
ulint zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
last_node = fut_get_ptr(space, zip_size, last_addr,
|
||||
RW_X_LATCH, mtr);
|
||||
}
|
||||
|
||||
flst_insert_after(base, last_node, node, mtr);
|
||||
|
@ -122,7 +124,9 @@ flst_add_first(
|
|||
if (first_addr.page == node_addr.page) {
|
||||
first_node = page_align(node) + first_addr.boffset;
|
||||
} else {
|
||||
first_node = fut_get_ptr(space, first_addr,
|
||||
ulint zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
first_node = fut_get_ptr(space, zip_size, first_addr,
|
||||
RW_X_LATCH, mtr);
|
||||
}
|
||||
|
||||
|
@ -170,7 +174,10 @@ flst_insert_after(
|
|||
|
||||
if (!fil_addr_is_null(node3_addr)) {
|
||||
/* Update prev field of node3 */
|
||||
node3 = fut_get_ptr(space, node3_addr, RW_X_LATCH, mtr);
|
||||
ulint zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
node3 = fut_get_ptr(space, zip_size,
|
||||
node3_addr, RW_X_LATCH, mtr);
|
||||
flst_write_addr(node3 + FLST_PREV, node2_addr, mtr);
|
||||
} else {
|
||||
/* node1 was last in list: update last field in base */
|
||||
|
@ -221,8 +228,10 @@ flst_insert_before(
|
|||
flst_write_addr(node2 + FLST_NEXT, node3_addr, mtr);
|
||||
|
||||
if (!fil_addr_is_null(node1_addr)) {
|
||||
ulint zip_size = fil_space_get_zip_size(space);
|
||||
/* Update next field of node1 */
|
||||
node1 = fut_get_ptr(space, node1_addr, RW_X_LATCH, mtr);
|
||||
node1 = fut_get_ptr(space, zip_size, node1_addr,
|
||||
RW_X_LATCH, mtr);
|
||||
flst_write_addr(node1 + FLST_NEXT, node2_addr, mtr);
|
||||
} else {
|
||||
/* node3 was first in list: update first field in base */
|
||||
|
@ -248,6 +257,7 @@ flst_remove(
|
|||
mtr_t* mtr) /* in: mini-transaction handle */
|
||||
{
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
flst_node_t* node1;
|
||||
fil_addr_t node1_addr;
|
||||
fil_addr_t node2_addr;
|
||||
|
@ -260,6 +270,7 @@ flst_remove(
|
|||
ut_ad(mtr_memo_contains_page(mtr, node2, MTR_MEMO_PAGE_X_FIX));
|
||||
|
||||
buf_ptr_get_fsp_addr(node2, &space, &node2_addr);
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
node1_addr = flst_get_prev_addr(node2, mtr);
|
||||
node3_addr = flst_get_next_addr(node2, mtr);
|
||||
|
@ -272,8 +283,8 @@ flst_remove(
|
|||
|
||||
node1 = page_align(node2) + node1_addr.boffset;
|
||||
} else {
|
||||
node1 = fut_get_ptr(space, node1_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
node1 = fut_get_ptr(space, zip_size,
|
||||
node1_addr, RW_X_LATCH, mtr);
|
||||
}
|
||||
|
||||
ut_ad(node1 != node2);
|
||||
|
@ -291,8 +302,8 @@ flst_remove(
|
|||
|
||||
node3 = page_align(node2) + node3_addr.boffset;
|
||||
} else {
|
||||
node3 = fut_get_ptr(space, node3_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
node3 = fut_get_ptr(space, zip_size,
|
||||
node3_addr, RW_X_LATCH, mtr);
|
||||
}
|
||||
|
||||
ut_ad(node2 != node3);
|
||||
|
@ -347,8 +358,9 @@ flst_cut_end(
|
|||
|
||||
node1 = page_align(node2) + node1_addr.boffset;
|
||||
} else {
|
||||
node1 = fut_get_ptr(space, node1_addr, RW_X_LATCH,
|
||||
mtr);
|
||||
node1 = fut_get_ptr(space,
|
||||
fil_space_get_zip_size(space),
|
||||
node1_addr, RW_X_LATCH, mtr);
|
||||
}
|
||||
|
||||
flst_write_addr(node1 + FLST_NEXT, fil_addr_null, mtr);
|
||||
|
@ -418,6 +430,7 @@ flst_validate(
|
|||
mtr_t* mtr1) /* in: mtr */
|
||||
{
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
const flst_node_t* node;
|
||||
fil_addr_t node_addr;
|
||||
fil_addr_t base_addr;
|
||||
|
@ -437,6 +450,7 @@ flst_validate(
|
|||
|
||||
/* Find out the space id */
|
||||
buf_ptr_get_fsp_addr(base, &space, &base_addr);
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
len = flst_get_len(base, mtr1);
|
||||
node_addr = flst_get_first(base, mtr1);
|
||||
|
@ -444,7 +458,8 @@ flst_validate(
|
|||
for (i = 0; i < len; i++) {
|
||||
mtr_start(&mtr2);
|
||||
|
||||
node = fut_get_ptr(space, node_addr, RW_X_LATCH, &mtr2);
|
||||
node = fut_get_ptr(space, zip_size,
|
||||
node_addr, RW_X_LATCH, &mtr2);
|
||||
node_addr = flst_get_next_addr(node, &mtr2);
|
||||
|
||||
mtr_commit(&mtr2); /* Commit mtr2 each round to prevent buffer
|
||||
|
@ -458,7 +473,8 @@ flst_validate(
|
|||
for (i = 0; i < len; i++) {
|
||||
mtr_start(&mtr2);
|
||||
|
||||
node = fut_get_ptr(space, node_addr, RW_X_LATCH, &mtr2);
|
||||
node = fut_get_ptr(space, zip_size,
|
||||
node_addr, RW_X_LATCH, &mtr2);
|
||||
node_addr = flst_get_prev_addr(node, &mtr2);
|
||||
|
||||
mtr_commit(&mtr2); /* Commit mtr2 each round to prevent buffer
|
||||
|
|
|
@ -281,7 +281,8 @@ ibuf_header_page_get(
|
|||
|
||||
ut_ad(!ibuf_inside());
|
||||
|
||||
block = buf_page_get(space, FSP_IBUF_HEADER_PAGE_NO, RW_X_LATCH, mtr);
|
||||
block = buf_page_get(space, 0, FSP_IBUF_HEADER_PAGE_NO,
|
||||
RW_X_LATCH, mtr);
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_IBUF_HEADER);
|
||||
|
@ -308,7 +309,7 @@ ibuf_tree_root_get(
|
|||
|
||||
mtr_x_lock(dict_index_get_lock(data->index), mtr);
|
||||
|
||||
block = buf_page_get(space, FSP_IBUF_TREE_ROOT_PAGE_NO, RW_X_LATCH,
|
||||
block = buf_page_get(space, 0, FSP_IBUF_TREE_ROOT_PAGE_NO, RW_X_LATCH,
|
||||
mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE);
|
||||
|
@ -482,7 +483,7 @@ ibuf_data_init_for_space(
|
|||
|
||||
mutex_enter(&ibuf_mutex);
|
||||
|
||||
mtr_x_lock(fil_space_get_latch(space), &mtr);
|
||||
mtr_x_lock(fil_space_get_latch(space, NULL), &mtr);
|
||||
|
||||
header_page = ibuf_header_page_get(space, &mtr);
|
||||
|
||||
|
@ -496,7 +497,8 @@ ibuf_data_init_for_space(
|
|||
|
||||
{
|
||||
buf_block_t* block = buf_page_get(
|
||||
space, FSP_IBUF_TREE_ROOT_PAGE_NO, RW_X_LATCH, &mtr);
|
||||
space, 0, FSP_IBUF_TREE_ROOT_PAGE_NO,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -767,7 +769,7 @@ ibuf_bitmap_get_map_page(
|
|||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_page_get(space,
|
||||
block = buf_page_get(space, zip_size,
|
||||
ibuf_bitmap_page_no_calc(zip_size, page_no),
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -1661,12 +1663,11 @@ ibuf_add_free_page(
|
|||
/* out: DB_SUCCESS, or DB_STRONG_FAIL
|
||||
if no space left */
|
||||
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 */
|
||||
{
|
||||
mtr_t mtr;
|
||||
page_t* header_page;
|
||||
ulint zip_size;
|
||||
ulint page_no;
|
||||
page_t* page;
|
||||
page_t* root;
|
||||
|
@ -1678,7 +1679,7 @@ ibuf_add_free_page(
|
|||
|
||||
/* Acquire the fsp latch before the ibuf header, obeying the latching
|
||||
order */
|
||||
mtr_x_lock(fil_space_get_latch(space), &mtr);
|
||||
mtr_x_lock(fil_space_get_latch(space, &zip_size), &mtr);
|
||||
|
||||
header_page = ibuf_header_page_get(space, &mtr);
|
||||
|
||||
|
@ -1703,7 +1704,7 @@ ibuf_add_free_page(
|
|||
|
||||
{
|
||||
buf_block_t* block = buf_page_get(
|
||||
space, page_no, RW_X_LATCH, &mtr);
|
||||
space, 0, page_no, RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -1750,13 +1751,12 @@ void
|
|||
ibuf_remove_free_page(
|
||||
/*==================*/
|
||||
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 */
|
||||
{
|
||||
mtr_t mtr;
|
||||
mtr_t mtr2;
|
||||
page_t* header_page;
|
||||
ulint zip_size;
|
||||
ulint page_no;
|
||||
page_t* page;
|
||||
page_t* root;
|
||||
|
@ -1768,7 +1768,7 @@ ibuf_remove_free_page(
|
|||
|
||||
/* Acquire the fsp latch before the ibuf header, obeying the latching
|
||||
order */
|
||||
mtr_x_lock(fil_space_get_latch(space), &mtr);
|
||||
mtr_x_lock(fil_space_get_latch(space, &zip_size), &mtr);
|
||||
|
||||
header_page = ibuf_header_page_get(space, &mtr);
|
||||
|
||||
|
@ -1832,7 +1832,7 @@ ibuf_remove_free_page(
|
|||
|
||||
{
|
||||
buf_block_t* block = buf_page_get(
|
||||
space, page_no, RW_X_LATCH, &mtr);
|
||||
space, 0, page_no, RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -1874,8 +1874,7 @@ file segment, and the thread did not own the fsp latch before this call. */
|
|||
void
|
||||
ibuf_free_excess_pages(
|
||||
/*===================*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size) /* in: compressed page size in bytes, or 0 */
|
||||
ulint space) /* in: compressed page size in bytes, or 0 */
|
||||
{
|
||||
ibuf_data_t* ibuf_data;
|
||||
ulint i;
|
||||
|
@ -1888,9 +1887,9 @@ ibuf_free_excess_pages(
|
|||
}
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(rw_lock_own(fil_space_get_latch(space), RW_LOCK_EX));
|
||||
ut_ad(rw_lock_own(fil_space_get_latch(space, NULL), RW_LOCK_EX));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
ut_ad(rw_lock_get_x_lock_count(fil_space_get_latch(space)) == 1);
|
||||
ut_ad(rw_lock_get_x_lock_count(fil_space_get_latch(space, NULL)) == 1);
|
||||
ut_ad(!ibuf_inside());
|
||||
|
||||
/* NOTE: We require that the thread did not own the latch before,
|
||||
|
@ -1926,7 +1925,7 @@ ibuf_free_excess_pages(
|
|||
|
||||
mutex_exit(&ibuf_mutex);
|
||||
|
||||
ibuf_remove_free_page(space, zip_size, ibuf_data);
|
||||
ibuf_remove_free_page(space, ibuf_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2392,7 +2391,7 @@ ibuf_get_volume_buffered(
|
|||
|
||||
{
|
||||
buf_block_t* block = buf_page_get(
|
||||
0, prev_page_no, RW_X_LATCH, mtr);
|
||||
0, 0, prev_page_no, RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -2462,7 +2461,7 @@ count_later:
|
|||
|
||||
{
|
||||
buf_block_t* block = buf_page_get(
|
||||
0, next_page_no, RW_X_LATCH, mtr);
|
||||
0, 0, next_page_no, RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TREE_NODE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -2636,7 +2635,7 @@ ibuf_insert_low(
|
|||
|
||||
mutex_exit(&ibuf_pessimistic_insert_mutex);
|
||||
|
||||
err = ibuf_add_free_page(0, zip_size, ibuf_data);
|
||||
err = ibuf_add_free_page(0, ibuf_data);
|
||||
|
||||
if (err == DB_STRONG_FAIL) {
|
||||
|
||||
|
|
|
@ -71,6 +71,8 @@ buf_block_t*
|
|||
btr_block_get(
|
||||
/*==========*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
ulint mode, /* in: latch mode */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
|
@ -81,6 +83,8 @@ page_t*
|
|||
btr_page_get(
|
||||
/*=========*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
ulint mode, /* in: latch mode */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
|
@ -178,6 +182,8 @@ btr_create(
|
|||
FIL_NULL if did not succeed */
|
||||
ulint type, /* in: type of the index */
|
||||
ulint space, /* in: space where created */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
dulint index_id,/* in: index id */
|
||||
dict_index_t* index, /* in: index */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
|
@ -189,6 +195,8 @@ void
|
|||
btr_free_but_not_root(
|
||||
/*==================*/
|
||||
ulint space, /* in: space where created */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint root_page_no); /* in: root page number */
|
||||
/****************************************************************
|
||||
Frees the B-tree root page. Other tree MUST already have been freed. */
|
||||
|
@ -197,6 +205,8 @@ void
|
|||
btr_free_root(
|
||||
/*==========*/
|
||||
ulint space, /* in: space where created */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint root_page_no, /* in: root page number */
|
||||
mtr_t* mtr); /* in: a mini-transaction which has already
|
||||
been started */
|
||||
|
|
|
@ -20,13 +20,15 @@ buf_block_t*
|
|||
btr_block_get(
|
||||
/*==========*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
ulint mode, /* in: latch mode */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_page_get(space, page_no, mode, mtr);
|
||||
block = buf_page_get(space, zip_size, page_no, mode, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
if (mode != RW_NO_LATCH) {
|
||||
|
||||
|
@ -43,11 +45,14 @@ page_t*
|
|||
btr_page_get(
|
||||
/*=========*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
ulint mode, /* in: latch mode */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
return(buf_block_get_frame(btr_block_get(space, page_no, mode, mtr)));
|
||||
return(buf_block_get_frame(btr_block_get(space, zip_size, page_no,
|
||||
mode, mtr)));
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
|
|
|
@ -116,6 +116,8 @@ void
|
|||
btr_search_drop_page_hash_when_freed(
|
||||
/*=================================*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no); /* in: page number */
|
||||
/************************************************************************
|
||||
Updates the page hash index when a single record is inserted on a page. */
|
||||
|
|
|
@ -148,8 +148,8 @@ buf_frame_copy(
|
|||
NOTE! The following macros should be used instead of buf_page_get_gen,
|
||||
to improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed
|
||||
in LA! */
|
||||
#define buf_page_get(SP, OF, LA, MTR) buf_page_get_gen(\
|
||||
SP, OF, LA, NULL,\
|
||||
#define buf_page_get(SP, ZS, OF, LA, MTR) buf_page_get_gen(\
|
||||
SP, ZS, OF, LA, NULL,\
|
||||
BUF_GET, __FILE__, __LINE__, MTR)
|
||||
/******************************************************************
|
||||
Use these macros to bufferfix a page with no latching. Remember not to
|
||||
|
@ -157,14 +157,14 @@ read the contents of the page unless you know it is safe. Do not modify
|
|||
the contents of the page! We have separated this case, because it is
|
||||
error-prone programming not to set a latch, and it should be used
|
||||
with care. */
|
||||
#define buf_page_get_with_no_latch(SP, OF, MTR) buf_page_get_gen(\
|
||||
SP, OF, RW_NO_LATCH, NULL,\
|
||||
#define buf_page_get_with_no_latch(SP, ZS, OF, MTR) buf_page_get_gen(\
|
||||
SP, ZS, OF, RW_NO_LATCH, NULL,\
|
||||
BUF_GET_NO_LATCH, __FILE__, __LINE__, MTR)
|
||||
/******************************************************************
|
||||
NOTE! The following macros should be used instead of buf_page_get_gen, to
|
||||
improve debugging. Only values RW_S_LATCH and RW_X_LATCH are allowed as LA! */
|
||||
#define buf_page_get_nowait(SP, OF, LA, MTR) buf_page_get_gen(\
|
||||
SP, OF, LA, NULL,\
|
||||
#define buf_page_get_nowait(SP, ZS, OF, LA, MTR) buf_page_get_gen(\
|
||||
SP, ZS, OF, LA, NULL,\
|
||||
BUF_GET_NOWAIT, __FILE__, __LINE__, MTR)
|
||||
/******************************************************************
|
||||
NOTE! The following macros should be used instead of
|
||||
|
@ -199,6 +199,8 @@ buf_page_get_release_on_io(
|
|||
/* out: pointer to the block, or NULL
|
||||
if not in buffer buf_pool */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint offset, /* in: offset of the page within space
|
||||
in units of a page */
|
||||
buf_block_t* guess, /* in: guessed frame or NULL */
|
||||
|
@ -228,6 +230,8 @@ buf_page_get_gen(
|
|||
/*=============*/
|
||||
/* out: pointer to the block or NULL */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint offset, /* in: page number */
|
||||
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
|
||||
buf_block_t* guess, /* in: guessed block or NULL */
|
||||
|
|
|
@ -928,6 +928,8 @@ buf_page_get_release_on_io(
|
|||
/* out: pointer to the block, or NULL
|
||||
if not in buffer buf_pool */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint offset, /* in: offset of the page within space
|
||||
in units of a page */
|
||||
buf_block_t* guess, /* in: guessed block or NULL */
|
||||
|
@ -938,7 +940,7 @@ buf_page_get_release_on_io(
|
|||
{
|
||||
buf_block_t* block;
|
||||
|
||||
block = buf_page_get_gen(space, offset, rw_latch, guess,
|
||||
block = buf_page_get_gen(space, zip_size, offset, rw_latch, guess,
|
||||
BUF_GET_IF_IN_POOL,
|
||||
__FILE__, __LINE__,
|
||||
mtr);
|
||||
|
@ -952,7 +954,7 @@ buf_page_get_release_on_io(
|
|||
|
||||
mtr_rollback_to_savepoint(mtr, savepoint);
|
||||
|
||||
buf_page_get(space, offset, RW_S_LATCH, mtr);
|
||||
buf_page_get(space, zip_size, offset, RW_S_LATCH, mtr);
|
||||
|
||||
/* When we get here, the page is in buffer, but we release
|
||||
the latches again down to the savepoint, before returning */
|
||||
|
|
|
@ -145,7 +145,9 @@ rw_lock_t*
|
|||
fil_space_get_latch(
|
||||
/*================*/
|
||||
/* out: latch protecting storage allocation */
|
||||
ulint id); /* in: space id */
|
||||
ulint id, /* in: space id */
|
||||
ulint* zip_size);/* out: compressed page size, or
|
||||
0 for uncompressed tablespaces */
|
||||
/***********************************************************************
|
||||
Returns the type of a file space. */
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ Reads the compressed page size from the first page of a tablespace. */
|
|||
|
||||
ulint
|
||||
fsp_header_get_zip_size(
|
||||
/*=====================*/
|
||||
/*====================*/
|
||||
/* out: compressed page size in bytes,
|
||||
or 0 if uncompressed */
|
||||
const page_t* page); /* in: first page of a tablespace */
|
||||
|
@ -112,7 +112,6 @@ fsp_header_init(
|
|||
/*============*/
|
||||
ulint space, /* in: space id */
|
||||
ulint size, /* in: current size in blocks */
|
||||
ulint zip_size, /* in: compressed page size, or 0 */
|
||||
mtr_t* mtr); /* in: mini-transaction handle */
|
||||
/**************************************************************************
|
||||
Increases the space size field of a space. */
|
||||
|
@ -281,6 +280,8 @@ void
|
|||
fseg_free(
|
||||
/*======*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no,/* in: page number where the segment header is
|
||||
placed */
|
||||
ulint offset);/* in: byte offset of the segment header on that
|
||||
|
|
|
@ -24,6 +24,8 @@ fut_get_ptr(
|
|||
/* out: pointer to a byte in a frame; the file
|
||||
page in the frame is bufferfixed and latched */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
fil_addr_t addr, /* in: file address */
|
||||
ulint rw_latch, /* in: RW_S_LATCH, RW_X_LATCH */
|
||||
mtr_t* mtr); /* in: mtr handle */
|
||||
|
|
|
@ -18,6 +18,8 @@ fut_get_ptr(
|
|||
/* out: pointer to a byte in a frame; the file
|
||||
page in the frame is bufferfixed and latched */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
fil_addr_t addr, /* in: file address */
|
||||
ulint rw_latch, /* in: RW_S_LATCH, RW_X_LATCH */
|
||||
mtr_t* mtr) /* in: mtr handle */
|
||||
|
@ -28,7 +30,7 @@ fut_get_ptr(
|
|||
ut_ad(addr.boffset < UNIV_PAGE_SIZE);
|
||||
ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
|
||||
|
||||
block = buf_page_get(space, addr.page, rw_latch, mtr);
|
||||
block = buf_page_get(space, zip_size, addr.page, rw_latch, mtr);
|
||||
ptr = buf_block_get_frame(block) + addr.boffset;
|
||||
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
|
|
@ -176,8 +176,7 @@ file segment, and the thread did not own the fsp latch before this call. */
|
|||
void
|
||||
ibuf_free_excess_pages(
|
||||
/*===================*/
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size); /* in: compressed page size in bytes, or 0 */
|
||||
ulint space); /* in: space id */
|
||||
/*************************************************************************
|
||||
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
|
||||
|
|
|
@ -22,6 +22,8 @@ trx_rsegf_get(
|
|||
/* out: rollback segment header, page
|
||||
x-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number of the header */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**********************************************************************
|
||||
|
@ -33,6 +35,8 @@ trx_rsegf_get_new(
|
|||
/* out: rollback segment header, page
|
||||
x-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number of the header */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/*******************************************************************
|
||||
|
@ -83,6 +87,8 @@ trx_rseg_header_create(
|
|||
/* out: page number of the created segment,
|
||||
FIL_NULL if fail */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint max_size, /* in: max size in pages */
|
||||
ulint* slot_no, /* out: rseg id == slot number in trx sys */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
|
@ -126,6 +132,8 @@ struct trx_rseg_struct{
|
|||
rseg mutex */
|
||||
ulint space; /* space where the rollback segment is
|
||||
header is placed */
|
||||
ulint zip_size;/* in: compressed page size of space
|
||||
in bytes, or 0 for uncompressed spaces */
|
||||
ulint page_no;/* page number of the rollback segment
|
||||
header */
|
||||
ulint max_size;/* maximum allowed size in pages */
|
||||
|
|
|
@ -17,13 +17,15 @@ trx_rsegf_get(
|
|||
/* out: rollback segment header, page
|
||||
x-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number of the header */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
buf_block_t* block;
|
||||
trx_rsegf_t* header;
|
||||
|
||||
block = buf_page_get(space, page_no, RW_X_LATCH, mtr);
|
||||
block = buf_page_get(space, zip_size, page_no, RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_RSEG_HEADER);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -41,13 +43,15 @@ trx_rsegf_get_new(
|
|||
/* out: rollback segment header, page
|
||||
x-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number of the header */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
buf_block_t* block;
|
||||
trx_rsegf_t* header;
|
||||
|
||||
block = buf_page_get(space, page_no, RW_X_LATCH, mtr);
|
||||
block = buf_page_get(space, zip_size, page_no, RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_RSEG_HEADER_NEW);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
|
|
@ -100,7 +100,8 @@ trx_sysf_get(
|
|||
|
||||
ut_ad(mtr);
|
||||
|
||||
block = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, mtr);
|
||||
block = buf_page_get(TRX_SYS_SPACE, 0, TRX_SYS_PAGE_NO,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TRX_SYS_HEADER);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
|
|
@ -74,6 +74,8 @@ trx_undo_page_get(
|
|||
/*==============*/
|
||||
/* out: pointer to page x-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**********************************************************************
|
||||
|
@ -84,6 +86,8 @@ trx_undo_page_get_s_latched(
|
|||
/*========================*/
|
||||
/* out: pointer to page s-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
mtr_t* mtr); /* in: mtr */
|
||||
/**********************************************************************
|
||||
|
@ -163,6 +167,8 @@ trx_undo_get_first_rec(
|
|||
/* out: undo log record, the page latched, NULL if
|
||||
none */
|
||||
ulint space, /* in: undo log header space */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no,/* in: undo log header page number */
|
||||
ulint offset, /* in: undo log header offset on page */
|
||||
ulint mode, /* in: latching mode: RW_S_LATCH or RW_X_LATCH */
|
||||
|
@ -355,6 +361,8 @@ struct trx_undo_struct{
|
|||
/*-----------------------------*/
|
||||
ulint space; /* space id where the undo log
|
||||
placed */
|
||||
ulint zip_size; /* in: compressed page size of space
|
||||
in bytes, or 0 for uncompressed */
|
||||
ulint hdr_page_no; /* page number of the header page in
|
||||
the undo log */
|
||||
ulint hdr_offset; /* header offset of the undo log on the
|
||||
|
|
|
@ -128,10 +128,13 @@ trx_undo_page_get(
|
|||
/*==============*/
|
||||
/* out: pointer to page x-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
buf_block_t* block = buf_page_get(space, page_no, RW_X_LATCH, mtr);
|
||||
buf_block_t* block = buf_page_get(space, zip_size, page_no,
|
||||
RW_X_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -147,10 +150,13 @@ trx_undo_page_get_s_latched(
|
|||
/*========================*/
|
||||
/* out: pointer to page s-latched */
|
||||
ulint space, /* in: space where placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
buf_block_t* block = buf_page_get(space, page_no, RW_S_LATCH, mtr);
|
||||
buf_block_t* block = buf_page_get(space, zip_size, page_no,
|
||||
RW_S_LATCH, mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
|
|
@ -4292,6 +4292,7 @@ lock_rec_print(
|
|||
{
|
||||
buf_block_t* block;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint page_no;
|
||||
ulint i;
|
||||
mtr_t mtr;
|
||||
|
@ -4306,6 +4307,7 @@ lock_rec_print(
|
|||
ut_a(lock_get_type(lock) == LOCK_REC);
|
||||
|
||||
space = lock->un_member.rec_lock.space;
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
page_no = lock->un_member.rec_lock.page_no;
|
||||
|
||||
fprintf(file, "RECORD LOCKS space id %lu page no %lu n bits %lu ",
|
||||
|
@ -4348,27 +4350,28 @@ lock_rec_print(
|
|||
because we have the kernel mutex and ibuf operations would
|
||||
break the latching order */
|
||||
|
||||
block = buf_page_get_gen(space, page_no, RW_NO_LATCH,
|
||||
block = buf_page_get_gen(space, zip_size, page_no, RW_NO_LATCH,
|
||||
NULL, BUF_GET_IF_IN_POOL,
|
||||
__FILE__, __LINE__, &mtr);
|
||||
if (block) {
|
||||
block = buf_page_get_nowait(space, page_no, RW_S_LATCH, &mtr);
|
||||
block = buf_page_get_nowait(space, zip_size,
|
||||
page_no, RW_S_LATCH, &mtr);
|
||||
|
||||
if (!block) {
|
||||
/* Let us try to get an X-latch. If the current thread
|
||||
is holding an X-latch on the page, we cannot get an
|
||||
S-latch. */
|
||||
|
||||
block = buf_page_get_nowait(space, page_no, RW_X_LATCH,
|
||||
&mtr);
|
||||
block = buf_page_get_nowait(space, zip_size, page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
}
|
||||
}
|
||||
|
||||
if (block) {
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
if (block) {
|
||||
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
}
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
for (i = 0; i < lock_rec_get_n_bits(lock); i++) {
|
||||
|
||||
|
@ -4482,8 +4485,6 @@ lock_print_info_all_transactions(
|
|||
FILE* file) /* in: file where to print */
|
||||
{
|
||||
lock_t* lock;
|
||||
ulint space;
|
||||
ulint page_no;
|
||||
ibool load_page_first = TRUE;
|
||||
ulint nth_trx = 0;
|
||||
ulint nth_lock = 0;
|
||||
|
@ -4590,16 +4591,18 @@ loop:
|
|||
}
|
||||
|
||||
if (lock_get_type(lock) == LOCK_REC) {
|
||||
space = lock->un_member.rec_lock.space;
|
||||
page_no = lock->un_member.rec_lock.page_no;
|
||||
|
||||
if (load_page_first) {
|
||||
ulint space = lock->un_member.rec_lock.space;
|
||||
ulint zip_size= fil_space_get_zip_size(space);
|
||||
ulint page_no = lock->un_member.rec_lock.page_no;
|
||||
|
||||
lock_mutex_exit_kernel();
|
||||
innobase_mysql_end_print_arbitrary_thd();
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
||||
buf_page_get_with_no_latch(space, page_no, &mtr);
|
||||
buf_page_get_with_no_latch(space, zip_size,
|
||||
page_no, &mtr);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
|
||||
|
@ -4835,7 +4838,8 @@ lock_rec_validate_page(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
block = buf_page_get(space, page_no, RW_X_LATCH, &mtr);
|
||||
block = buf_page_get(space, fil_space_get_zip_size(space),
|
||||
page_no, RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
|
|
@ -1469,8 +1469,9 @@ loop:
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
block = buf_page_get(space, page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
block = buf_page_get(
|
||||
space, zip_size, page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(
|
||||
block, SYNC_NO_ORDER_CHECK);
|
||||
|
|
|
@ -445,7 +445,7 @@ skip_secondaries:
|
|||
/* We assume in purge of externally stored fields
|
||||
that the space id of the undo log record is 0! */
|
||||
|
||||
block = buf_page_get(0, page_no, RW_X_LATCH, &mtr);
|
||||
block = buf_page_get(0, 0, page_no, RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
|
|
@ -1415,7 +1415,7 @@ innobase_start_or_create_for_mysql(void)
|
|||
|
||||
if (create_new_db) {
|
||||
mtr_start(&mtr);
|
||||
fsp_header_init(0, sum_of_new_sizes, 0, &mtr);
|
||||
fsp_header_init(0, sum_of_new_sizes, &mtr);
|
||||
|
||||
mtr_commit(&mtr);
|
||||
|
||||
|
|
|
@ -264,7 +264,8 @@ trx_purge_add_update_undo_to_history(
|
|||
ut_ad(mutex_own(&(rseg->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
|
||||
rseg_header = trx_rsegf_get(rseg->space, rseg->zip_size,
|
||||
rseg->page_no, mtr);
|
||||
|
||||
undo_header = undo_page + undo->hdr_offset;
|
||||
seg_header = undo_page + TRX_UNDO_SEG_HDR;
|
||||
|
@ -348,9 +349,11 @@ loop:
|
|||
mtr_start(&mtr);
|
||||
mutex_enter(&(rseg->mutex));
|
||||
|
||||
rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, &mtr);
|
||||
rseg_hdr = trx_rsegf_get(rseg->space, rseg->zip_size,
|
||||
rseg->page_no, &mtr);
|
||||
|
||||
undo_page = trx_undo_page_get(rseg->space, hdr_addr.page, &mtr);
|
||||
undo_page = trx_undo_page_get(rseg->space, rseg->zip_size,
|
||||
hdr_addr.page, &mtr);
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
log_hdr = undo_page + hdr_addr.boffset;
|
||||
|
||||
|
@ -452,7 +455,8 @@ trx_purge_truncate_rseg_history(
|
|||
mtr_start(&mtr);
|
||||
mutex_enter(&(rseg->mutex));
|
||||
|
||||
rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, &mtr);
|
||||
rseg_hdr = trx_rsegf_get(rseg->space, rseg->zip_size,
|
||||
rseg->page_no, &mtr);
|
||||
|
||||
hdr_addr = trx_purge_get_log_from_hist(
|
||||
flst_get_last(rseg_hdr + TRX_RSEG_HISTORY, &mtr));
|
||||
|
@ -466,7 +470,8 @@ loop:
|
|||
return;
|
||||
}
|
||||
|
||||
undo_page = trx_undo_page_get(rseg->space, hdr_addr.page, &mtr);
|
||||
undo_page = trx_undo_page_get(rseg->space, rseg->zip_size,
|
||||
hdr_addr.page, &mtr);
|
||||
|
||||
log_hdr = undo_page + hdr_addr.boffset;
|
||||
|
||||
|
@ -518,7 +523,8 @@ loop:
|
|||
mtr_start(&mtr);
|
||||
mutex_enter(&(rseg->mutex));
|
||||
|
||||
rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, &mtr);
|
||||
rseg_hdr = trx_rsegf_get(rseg->space, rseg->zip_size,
|
||||
rseg->page_no, &mtr);
|
||||
|
||||
hdr_addr = prev_hdr_addr;
|
||||
|
||||
|
@ -624,7 +630,7 @@ trx_purge_rseg_get_next_history_log(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
undo_page = trx_undo_page_get_s_latched(rseg->space,
|
||||
undo_page = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
|
||||
rseg->last_page_no, &mtr);
|
||||
log_hdr = undo_page + rseg->last_offset;
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
|
@ -676,7 +682,7 @@ trx_purge_rseg_get_next_history_log(
|
|||
/* Read the trx number and del marks from the previous log header */
|
||||
mtr_start(&mtr);
|
||||
|
||||
log_hdr = trx_undo_page_get_s_latched(rseg->space,
|
||||
log_hdr = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
|
||||
prev_log_addr.page, &mtr)
|
||||
+ prev_log_addr.boffset;
|
||||
|
||||
|
@ -711,6 +717,7 @@ trx_purge_choose_next_log(void)
|
|||
trx_rseg_t* min_rseg;
|
||||
dulint min_trx_no;
|
||||
ulint space = 0; /* remove warning (??? bug ???) */
|
||||
ulint zip_size = 0;
|
||||
ulint page_no = 0; /* remove warning (??? bug ???) */
|
||||
ulint offset = 0; /* remove warning (??? bug ???) */
|
||||
mtr_t mtr;
|
||||
|
@ -738,6 +745,7 @@ trx_purge_choose_next_log(void)
|
|||
min_rseg = rseg;
|
||||
min_trx_no = rseg->last_trx_no;
|
||||
space = rseg->space;
|
||||
zip_size = rseg->zip_size;
|
||||
ut_a(space == 0); /* We assume in purge of
|
||||
externally stored fields
|
||||
that space id == 0 */
|
||||
|
@ -763,7 +771,7 @@ trx_purge_choose_next_log(void)
|
|||
|
||||
rec = &trx_purge_dummy_rec;
|
||||
} else {
|
||||
rec = trx_undo_get_first_rec(space, page_no, offset,
|
||||
rec = trx_undo_get_first_rec(space, zip_size, page_no, offset,
|
||||
RW_S_LATCH, &mtr);
|
||||
if (rec == NULL) {
|
||||
/* Undo log empty */
|
||||
|
@ -814,6 +822,7 @@ trx_purge_get_next_rec(
|
|||
ulint offset;
|
||||
ulint page_no;
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint type;
|
||||
ulint cmpl_info;
|
||||
mtr_t mtr;
|
||||
|
@ -824,6 +833,7 @@ trx_purge_get_next_rec(
|
|||
ut_ad(purge_sys->next_stored);
|
||||
|
||||
space = purge_sys->rseg->space;
|
||||
zip_size = purge_sys->rseg->zip_size;
|
||||
page_no = purge_sys->page_no;
|
||||
offset = purge_sys->offset;
|
||||
|
||||
|
@ -842,7 +852,8 @@ trx_purge_get_next_rec(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
undo_page = trx_undo_page_get_s_latched(space, page_no, &mtr);
|
||||
undo_page = trx_undo_page_get_s_latched(space, zip_size,
|
||||
page_no, &mtr);
|
||||
rec = undo_page + offset;
|
||||
|
||||
rec2 = rec;
|
||||
|
@ -893,7 +904,8 @@ trx_purge_get_next_rec(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
undo_page = trx_undo_page_get_s_latched(space, page_no, &mtr);
|
||||
undo_page = trx_undo_page_get_s_latched(space, zip_size,
|
||||
page_no, &mtr);
|
||||
|
||||
rec = undo_page + offset;
|
||||
} else {
|
||||
|
|
|
@ -1094,7 +1094,8 @@ trx_undo_report_row_operation(
|
|||
mtr_start(&mtr);
|
||||
|
||||
for (;;) {
|
||||
undo_block = buf_page_get_gen(undo->space, page_no, RW_X_LATCH,
|
||||
undo_block = buf_page_get_gen(undo->space, undo->zip_size,
|
||||
page_no, RW_X_LATCH,
|
||||
undo->guess_block, BUF_GET,
|
||||
__FILE__, __LINE__, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -1203,7 +1204,8 @@ trx_undo_get_undo_rec_low(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
undo_page = trx_undo_page_get_s_latched(rseg->space, page_no, &mtr);
|
||||
undo_page = trx_undo_page_get_s_latched(rseg->space, rseg->zip_size,
|
||||
page_no, &mtr);
|
||||
|
||||
undo_rec = trx_undo_rec_copy(undo_page + offset, heap);
|
||||
|
||||
|
|
|
@ -835,7 +835,7 @@ trx_roll_pop_top_rec(
|
|||
ut_ad(mutex_own(&(trx->undo_mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
undo_page = trx_undo_page_get_s_latched(undo->space,
|
||||
undo_page = trx_undo_page_get_s_latched(undo->space, undo->zip_size,
|
||||
undo->top_page_no, mtr);
|
||||
offset = undo->top_offset;
|
||||
|
||||
|
|
|
@ -49,6 +49,8 @@ trx_rseg_header_create(
|
|||
/* out: page number of the created segment,
|
||||
FIL_NULL if fail */
|
||||
ulint space, /* in: space id */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint max_size, /* in: max size in pages */
|
||||
ulint* slot_no, /* out: rseg id == slot number in trx sys */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
|
@ -63,7 +65,7 @@ trx_rseg_header_create(
|
|||
#ifdef UNIV_SYNC_DEBUG
|
||||
ut_ad(mutex_own(&kernel_mutex));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
ut_ad(mtr_memo_contains(mtr, fil_space_get_latch(space),
|
||||
ut_ad(mtr_memo_contains(mtr, fil_space_get_latch(space, NULL),
|
||||
MTR_MEMO_X_LOCK));
|
||||
sys_header = trx_sysf_get(mtr);
|
||||
|
||||
|
@ -75,7 +77,8 @@ trx_rseg_header_create(
|
|||
}
|
||||
|
||||
/* Allocate a new file segment for the rollback segment */
|
||||
block = fseg_create(space, 0, TRX_RSEG + TRX_RSEG_FSEG_HEADER, mtr);
|
||||
block = fseg_create(space, 0,
|
||||
TRX_RSEG + TRX_RSEG_FSEG_HEADER, mtr);
|
||||
|
||||
if (block == NULL) {
|
||||
/* No space left */
|
||||
|
@ -90,7 +93,7 @@ trx_rseg_header_create(
|
|||
page_no = buf_block_get_page_no(block);
|
||||
|
||||
/* Get the rollback segment file page */
|
||||
rsegf = trx_rsegf_get_new(space, page_no, mtr);
|
||||
rsegf = trx_rsegf_get_new(space, zip_size, page_no, mtr);
|
||||
|
||||
/* Initialize max size field */
|
||||
mlog_write_ulint(rsegf + TRX_RSEG_MAX_SIZE, max_size,
|
||||
|
@ -128,6 +131,8 @@ trx_rseg_mem_create(
|
|||
/* out, own: rollback segment object */
|
||||
ulint id, /* in: rollback segment id */
|
||||
ulint space, /* in: space where the segment placed */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no, /* in: page number of the segment header */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
|
@ -146,6 +151,7 @@ trx_rseg_mem_create(
|
|||
|
||||
rseg->id = id;
|
||||
rseg->space = space;
|
||||
rseg->zip_size = zip_size;
|
||||
rseg->page_no = page_no;
|
||||
|
||||
mutex_create(&rseg->mutex, SYNC_RSEG);
|
||||
|
@ -154,7 +160,7 @@ trx_rseg_mem_create(
|
|||
|
||||
trx_sys_set_nth_rseg(trx_sys, id, rseg);
|
||||
|
||||
rseg_header = trx_rsegf_get_new(space, page_no, mtr);
|
||||
rseg_header = trx_rsegf_get_new(space, zip_size, page_no, mtr);
|
||||
|
||||
rseg->max_size = mtr_read_ulint(rseg_header + TRX_RSEG_MAX_SIZE,
|
||||
MLOG_4BYTES, mtr);
|
||||
|
@ -176,7 +182,8 @@ trx_rseg_mem_create(
|
|||
rseg->last_page_no = node_addr.page;
|
||||
rseg->last_offset = node_addr.boffset;
|
||||
|
||||
undo_log_hdr = trx_undo_page_get(rseg->space, node_addr.page,
|
||||
undo_log_hdr = trx_undo_page_get(rseg->space, rseg->zip_size,
|
||||
node_addr.page,
|
||||
mtr) + node_addr.boffset;
|
||||
|
||||
rseg->last_trx_no = mtr_read_dulint(
|
||||
|
@ -216,9 +223,13 @@ trx_rseg_list_and_array_init(
|
|||
|
||||
trx_sys_set_nth_rseg(trx_sys, i, NULL);
|
||||
} else {
|
||||
ulint zip_size;
|
||||
|
||||
space = trx_sysf_rseg_get_space(sys_header, i, mtr);
|
||||
|
||||
trx_rseg_mem_create(i, space, page_no, mtr);
|
||||
zip_size = space ? fil_space_get_zip_size(space) : 0;
|
||||
|
||||
trx_rseg_mem_create(i, space, zip_size, page_no, mtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -236,13 +247,14 @@ trx_rseg_create(
|
|||
ulint* id, /* out: rseg id */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint zip_size;
|
||||
ulint page_no;
|
||||
trx_rseg_t* rseg;
|
||||
|
||||
mtr_x_lock(fil_space_get_latch(space), mtr);
|
||||
mtr_x_lock(fil_space_get_latch(space, &zip_size), mtr);
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
||||
page_no = trx_rseg_header_create(space, max_size, id, mtr);
|
||||
page_no = trx_rseg_header_create(space, zip_size, max_size, id, mtr);
|
||||
|
||||
if (page_no == FIL_NULL) {
|
||||
|
||||
|
@ -250,7 +262,7 @@ trx_rseg_create(
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
rseg = trx_rseg_mem_create(*id, space, page_no, mtr);
|
||||
rseg = trx_rseg_mem_create(*id, space, zip_size, page_no, mtr);
|
||||
|
||||
mutex_exit(&kernel_mutex);
|
||||
|
||||
|
|
|
@ -136,7 +136,8 @@ trx_sys_mark_upgraded_to_multiple_tablespaces(void)
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
block = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, &mtr);
|
||||
block = buf_page_get(TRX_SYS_SPACE, 0, TRX_SYS_PAGE_NO,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -181,7 +182,8 @@ trx_sys_create_doublewrite_buf(void)
|
|||
start_again:
|
||||
mtr_start(&mtr);
|
||||
|
||||
block = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, &mtr);
|
||||
block = buf_page_get(TRX_SYS_SPACE, 0, TRX_SYS_PAGE_NO,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
@ -268,7 +270,7 @@ start_again:
|
|||
the page position in the tablespace, then the page
|
||||
has not been written to in doublewrite. */
|
||||
|
||||
new_block = buf_page_get(TRX_SYS_SPACE, page_no,
|
||||
new_block = buf_page_get(TRX_SYS_SPACE, 0, page_no,
|
||||
RW_X_LATCH, &mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
buf_block_dbg_add_level(new_block,
|
||||
|
@ -849,7 +851,7 @@ trx_sysf_create(
|
|||
then enter the kernel: we must do it in this order to conform
|
||||
to the latching order rules. */
|
||||
|
||||
mtr_x_lock(fil_space_get_latch(TRX_SYS_SPACE), mtr);
|
||||
mtr_x_lock(fil_space_get_latch(TRX_SYS_SPACE, NULL), mtr);
|
||||
mutex_enter(&kernel_mutex);
|
||||
|
||||
/* Create the trx sys file block in a new allocated file segment */
|
||||
|
@ -897,7 +899,7 @@ trx_sysf_create(
|
|||
+ page - sys_header);
|
||||
|
||||
/* Create the first rollback segment in the SYSTEM tablespace */
|
||||
page_no = trx_rseg_header_create(TRX_SYS_SPACE, ULINT_MAX, &slot_no,
|
||||
page_no = trx_rseg_header_create(TRX_SYS_SPACE, 0, ULINT_MAX, &slot_no,
|
||||
mtr);
|
||||
ut_a(slot_no == TRX_SYS_SYSTEM_RSEG_ID);
|
||||
ut_a(page_no != FIL_NULL);
|
||||
|
|
112
trx/trx0undo.c
112
trx/trx0undo.c
|
@ -138,6 +138,8 @@ trx_undo_get_prev_rec_from_prev_page(
|
|||
ulint offset, /* in: undo log header offset on page */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
ulint prev_page_no;
|
||||
page_t* prev_page;
|
||||
page_t* undo_page;
|
||||
|
@ -153,8 +155,11 @@ trx_undo_get_prev_rec_from_prev_page(
|
|||
return(NULL);
|
||||
}
|
||||
|
||||
prev_page = trx_undo_page_get_s_latched(
|
||||
page_get_space_id(undo_page), prev_page_no, mtr);
|
||||
space = page_get_space_id(undo_page);
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
prev_page = trx_undo_page_get_s_latched(space, zip_size,
|
||||
prev_page_no, mtr);
|
||||
|
||||
return(trx_undo_page_get_last_rec(prev_page, page_no, offset));
|
||||
}
|
||||
|
@ -196,6 +201,9 @@ trx_undo_get_next_rec_from_next_page(
|
|||
/*=================================*/
|
||||
/* out: undo log record, the page latched, NULL if
|
||||
none */
|
||||
ulint space, /* in: undo log header space */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
page_t* undo_page, /* in: undo log page */
|
||||
ulint page_no,/* in: undo log header page number */
|
||||
ulint offset, /* in: undo log header offset on page */
|
||||
|
@ -205,7 +213,6 @@ trx_undo_get_next_rec_from_next_page(
|
|||
trx_ulogf_t* log_hdr;
|
||||
ulint next_page_no;
|
||||
page_t* next_page;
|
||||
ulint space;
|
||||
ulint next;
|
||||
|
||||
if (page_no == page_get_page_no(undo_page)) {
|
||||
|
@ -219,8 +226,6 @@ trx_undo_get_next_rec_from_next_page(
|
|||
}
|
||||
}
|
||||
|
||||
space = page_get_space_id(undo_page);
|
||||
|
||||
next_page_no = flst_get_next_addr(undo_page + TRX_UNDO_PAGE_HDR
|
||||
+ TRX_UNDO_PAGE_NODE, mtr)
|
||||
.page;
|
||||
|
@ -230,11 +235,12 @@ trx_undo_get_next_rec_from_next_page(
|
|||
}
|
||||
|
||||
if (mode == RW_S_LATCH) {
|
||||
next_page = trx_undo_page_get_s_latched(space, next_page_no,
|
||||
mtr);
|
||||
next_page = trx_undo_page_get_s_latched(space, zip_size,
|
||||
next_page_no, mtr);
|
||||
} else {
|
||||
ut_ad(mode == RW_X_LATCH);
|
||||
next_page = trx_undo_page_get(space, next_page_no, mtr);
|
||||
next_page = trx_undo_page_get(space, zip_size,
|
||||
next_page_no, mtr);
|
||||
}
|
||||
|
||||
return(trx_undo_page_get_first_rec(next_page, page_no, offset));
|
||||
|
@ -253,6 +259,8 @@ trx_undo_get_next_rec(
|
|||
ulint offset, /* in: undo log header offset on page */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
ulint space;
|
||||
ulint zip_size;
|
||||
trx_undo_rec_t* next_rec;
|
||||
|
||||
next_rec = trx_undo_page_get_next_rec(rec, page_no, offset);
|
||||
|
@ -261,7 +269,11 @@ trx_undo_get_next_rec(
|
|||
return(next_rec);
|
||||
}
|
||||
|
||||
return(trx_undo_get_next_rec_from_next_page(page_align(rec),
|
||||
space = page_get_space_id(page_align(rec));
|
||||
zip_size = fil_space_get_zip_size(space);
|
||||
|
||||
return(trx_undo_get_next_rec_from_next_page(space, zip_size,
|
||||
page_align(rec),
|
||||
page_no, offset,
|
||||
RW_S_LATCH, mtr));
|
||||
}
|
||||
|
@ -275,6 +287,8 @@ trx_undo_get_first_rec(
|
|||
/* out: undo log record, the page latched, NULL if
|
||||
none */
|
||||
ulint space, /* in: undo log header space */
|
||||
ulint zip_size,/* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint page_no,/* in: undo log header page number */
|
||||
ulint offset, /* in: undo log header offset on page */
|
||||
ulint mode, /* in: latching mode: RW_S_LATCH or RW_X_LATCH */
|
||||
|
@ -284,9 +298,10 @@ trx_undo_get_first_rec(
|
|||
trx_undo_rec_t* rec;
|
||||
|
||||
if (mode == RW_S_LATCH) {
|
||||
undo_page = trx_undo_page_get_s_latched(space, page_no, mtr);
|
||||
undo_page = trx_undo_page_get_s_latched(space, zip_size,
|
||||
page_no, mtr);
|
||||
} else {
|
||||
undo_page = trx_undo_page_get(space, page_no, mtr);
|
||||
undo_page = trx_undo_page_get(space, zip_size, page_no, mtr);
|
||||
}
|
||||
|
||||
rec = trx_undo_page_get_first_rec(undo_page, page_no, offset);
|
||||
|
@ -295,7 +310,8 @@ trx_undo_get_first_rec(
|
|||
return(rec);
|
||||
}
|
||||
|
||||
return(trx_undo_get_next_rec_from_next_page(undo_page, page_no, offset,
|
||||
return(trx_undo_get_next_rec_from_next_page(space, zip_size,
|
||||
undo_page, page_no, offset,
|
||||
mode, mtr));
|
||||
}
|
||||
|
||||
|
@ -851,7 +867,8 @@ trx_undo_add_page(
|
|||
return(FIL_NULL);
|
||||
}
|
||||
|
||||
header_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
|
||||
header_page = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
undo->hdr_page_no, mtr);
|
||||
|
||||
success = fsp_reserve_free_extents(&n_reserved, undo->space, 1,
|
||||
FSP_UNDO, mtr);
|
||||
|
@ -876,7 +893,8 @@ trx_undo_add_page(
|
|||
|
||||
undo->last_page_no = page_no;
|
||||
|
||||
new_page = trx_undo_page_get(undo->space, page_no, mtr);
|
||||
new_page = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
page_no, mtr);
|
||||
|
||||
trx_undo_page_init(new_page, undo->type, mtr);
|
||||
|
||||
|
@ -911,6 +929,7 @@ trx_undo_free_page(
|
|||
fil_addr_t last_addr;
|
||||
trx_rsegf_t* rseg_header;
|
||||
ulint hist_size;
|
||||
ulint zip_size;
|
||||
|
||||
ut_a(hdr_page_no != page_no);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -918,9 +937,11 @@ trx_undo_free_page(
|
|||
ut_ad(mutex_own(&(rseg->mutex)));
|
||||
#endif /* UNIV_SYNC_DEBUG */
|
||||
|
||||
undo_page = trx_undo_page_get(space, page_no, mtr);
|
||||
zip_size = rseg->zip_size;
|
||||
|
||||
header_page = trx_undo_page_get(space, hdr_page_no, mtr);
|
||||
undo_page = trx_undo_page_get(space, zip_size, page_no, mtr);
|
||||
|
||||
header_page = trx_undo_page_get(space, zip_size, hdr_page_no, mtr);
|
||||
|
||||
flst_remove(header_page + TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST,
|
||||
undo_page + TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_NODE, mtr);
|
||||
|
@ -933,7 +954,8 @@ trx_undo_free_page(
|
|||
rseg->curr_size--;
|
||||
|
||||
if (in_history) {
|
||||
rseg_header = trx_rsegf_get(space, rseg->page_no, mtr);
|
||||
rseg_header = trx_rsegf_get(space, zip_size,
|
||||
rseg->page_no, mtr);
|
||||
|
||||
hist_size = mtr_read_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
|
||||
MLOG_4BYTES, mtr);
|
||||
|
@ -982,6 +1004,8 @@ void
|
|||
trx_undo_empty_header_page(
|
||||
/*=======================*/
|
||||
ulint space, /* in: space */
|
||||
ulint zip_size, /* in: compressed page size in bytes
|
||||
or 0 for uncompressed pages */
|
||||
ulint hdr_page_no, /* in: header page number */
|
||||
ulint hdr_offset, /* in: header offset */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
|
@ -990,7 +1014,7 @@ trx_undo_empty_header_page(
|
|||
trx_ulogf_t* log_hdr;
|
||||
ulint end;
|
||||
|
||||
header_page = trx_undo_page_get(space, hdr_page_no, mtr);
|
||||
header_page = trx_undo_page_get(space, zip_size, hdr_page_no, mtr);
|
||||
|
||||
log_hdr = header_page + hdr_offset;
|
||||
|
||||
|
@ -1032,7 +1056,8 @@ trx_undo_truncate_end(
|
|||
|
||||
last_page_no = undo->last_page_no;
|
||||
|
||||
undo_page = trx_undo_page_get(undo->space, last_page_no, &mtr);
|
||||
undo_page = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
last_page_no, &mtr);
|
||||
|
||||
rec = trx_undo_page_get_last_rec(undo_page, undo->hdr_page_no,
|
||||
undo->hdr_offset);
|
||||
|
@ -1109,7 +1134,8 @@ trx_undo_truncate_start(
|
|||
loop:
|
||||
mtr_start(&mtr);
|
||||
|
||||
rec = trx_undo_get_first_rec(space, hdr_page_no, hdr_offset,
|
||||
rec = trx_undo_get_first_rec(space, rseg->zip_size,
|
||||
hdr_page_no, hdr_offset,
|
||||
RW_X_LATCH, &mtr);
|
||||
if (rec == NULL) {
|
||||
/* Already empty */
|
||||
|
@ -1133,7 +1159,8 @@ loop:
|
|||
page_no = page_get_page_no(undo_page);
|
||||
|
||||
if (page_no == hdr_page_no) {
|
||||
trx_undo_empty_header_page(space, hdr_page_no, hdr_offset,
|
||||
trx_undo_empty_header_page(space, rseg->zip_size,
|
||||
hdr_page_no, hdr_offset,
|
||||
&mtr);
|
||||
} else {
|
||||
trx_undo_free_page(rseg, TRUE, space, hdr_page_no,
|
||||
|
@ -1160,10 +1187,9 @@ trx_undo_seg_free(
|
|||
ibool finished;
|
||||
mtr_t mtr;
|
||||
|
||||
finished = FALSE;
|
||||
rseg = undo->rseg;
|
||||
|
||||
while (!finished) {
|
||||
do {
|
||||
|
||||
mtr_start(&mtr);
|
||||
#ifdef UNIV_SYNC_DEBUG
|
||||
|
@ -1171,7 +1197,8 @@ trx_undo_seg_free(
|
|||
#endif /* UNIV_SYNC_DEBUG */
|
||||
mutex_enter(&(rseg->mutex));
|
||||
|
||||
seg_header = trx_undo_page_get(undo->space, undo->hdr_page_no,
|
||||
seg_header = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
undo->hdr_page_no,
|
||||
&mtr) + TRX_UNDO_SEG_HDR;
|
||||
|
||||
file_seg = seg_header + TRX_UNDO_FSEG_HEADER;
|
||||
|
@ -1180,15 +1207,16 @@ trx_undo_seg_free(
|
|||
|
||||
if (finished) {
|
||||
/* Update the rseg header */
|
||||
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no,
|
||||
&mtr);
|
||||
rseg_header = trx_rsegf_get(
|
||||
rseg->space, rseg->zip_size, rseg->page_no,
|
||||
&mtr);
|
||||
trx_rsegf_set_nth_undo(rseg_header, undo->id, FIL_NULL,
|
||||
&mtr);
|
||||
}
|
||||
|
||||
mutex_exit(&(rseg->mutex));
|
||||
mtr_commit(&mtr);
|
||||
}
|
||||
} while (!finished);
|
||||
}
|
||||
|
||||
/*========== UNDO LOG MEMORY COPY INITIALIZATION =====================*/
|
||||
|
@ -1228,7 +1256,8 @@ trx_undo_mem_create_at_db_start(
|
|||
ut_error;
|
||||
}
|
||||
|
||||
undo_page = trx_undo_page_get(rseg->space, page_no, mtr);
|
||||
undo_page = trx_undo_page_get(rseg->space, rseg->zip_size,
|
||||
page_no, mtr);
|
||||
|
||||
page_header = undo_page + TRX_UNDO_PAGE_HDR;
|
||||
|
||||
|
@ -1281,7 +1310,8 @@ trx_undo_mem_create_at_db_start(
|
|||
undo->last_page_no = last_addr.page;
|
||||
undo->top_page_no = last_addr.page;
|
||||
|
||||
last_page = trx_undo_page_get(rseg->space, undo->last_page_no, mtr);
|
||||
last_page = trx_undo_page_get(rseg->space, rseg->zip_size,
|
||||
undo->last_page_no, mtr);
|
||||
|
||||
rec = trx_undo_page_get_last_rec(last_page, page_no, offset);
|
||||
|
||||
|
@ -1341,7 +1371,8 @@ trx_undo_lists_init(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
rseg_header = trx_rsegf_get_new(rseg->space, rseg->page_no, &mtr);
|
||||
rseg_header = trx_rsegf_get_new(rseg->space, rseg->zip_size,
|
||||
rseg->page_no, &mtr);
|
||||
|
||||
for (i = 0; i < TRX_RSEG_N_SLOTS; i++) {
|
||||
page_no = trx_rsegf_get_nth_undo(rseg_header, i, &mtr);
|
||||
|
@ -1362,8 +1393,9 @@ trx_undo_lists_init(
|
|||
|
||||
mtr_start(&mtr);
|
||||
|
||||
rseg_header = trx_rsegf_get(rseg->space,
|
||||
rseg->page_no, &mtr);
|
||||
rseg_header = trx_rsegf_get(
|
||||
rseg->space, rseg->zip_size, rseg->page_no,
|
||||
&mtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1415,6 +1447,7 @@ trx_undo_mem_create(
|
|||
undo->rseg = rseg;
|
||||
|
||||
undo->space = rseg->space;
|
||||
undo->zip_size = rseg->zip_size;
|
||||
undo->hdr_page_no = page_no;
|
||||
undo->hdr_offset = offset;
|
||||
undo->last_page_no = page_no;
|
||||
|
@ -1514,7 +1547,8 @@ trx_undo_create(
|
|||
|
||||
rseg->curr_size++;
|
||||
|
||||
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
|
||||
rseg_header = trx_rsegf_get(rseg->space, rseg->zip_size, rseg->page_no,
|
||||
mtr);
|
||||
|
||||
undo_page = trx_undo_seg_create(rseg, rseg_header, type, &id, mtr);
|
||||
|
||||
|
@ -1597,7 +1631,8 @@ trx_undo_reuse_cached(
|
|||
ut_error;
|
||||
}
|
||||
|
||||
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
|
||||
undo_page = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
undo->hdr_page_no, mtr);
|
||||
|
||||
if (type == TRX_UNDO_INSERT) {
|
||||
offset = trx_undo_insert_header_reuse(undo_page, trx_id, mtr);
|
||||
|
@ -1639,7 +1674,8 @@ trx_undo_mark_as_dict_operation(
|
|||
|
||||
ut_a(trx->dict_operation);
|
||||
|
||||
hdr_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
|
||||
hdr_page = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
undo->hdr_page_no, mtr);
|
||||
|
||||
mlog_write_ulint(hdr_page + undo->hdr_offset
|
||||
+ TRX_UNDO_DICT_TRANS,
|
||||
|
@ -1745,7 +1781,8 @@ trx_undo_set_state_at_finish(
|
|||
ut_error;
|
||||
}
|
||||
|
||||
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
|
||||
undo_page = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
undo->hdr_page_no, mtr);
|
||||
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
||||
|
@ -1795,7 +1832,8 @@ trx_undo_set_state_at_prepare(
|
|||
ut_error;
|
||||
}
|
||||
|
||||
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
|
||||
undo_page = trx_undo_page_get(undo->space, undo->zip_size,
|
||||
undo->hdr_page_no, mtr);
|
||||
|
||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
||||
|
|
Loading…
Add table
Reference in a new issue