Commit eca3cb23 authored by sunny's avatar sunny

branches/zip: Fix a bug where the zipped page and the uncompressed page

contents end up with conflicting versions of a record's state. The zipped
page record was not being marked as "(un)deleted" because we were not
passing the zipped page contents to the (un)delete function, which first
(un)delete marks the uncompressed version and then based on whether
page_zip is NULL or not (un)delete marks the record in the compressed page.
parent 1a4db95e
......@@ -2653,13 +2653,16 @@ used by the insert buffer insert merge mechanism. */
void
btr_cur_del_unmark_for_ibuf(
/*========================*/
rec_t* rec, /* in: record to delete unmark */
mtr_t* mtr) /* in: mtr */
rec_t* rec, /* in: record to delete unmark */
page_zip_des_t* page_zip, /* in/out: compressed page corresponding
to rec, or NULL when the tablespace is
uncompressed */
mtr_t* mtr) /* in: mtr */
{
/* We do not need to reserve btr_search_latch, as the page has just
been read to the buffer pool and there cannot be a hash index to it. */
btr_rec_set_deleted_flag(rec, NULL, FALSE);
btr_rec_set_deleted_flag(rec, page_zip, FALSE);
btr_cur_del_mark_set_sec_rec_log(rec, FALSE, mtr);
}
......
......@@ -2961,9 +2961,14 @@ ibuf_insert_to_index_page(
PAGE_CUR_LE, &page_cur);
if (low_match == dtuple_get_n_fields(entry)) {
buf_block_t* block;
page_zip_des_t* page_zip;
rec = page_cur_get_rec(&page_cur);
block = page_cur_get_block(&page_cur);
page_zip = buf_block_get_page_zip(block);
btr_cur_del_unmark_for_ibuf(rec, mtr);
btr_cur_del_unmark_for_ibuf(rec, page_zip, mtr);
} else {
rec = page_cur_tuple_insert(&page_cur, entry, index, 0, mtr);
......
......@@ -319,6 +319,9 @@ void
btr_cur_del_unmark_for_ibuf(
/*========================*/
rec_t* rec, /* in: record to delete unmark */
page_zip_des_t* pg_zip, /* in/out: compressed page corresponding
to rec, or NULL when the tablespace is
uncompressed */
mtr_t* mtr); /* in: mtr */
/*****************************************************************
Tries to compress a page of the tree if it seems useful. It is assumed
......
......@@ -144,6 +144,9 @@ operations (very slow); also UNIV_DEBUG must be defined */
for compressed pages */
#endif
#define UNIV_DEBUG
#define UNIV_ZIP_DEBUG
#define UNIV_BTR_DEBUG /* check B-tree links */
#define UNIV_LIGHT_MEM_DEBUG /* light memory debugging */
......
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