Browse Source

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.
pull/374/head
sunny 18 years ago
parent
commit
eca3cb2378
  1. 9
      btr/btr0cur.c
  2. 7
      ibuf/ibuf0ibuf.c
  3. 3
      include/btr0cur.h
  4. 3
      include/univ.i

9
btr/btr0cur.c

@ -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);
}

7
ibuf/ibuf0ibuf.c

@ -2961,9 +2961,14 @@ dump:
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);

3
include/btr0cur.h

@ -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

3
include/univ.i

@ -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 */

Loading…
Cancel
Save