mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
branches/zip: Fix bugs related to the insert buffering of
compressed tablespaces. btr_page_reorganize_low(): Recompute the insert buffer free bits for compressed pages belonging to a non-clustered index. btr_cur_optimistic_insert(): Determine if the page was reorganized by page_cur_tuple_insert(). Do not attempt to reorganize compressed pages, because that will be attempted by page_cur_tuple_insert().
This commit is contained in:
parent
df5da79d26
commit
3e463b8bc0
2 changed files with 23 additions and 18 deletions
|
@ -973,6 +973,14 @@ btr_page_reorganize_low(
|
|||
success = TRUE;
|
||||
}
|
||||
|
||||
/* On compressed pages, recompute the insert buffer free bits. */
|
||||
if (UNIV_LIKELY_NULL(page_zip) && !dict_index_is_clust(index)) {
|
||||
|
||||
ibuf_update_free_bits_if_full(
|
||||
index, page_zip_get_size(page_zip), block,
|
||||
UNIV_PAGE_SIZE, ULINT_UNDEFINED);
|
||||
}
|
||||
|
||||
func_exit:
|
||||
#ifdef UNIV_ZIP_DEBUG
|
||||
ut_a(!page_zip || page_zip_validate(page_zip, page));
|
||||
|
|
|
@ -1146,8 +1146,6 @@ fail_err:
|
|||
|
||||
page_cursor = btr_cur_get_page_cur(cursor);
|
||||
|
||||
reorg = FALSE;
|
||||
|
||||
/* Now, try the insert */
|
||||
|
||||
if (zip_size
|
||||
|
@ -1163,21 +1161,25 @@ fail_err:
|
|||
}
|
||||
}
|
||||
|
||||
*rec = page_cur_tuple_insert(page_cursor, entry, index,
|
||||
ext, n_ext, mtr);
|
||||
if (UNIV_UNLIKELY(!(*rec))) {
|
||||
{
|
||||
const rec_t* page_cursor_rec = page_cur_get_rec(page_cursor);
|
||||
*rec = page_cur_tuple_insert(page_cursor, entry, index,
|
||||
ext, n_ext, mtr);
|
||||
reorg = page_cursor_rec != page_cur_get_rec(page_cursor);
|
||||
|
||||
if (UNIV_UNLIKELY(reorg)) {
|
||||
ut_a(zip_size);
|
||||
ut_a(*rec);
|
||||
}
|
||||
}
|
||||
|
||||
if (UNIV_UNLIKELY(!*rec) && !zip_size) {
|
||||
/* If the record did not fit, reorganize */
|
||||
if (UNIV_UNLIKELY(!btr_page_reorganize(block, index, mtr))) {
|
||||
ut_a(buf_block_get_page_zip(block));
|
||||
|
||||
ibuf_reset_free_bits_with_type(index->type, block);
|
||||
|
||||
goto fail;
|
||||
ut_error;
|
||||
}
|
||||
|
||||
ut_ad(page_get_max_insert_size(page, 1) <= max_size);
|
||||
ut_ad(zip_size
|
||||
|| page_get_max_insert_size(page, 1) == max_size);
|
||||
ut_ad(page_get_max_insert_size(page, 1) == max_size);
|
||||
|
||||
reorg = TRUE;
|
||||
|
||||
|
@ -1187,11 +1189,6 @@ fail_err:
|
|||
ext, n_ext, mtr);
|
||||
|
||||
if (UNIV_UNLIKELY(!*rec)) {
|
||||
if (UNIV_LIKELY(buf_block_get_page_zip(block) != 0)) {
|
||||
|
||||
goto fail;
|
||||
}
|
||||
|
||||
fputs("InnoDB: Error: cannot insert tuple ", stderr);
|
||||
dtuple_print(stderr, entry);
|
||||
fputs(" into ", stderr);
|
||||
|
|
Loading…
Add table
Reference in a new issue