Commit cef74ef7 authored by marko's avatar marko

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().
parent 92193389
......@@ -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 @@ btr_cur_optimistic_insert(
page_cursor = btr_cur_get_page_cur(cursor);
reorg = FALSE;
/* Now, try the insert */
if (zip_size
......@@ -1163,21 +1161,25 @@ btr_cur_optimistic_insert(
}
}
*rec = page_cur_tuple_insert(page_cursor, entry, index,
ext, n_ext, mtr);
if (UNIV_UNLIKELY(!(*rec))) {
/* If the record did not fit, reorganize */
if (UNIV_UNLIKELY(!btr_page_reorganize(block, index, mtr))) {
ut_a(buf_block_get_page_zip(block));
{
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);
ibuf_reset_free_bits_with_type(index->type, block);
if (UNIV_UNLIKELY(reorg)) {
ut_a(zip_size);
ut_a(*rec);
}
}
goto fail;
if (UNIV_UNLIKELY(!*rec) && !zip_size) {
/* If the record did not fit, reorganize */
if (UNIV_UNLIKELY(!btr_page_reorganize(block, index, mtr))) {
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 @@ btr_cur_optimistic_insert(
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment