Commit graph

26 commits

Author SHA1 Message Date
marko
441c29e94f branches/zip: Fix some crash recovery bugs.
dict_load_table(): Initialize table->flags with zip_size.

mlog_parse_nbytes(), mlog_parse_string(): Add parameter page_zip and
write the changes also to the compressed page if one is specified.
Assert that these functions are not called on FIL_PAGE_INDEX pages.

buf_page_io_complete(): Replace block->frame with frame where appropriate.

recv_parse_or_apply_log_rec_body(): Add ut_a(!page_zip) where appropriate.

page_parse_delete_rec_list(): Add parameter page_zip.
2006-08-02 05:49:15 +00:00
marko
81fca4d1ea branches/zip: btr_parse_page_reorganize(): Add parameter page_zip. 2006-07-04 21:15:30 +00:00
marko
4e913e2440 branches/zip: Add assertions.
btr_compress(): Invoke page_zip_validate() on the page being compressed.

recv_parse_or_apply_log_rec_body(): Assert that MLOG_WRITE_STRING is
never used on compressed B-tree pages.
2006-06-19 11:08:46 +00:00
marko
be7add3b56 branches/zip: Add parameter zip_size to fil_io().
fil_read(), fil_write(): Make these inlined functions in fil0fil.c.

fil_write_lsn_and_arch_no_to_file(): Remove the parameter space_id and
note that this function is to be called on the system tablespace, which
is uncompressed.
2006-06-15 07:27:13 +00:00
marko
77fa0fd682 branches/zip: Improve some assertions.
recv_parse_or_apply_log_rec_body(): Assert that mlog_parse_nbytes() is
never called on compressed B-tree pages.

page_zip_simple_validate(): Correct a typo in a debug assertion.

xdes_calc_descriptor_page(): Fix an incorrect debug assertion.
2006-06-14 11:19:08 +00:00
marko
5e6324b7e7 branches/zip: Remove some more references to XDES_DESCRIBED_PER_PAGE.
ibuf_parse_bitmap_init(), ibuf_bitmap_page_init(),
ibuf_bitmap_page_get_bits(), ibuf_bitmap_set_bits(),
ibuf_bitmap_page_no_calc(), ibuf_bitmap_get_map_page(),
xdes_calc_descriptor_page(), xdes_calc_descriptor_index(),
fsp_descr_page(): Add parameter zip_size.
2006-06-06 07:42:04 +00:00
marko
00b55da692 branches/zip: Shorten the log record MLOG_ZIP_PAGE_COMPRESS.
page_zip_copy(), page_zip_compress_write_log(): Add parameter 'index'.

page_zip_parse_write_header(): Check for !page_zip only if page != NULL.

page_zip_compress_write_log(), page_zip_parse_compress(): Omit some
fields in the page header.  Omit the unused bytes between the modification
log and the page trailer.

parse_or_apply_log_rec_body(): Remove a bogus debug assertion.
2006-05-16 07:58:10 +00:00
marko
cfc945a954 branches/zip: Merge revisions 465:532 from trunk. 2006-05-08 06:18:59 +00:00
marko
b0ae76c51a branches/zip: Minor cleanup and bug fixes
btr_page_reorganize_low(): Rename new_page to temp_page.

btr_store_big_rec_extern_fields(): FIL_PAGE_TYPE is 2 bytes, not 4.

buf_page_init(), buf_page_create(), buf_read_page_low(),
buf_page_init_for_read(): Add parameter zip_size.

buf_page_init_for_backup_restore(),
recv_apply_log_recs_for_backup(): Enclose in #ifdef UNIV_HOTBACKUP.

Enclose some debug code in #ifdef UNIV_LOG_REPLICATE.

page_zip_write_header_log(): Replace page_zip with a pointer to
the uncompressed page.

page_zip_write_rec(): Relax an assertion about blob_no + n_ext.

page_copy_rec_list_to_created_page_write_log(): Allow logging to be disabled.
2006-04-26 09:35:18 +00:00
marko
121623c1b4 branches/zip: Write the compressed page size to SYS_TABLES.TYPE
and to the file space header (FSP_PAGE_ZIP_SIZE, renamed from
FSP_LOWEST_NO_WRITE).

fil_space_struct: Add zip_size.

dict_table_struct: Embed zip_size in flags.

dict_table_zip_size(): Infer zip_size from table->flags.

dict_sys_tables_get_zip_size(): Read zip_size from SYS_TABLES.TYPE.

fil_space_get_zip_size(): Read zip_size from the file space header.

Add the redo log entry type MLOG_ZIP_FILE_CREATE.
2006-04-25 07:12:32 +00:00
marko
450bbd7c3b branches/zip: Merge revisions 265:459 from trunk. 2006-04-12 09:32:17 +00:00
marko
829229ce73 branches/zip: Add the redo log type MLOG_ZIP_PAGE_COMPRESS. Remove
MLOG_ZIP_LIST_START_COPY and MLOG_ZIP_LIST_END_COPY.

btr_compress(): Simplify a debug assertion.

page_zip_compress_write_log(), page_zip_parse_compress(): New functions.

page_cur_parse_insert_rec(): Simplify the code.

page_parse_create_zip(): Removed.

page_create_zip(), page_copy_rec_list_end(),
page_copy_rec_list_start(): Invoke page_zip_compress_write_log().
2006-04-11 12:27:06 +00:00
marko
64d5043f9e branches/zip: Minor cleanup. Remove MLOG_ZIP_ROOT_RAISE.
btr_page_create(): Remove parameters "prev" and "next".  The pointers
to adjacent B-tree pages will be set in the caller before any user
records are inserted.

Remove the redo log entry type MLOG_ZIP_ROOT_RAISE, since
btr_root_raise_and_insert() will not defer modifications to
the compressed page.

btr_attach_half_pages(): Add parameter new_page_zip.
2006-04-11 09:02:27 +00:00
marko
16dddacb6f branches/zip: Replace the redo log entry types
MLOG_ZIP_COMPRESS and MLOG_ZIP_DECOMPRESS with higher-level entry types.
Implement the logging and crash recovery of MLOG_ZIP_PAGE_CREATE.

page_create_zip(): New function for creating a compressed B-tree page.

page_parse_create_zip(): New function for applying a MLOG_ZIP_PAGE_CREATE
redo log record.

btr_page_create(): Remove the prototype.  Add parameters page_zip, level,
prev, and next.

btr0btr.c: Eliminate page_zip_compress() calls where possible.

page_zip_alloc(), page_zip_compress(), page_zip_decompress(),
page_zip_clear_rec(): Remove parameter mtr.

recv_parse_or_apply_log_rec_body(): Handle MLOG_ZIP_PAGE_CREATE.
Add TODO comments for the other added redo log entry types.
2006-04-10 19:48:37 +00:00
marko
1f8b0f3835 branches/zip: Implement crash recovery of writing BLOB pointers.
page_zip_parse_write_blob_ptr(): New function for applying the redo log
record MLOG_ZIP_WRITE_BLOB_PTR.

page_zip_write_blob_ptr(): Write the necessary information to the redo log.

page0zip.c: Tighten the assertions to ensure that blob_ptr < page_zip->n_blobs.

page_zip_write_node_ptr(): Use memcpy() instead of mach_write_to_4().
2006-04-07 12:56:22 +00:00
marko
817ca61f77 branches/zip: Implement crash recovery of writing to the page header.
page_zip_parse_write_header(): New function for applying the redo log of
MLOG_ZIP_WRITE_HEADER.

page_zip_parse_write_node_ptr(): Mark the log corrupted if !page_zip.
2006-04-07 11:44:14 +00:00
marko
684651ce2e branches/zip: Implement the crash recovery of MLOG_ZIP_WRITE_NODE_PTR.
page_zip_parse_write_node_ptr(): New function to apply a redo log of
MLOG_ZIP_WRITE_NODE_PTR.

page_zip_write_node_ptr(): Write all needed information to the redo log.

page_zip_write_header_log(): Write all necessary information to the redo log.
2006-04-07 11:04:08 +00:00
marko
ee152b828f branches/zip: Note that TRX_ID and ROLL_PTR only exist on B-tree leaf pages
of clustered indexes.  Previously, parts of the code assumed that these
columns would exist on all leaf pages.  Simplify the update-in-place of
these columns.

Add inline function dict_index_is_clust() to replace all tests
index->type & DICT_CLUSTERED.

Remove the redo log entry types MLOG_ZIP_WRITE_TRX_ID and
MLOG_ZIP_WRITE_ROLL_PTR, because the modifications to these columns
are covered by logical logging.

Fuse page_zip_write_trx_id() and page_zip_write_roll_ptr() into
page_zip_write_trx_id_and_roll_ptr().

page_zip_dir_add_slot(), page_zip_available(): Add flag "is_clustered",
so that no space will be reserved for TRX_ID and ROLL_PTR on leaf pages
of secondary indexes.

page_zip_apply_log(): Flag an error when val==0 is encoded with two bytes.

page_zip_write_rec(): Add debug assertions that there is enough space
available for the entry before copying the data bytes of the record.
2006-03-09 17:26:02 +00:00
marko
9a601a1c8b branches/zip: Fix some bugs in incremental compression.
btr_create(): page_zip_compress() returns FALSE on failure.

page_zip_write_header(): Write to page_zip->data[] instead of page_zip[].

buf_flush_init_for_writing(): Add parameter page_zip and set the fields
also in the header of the compressed page.

btr_cur_search_to_nth_level(): Add ut_ad() on page_zip_validate().
2006-03-02 14:05:32 +00:00
marko
82d38b63e3 branches/zip: Merge revisions 236:247 from trunk. 2006-02-27 09:33:26 +00:00
marko
f40121415d branches/zip: Merge revisions 200:236 from trunk. 2006-02-23 19:25:29 +00:00
marko
c04ddfef05 branches/zip: Try to synchronize the updates of uncompressed and
compressed pages.

btr_root_raise_and_insert(): Distinguish root_page_zip and new_page_zip.

btr_cur_set_ownership_of_extern_field(): Do not log the write on the
uncompressed page if it will be logged for page_zip.

lock_rec_insert_check_and_lock(), lock_sec_rec_modify_check_and_lock():
Update the max_trx_id field also on the compressed page.

mlog_write_ulint(): Add UNIV_UNLIKELY hints.  Remove trailing white space.

mlog_log_string(): Remove trailing white space.

rec_set_field_extern_bits(): Remove parameter mtr, as the write will either
occur in the heap, or it will be logged at a higher level.

recv_parse_or_apply_log_rec_body(),
page_zip_write_header(): Add log record type MLOG_ZIP_WRITE_HEADER.

page_header_set_field(): Pass mtr=NULL to page_zip_write_header().

page_header_reset_last_insert(): Pass mtr to page_zip_write_header().

btr_page_set_index_id(), btr_page_set_level(),
btr_page_set_next(), btr_page_set_prev(): Pass mtr to page_zip_write_header().

row_upd_rec_sys_fields(): Pass mtr=NULL to page_zip_write_trx_id() and
page_zip_write_roll_ptr(), since the write will be logged at a higher level.

page_zip_write_header(): Add parameter mtr.
page_zip_write_header_log(): New function.

Remove rec_set_nth_field_extern_bit().
Make rec_set_nth_field_extern_bit_old() static.
Rename rec_set_nth_field_extern_bit_new()
to rec_set_field_extern_bits_new() and make it static.

row_ins_index_entry_low(): Remove bogus TODO comment.
2006-02-22 13:02:40 +00:00
marko
6ce8427cb8 branches/zip: Merge revisions 79:200 from trunk. 2006-02-17 14:19:39 +00:00
marko
062c64e87e branches/zip: Prepare for in-place updates of B-tree node pointers,
BLOB pointers, trx_id, and roll_ptr.

btr_empty(), btr_create(), page_create(): Add parameter "index", as some
index information will be encoded on the compressed page.

Define REC_NODE_PTR_SIZE as 4.

Allow btr_page_reorganize() and btr_page_reorganize_low() to fail.

Define the error code DB_ZIP_OVERFLOW.

Make row_ins_index_entry_low() static.

page0zip: Encode the index, log reorganized records, and store uncompressed
fields separately from the compressed data stream.
2006-02-10 15:06:17 +00:00
marko
88e6d6863d branches/zip:
Initial import of the zip-like compression of B-tree pages.
2005-10-27 11:48:10 +00:00
osku
c307820962 Import 5.0 code. 2005-10-27 07:29:40 +00:00