Commit graph

63 commits

Author SHA1 Message Date
marko
c97402bc68 branches/zip: buf_flush_write_block_low(): When flushing a compressed page
that also exists in uncompressed form in the buffer pool, pass the
compressed frame to fil_io() instead of the uncompressed one when
not using the doublewrite buffer.
2007-01-16 22:19:29 +00:00
marko
b76c8a5a8d branches/zip: buf_flush_write_block_low(): Avoid recomputing the compressed
page checksum of compressed-only blocks.  Pass the compressed page frame
to fil_io() when needed.

page_zip_calc_checksum(): Skip also FIL_PAGE_LSN and FIL_PAGE_FILE_FLUSH_LSN.

buf_flush_init_for_writing(): Expect page to be non-NULL.
2007-01-16 21:51:40 +00:00
marko
361fe1a5b9 branches/zip: Allow dirty compressed-only blocks to exist in the buffer pool
and to be flushed to disk.

buf_LRU_free_block(): Enable the freeing of uncompressed pages of
compressed tablespaces.

trx_doublewrite->buf_block_arr[]: Change the type from buf_block_t*
to buf_page_t*.

buf_flush_ready_for_flush(): Add debug assertion.

buf_flush_buffered_writes(), buf_flush_try_page(): Support blocks of type
BUF_BLOCK_ZIP_DIRTY.

buf_flush_post_to_doublewrite_buf(), buf_flush_write_block_low():
Change the type of the parameter from buf_block_t* to buf_page_t*.

buf_flush_init_for_writing(): Allow page to be NULL if page_zip_ is non-NULL.
2007-01-16 18:02:49 +00:00
marko
fb8b8e6d5c branches/zip: buf_flush_remove(): buf_page_get_mutex(bpage) must have been
acquired by the caller.

buf_LRU_invalidate_tablespace(): Do not leak buf_pool->zip_mutex when
rescanning the LRU list.
2007-01-16 14:37:40 +00:00
marko
46ea62d586 branches/zip: Replace an ut_a() with ut_d(). This mistake was made in r1188. 2007-01-09 12:56:12 +00:00
marko
8af159117e branches/zip: buf_page_t: Introduce the field in_flush_list #ifdef UNIV_DEBUG.
buf_flush_batch(): Remove the local variable "found".
2007-01-09 12:35:42 +00:00
marko
903ecf377c buf_flush_validate_low(): Minor cleanup. 2007-01-03 15:55:36 +00:00
marko
a687ccdf74 branches/zip: Minor improvements.
buf_LRU_block_remove_hashed_page(): Return the new state of the block.

Only call buf_LRU_block_free_hashed_page()
if buf_LRU_block_remove_hashed_page() did not return BUF_BLOCK_ZIP_FREE,
that is, the control block was not freed.

buf_LRU_insert_zip_clean(): New function, for inserting a compressed-only
block into buf_pool->zip_clean in the LRU order.

buf_LRU_block_remove_hashed_page(), buf_LRU_free_block():
Add the flag "zip" for controlling if the compressed page of an uncompressed
page should be removed.  For now, assume zip==TRUE.

buf_LRU_get_free_block(): Replace the test for UT_LIST_GET_LEN(buf_pool->free)
with a test for the return value of buf_LRU_get_free_only().  Do not
free zip.data, as it must already have been freed.

buf_flush_insert_into_flush_list(), buf_flush_insert_sorted_into_flush_list():
Remove compressed-only blocks from the buf_pool->zip_clean list.

buf_flush_remove(): Restore compressed-only blocks to
the buf_pool->zip_clean list.

buf_page_init_for_read(): Uncompress compressed-only blocks when possible.
Currently, there cannot be any compressed-only blocks in the buffer pool;
they would be inserted by buf_LRU_free_block(bpage, zip=FALSE).
2006-12-15 15:05:18 +00:00
marko
b6711d691e branches/zip: Minor improvements.
buf_flush_remove(): New function, for removing a block from the flush list.
Sliced from buf_flush_write_complete().

buf_page_set_state(): Allow transitions between BUF_BLOCK_ZIP_PAGE
and BUF_BLOCK_ZIP_DIRTY.
2006-12-15 14:47:04 +00:00
marko
bae7010964 branches/zip: buf_page_t: Rename free_or_flush_list to list
and document the possible list memberships.
2006-12-05 12:31:38 +00:00
marko
cbfc6cce6e branches/zip: Remove buf_block_t:free_list. Rename buf_page_t:flush_list
to free_or_flush_list.  The list node pointers can be shared, because a
block can never be belong to both lists at the same time.
2006-12-04 12:44:06 +00:00
marko
6a7be34b6b branches/zip: Allow some functions to work on compressed-only pages
(state == BUF_BLOCK_ZIP_PAGE).  Make use of buf_page_in_file()
and buf_page_get_mutex().

buf_block_get_newest_modification(): Rename to
buf_page_get_newest_modification().
2006-11-30 15:09:33 +00:00
marko
ac694c106a branches/zip: Move the fields related to the least-recently-used algorithm
of the buffer pool from buf_block_t to buf_page_t.  Replace some buf_block_t*
parameters with buf_page_t*.  Add accessor functions.
2006-11-30 12:27:49 +00:00
marko
5e9d893508 branches/zip: Replace ib_ulonglong with ib_uint64_t, since we want exactly
64 bits.  "long long" might be longer than 64 bits on some systems.
2006-11-29 14:52:16 +00:00
marko
3fe8f14c20 branches/zip: Make buf_pool->page_hash point to buf_page_t instead of
buf_block_t.  Move the fields "hash" and "file_page_was_freed" from
buf_block_t to buf_page_t.

buf_page_in_file(): New function, for checking block state in assertions.
2006-11-29 13:23:28 +00:00
marko
7d1227c32b branches/zip: Allow the code to compile with debugging enabled. This
was broken in r1066.
2006-11-28 11:08:33 +00:00
marko
b239ac283b branches/zip: Move the page flushing fields from buf_block_t to
buf_page_t and page_zip_des_t.
2006-11-27 14:12:09 +00:00
marko
82dfd0f6c7 branches/zip: page_zip_des_t: Rename "size" to "ssize" and reduce the
storage size from 16 to 3 bits.

page_zip_get_size(), page_zip_set_size(): New functions.

Replace direct references to page_zip_des_t:size with calls to
buf_block_get_zip_size(), page_zip_get_size(), and page_zip_set_size().
2006-11-27 13:44:32 +00:00
marko
109570b94a branches/zip: Introduce the unsigned 64-bit data type ib_ulonglong
for log sequence numbers, to replace dulint.
2006-11-24 13:05:01 +00:00
marko
3f4b80c5bd branches/zip: Replace all references to block->space and block->offset,
which should have been replaced in r1057.
2006-11-24 12:49:59 +00:00
marko
dccaa03753 branches/zip: Introduce buf_page_t, a common structure for compressed-only
and uncompressed buffer pool pages.

buf_block_t: Replace page_zip, space, and offset with buf_page_t page.
Replace some integers with bit-fields.

enum buf_block_state: Rename to buf_page_state.  Add BUF_BLOCK_ZIP_PAGE.

page_zip_des_t: Add the field "state".  Make the integer fields bit-fields.

page_zip_copy(): Document which fields are copied.
2006-11-24 08:32:18 +00:00
marko
816089073b branches/zip: Replace most references to block->state, block->offset,
and block->space with buf_block_get_state(block), buf_block_get_page_no(block),
and buf_block_get_space(block).

enum buf_block_state: Replaces the #define'd buf_block_t.state values.

buf_block_get_state(): New function.

buf_block_get_frame(): Add __attribute__((const)).
2006-11-23 13:26:01 +00:00
marko
303d8f474f branches/zip: Introduce a new preprocessor symbol, UNIV_BUF_DEBUG, and
enclose buf_validate() and friends in it.
2006-11-16 09:00:30 +00:00
marko
c161077922 branches/zip: buf_LRU_free_block(): New function, split from
buf_LRU_search_and_free_block().
2006-11-15 21:41:27 +00:00
marko
4574bdda81 branches/zip: Merge revisions 968:1009 from trunk. 2006-11-10 11:15:59 +00:00
marko
8c292a263a branches/zip: Enclose some more debug code in #ifdef UNIV_SYNC_DEBUG
to allow the code to be built with UNIV_DEBUG but without UNIV_SYNC_DEBUG.
2006-10-31 16:51:16 +00:00
marko
69fc883be2 branches/zip: Remove support for AWE (Intel PAE on Win32).
Removal of the variable innobase_buffer_pool_awe_mem_mb requires
coordination with MySQL AB.
2006-10-30 13:48:08 +00:00
marko
c755e88727 branches/zip: Reduce the number of buf_block_align() calls.
btr_block_get(): New function to return buf_block_t.

btr_page_alloc(), buf_page_get_release_on_io(), buf_page_get_gen(),
buf_page_create(), fseg_create(), fseg_create_general(): Return buf_block_t.

buf_page_get_known_nowait(): Expect buf_block_t instead of buf_frame_t.

buf_frame_get_newest_modification(): Replace with
buf_block_get_newest_modification().

buf_page_dbg_add_level(): Replace with buf_block_dbg_add_level().

buf_block_get_zip_size(): New function.

buf_block_get_page_zip(): Reintroduce.

recv_recover_page(): Replace page, space, page_no with block.

ibuf_bitmap_page_init(): Replace page, zip_size with block.

ibuf_parse_bitmap_init(): Remove the parameter zip_size.

btr_search_drop_page_hash_index(): Replace page with block.
2006-10-12 11:05:22 +00:00
marko
606bd38428 branches/zip: Stamp (space_id, page_no) on buffer pool pages early on.
buf_flush_init_for_writing(): Remove parameters space, page_no.

fsp_init_file_page_low(): Wriet space_id and page_no to the page.

fil_create_new_single_table_tablespace(): Write space_id to the page.
2006-10-10 12:26:37 +00:00
marko
11cd834bb1 branches/zip: buf_block_get_page_zip(): Replace with buf_frame_get_page_zip(). 2006-10-09 15:37:19 +00:00
marko
9d2146e431 branches/zip: Replace FIL_PAGE_ZBLOB_SPACE_ID and FIL_PAGE_ZBLOB_DATA
with FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID and FIL_PAGE_DATA.  The doublewrite
buffer needs to read the space_id in order to determine the type of the page.
Because FIL_PAGE_TYPE could contain garbage in MySQL/InnoDB 5.0 and earlier
versions, we cannot trust fil_page_get_type().  Instead, we have to always
store the space_id at the same location.  This modification wastes 12 bytes
per compressed BLOB page (1.2% on 1-kilobyte pages).
2006-09-27 10:51:05 +00:00
marko
9a16aac783 branches/zip: Merge revisions 804:838 from trunk. 2006-09-19 10:14:07 +00:00
marko
64f3cee67f branches/zip: Merge revisions 720:765 from trunk and reindent the code
as per revisions r763:765.
2006-08-29 09:30:31 +00:00
marko
e4077d5651 branches/zip: buf_flush_init_for_writing(): Invoke page_zip_calc_checksum()
on page_zip->data, so that the freshly written fields will be included.

page_cur_delete_rec(): Add a page_zip_validate() assertion to the end.
2006-08-01 12:05:04 +00:00
marko
8c55373635 branches/zip: Stamp some header fields to compressed BLOB pages.
buf_flush_init_for_writing(): On FIL_PAGE_TYPE_ZBLOB, write to
page_zip->data instead of page.

page_zip_write_rec(), page_zip_write_blob_ptr(), page_zip_write_node_ptr():
Add ut_ad(page_simple_validate_new()).
2006-07-31 18:27:17 +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
fa63e363c2 branches/zip: buf_flush_init_for_writing(): Determine zip_size from
page_zip instead of calling fil_space_get_zip_size().  In
fil_create_new_single_table_tablespace(), the table space has not yet
been created.  Handle also FIL_PAGE_TYPE_ALLOCATED.
2006-06-14 07:47:32 +00:00
marko
831916878d branches/zip: Write compressed pages to disk.
os_aio_simulated_handle(): Temporarily disable os_file_check_page_trailers(),
which cannot be invoked on compressed pages.

dict_table_add_system_columns(): New function, split from
dict_table_add_to_cache().

mlog_parse_index(): Add system columns to the dummy table and identify
DB_TRX_ID and DB_ROLL_PTR in the dummy index.

buf_LRU_get_free_block(): Note that page_zip->data should be allocated from
an aligned memory pool.

buf_flush_buffered_writes(): Write compressed pages to disk.

buf_flush_post_to_doublewrite_buf(): Copy compressed pages to the
doublewrite buffer.  Zero fill any excess space.

buf_flush_init_for_writing(): Treat all compressed pages the same.

buf_read_page_low(): Read compressed pages from disk.

buf_page_io_complete(): Process compressed pages.

trx_sys_doublewrite_init_or_restore_page(): Process compressed pages.

mlog_write_initial_log_record_fast(): Enable a debug printout
#ifdef UNIV_LOG_DEBUG.

fsp_header_init(), fsp_fill_free_list(): Pass the compressed page size
to buf_page_create().

page_zip_compress_write_log(): Flatten the if-else if-else logic.

page_zip_parse_write_blob_ptr(): Do not test page_zip if page==NULL.

page_zip_parse_write_node_ptr(): Do not test page_zip if page==NULL.
Invoke mlog_close() correctly.

row_sel_store_row_id_to_prebuilt(): Add UNIV_UNLIKELY hint to an
assertion-like test.
2006-05-30 09:04:57 +00:00
marko
b560b0ea20 branches/zip: buf_flush_buffered_writes(): Disable the checks on compressed
pages.

buf_flush_post_to_doublewrite_buf(): Add a TODO comment about compressed pages.
2006-05-24 14:35:22 +00:00
marko
3979344d88 branches/zip: buf_flush_buffered_writes(): Replace four occurrences of
mach_read_from_4(...) != mach_read_from_4(...) with memcmp(..., ..., 4).
2006-05-22 09:23:30 +00:00
marko
93ea672ae3 branches/zip: Write the compressed page size to SYS_TABLES.TYPE and adjust
a few places accordingly.

os_aio_simulated_handle(): Add TODO comments about skipping the write
checks for compressed pages.

dict_create_sys_tables_tuple(): Write the compressed page size to
the TYPE column.

open_or_create_data_files(): Simplify the fil_node_create() call.

fil_node_create(): Do not touch space->zip_size.  It was already initialized
by fil_space_create().

fil_reset_too_high_lsns(), buf_flush_buffered_writes(): Add TODO comment
about compressed pages.

buf_flush_init_for_writing(): Handle pages of type FIL_PAGE_INODE,
FIL_PAGE_IBUF_BITMAP, and FIL_PAGE_TYPE_FSP_HDR as uncompressed ones.
2006-05-17 12:03:32 +00:00
marko
8f167973c2 branches/zip: Fix bugs.
btr_root_raise_and_insert(): When copying root to new_page byte for byte,
restore the page number of new_page afterwards.

buf_flush_init_for_writing(): For FIL_PAGE_INDEX, write the page number
and space id also to the uncompressed page.
2006-05-10 11:28:14 +00:00
marko
cfc945a954 branches/zip: Merge revisions 465:532 from trunk. 2006-05-08 06:18:59 +00:00
marko
f258491a26 branches/zip: Minor improvements.
Introduce FIL_PAGE_ZBLOB_DATA as a synonym for FIL_PAGE_FILE_FLUSH_LSN.

btr_store_big_rec_extern_fields(): Make the assertion about
dict_table_zip_size() more accurate.

buf_LRU_get_free_block(), buf_block_alloc(): Add parameter zip_size.

buf_calc_zblob_page_checksum(): Remove. Replace with page_zip_calc_checksum().

buf_page_init(): Remove parameter zip_size.

buf_page_io_complete(): Add a placeholder for handling compressed pages.

trx_doublewrite_page_inside(): Remove redundant function.

page_zip_write_rec(): Relax an overly tight assertion about blob_no.
2006-05-04 11:44:49 +00:00
marko
7bd3aca4ad branches/zip: Prepare for writing compressed and reading pages.
buf_page_print(): Print also compressed pages.  Add parameter zip_size.

buf_flush_init_for_writing(): Stamp the fields on a compressed B-tree index
page.

Add the header field FIL_PAGE_ZBLOB_SPACE_ID as an alias of FIL_PAGE_PREV.

page_zip_calc_checksum(): New function.

page_zip_compress(): Avoid copying the fields that are written in
buf_flush_init_for_writing().

page_zip_header_cmp(): New function for comparing those fields of the
page header that will not be written in buf_flush_init_for_writing().
2006-05-02 11:44:39 +00:00
marko
0cb4c58fa2 branches/zip: Minor improvements.
buf_flush_init_for_writing(): Calculate the checksum with the actual zip_size.

buf_calc_zblob_page_checksum(): Skip the field FIL_PAGE_SPACE_OR_CHKSUM.

trx_sys_doublewrite_init_or_restore_page(): Use the actual zip_size.

page_cur_insert_rec_low(): If page_zip_alloc() fails, try compressing the
whole page afterwards.
2006-04-28 09:30:40 +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
a3e8e34568 branches/zip: Disable accidentally committed debug code that would break
crash recovery of uncompressed tables.
2006-04-11 08:12:39 +00:00
marko
f4c776f518 branches/zip: Initial steps towards disk-based storage of compressed pages.
dict_mem_table_create(): Account for DICT_TF_COMPRESSED in a debug assertion.

btr_store_big_rec_extern_fields(), btr_free_externally_stored_field(),
btr_copy_externally_stored_field(): Implement the disk format for
compressed BLOB pages.

btr_copy_externally_stored_field(): Improve error reporting and handling
when decompressing BLOB pages.

buf_flush_init_for_writing(), buf_page_is_corrupted(), buf_page_print():
Account for compressed BLOB pages (FIL_PAGE_TYPE_ZBLOB).

buf_calc_zblob_page_checksum(): New function.
2006-04-05 13:41:12 +00:00