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.
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)).
hash index, because it might occupy the chunk we would like to free.
TODO: In btr_search_check_free_space_in_heap(), release the block if
btr_search_latch is not immediately available.
buf_pool_shrink(): Split from buf_pool_resize().
btr_search_disabled: New variable, similar to srv_use_adaptive_hash_indexes
that was removed earlier.
btr_search_disable(): New function: disable and purge the adaptive hash index.
btr_search_enable(): New function: enable the adaptive hash index.
ha_clear(): New function: Empty a hash table and free the memory heaps.
assume that non-file pages are free. After trying to free or flush
file pages, do not proceed to buf_chunk_free(), because the calls will
temporarily release buf_pool->mutex. Do not flush if there are non-free
blocks, because it would not achieve anything.
enclose all related debug code in #ifdef UNIV_DEBUG_FILE_ACCESSES.
This should have no effect on the behaviour, as the symbol is
not defined by default. It only reduces the size of buf_block_t
and removes some assignments and debug functions.
buf_LRU_block_free_non_file_page(): Deallocate block->page_zip.data
to avoid ut_a(!block->page_zip.data) in buf_chunk_free().
buf_chunk_free(): Add the assertion ut_a(!block->in_LRU_list).
buf_pool_resize(): When shrinking the buffer pool and there are
non-free blocks in the candidate chunk, free the clean blocks
and move the dirty blocks to the end of the LRU list and request a flush.
Proceed if the chunk becomes free, and retry otherwise.
mysql.patch: Patch to change or add variables to MySQL
innodb.patch: Patch to make the master thread poll requests to resize
the buffer pool.
Replace srv_pool_size and innobase_buffer_pool_size
with srv_buf_pool_size, srv_buf_pool_old_size,
and srv_buf_pool_curr_size.
Add buf_chunk_t, a collection of buf_block_t.
buf_LRU_block_remove_hashed_page(): Overwrite (space_id,page_no)
when freeing a buffer block. This will help catching non-file
pages being passed to buf_block_align().
On POSIX, use mmap() and munmap(). On Windows, use VirtualAlloc()
and VirtualFree(). Only on Netware, use ut_malloc_low() and ut_free().
The lower-level functions on POSIX and Windows allow InnoDB to return
memory to the operating system when the buffer pool is shrunk.
buf_pool_t: Remove n_frames, max_size, and blocks_of_frames.
The current buffer pool size is in curr_size.
buf_pool_init(): Remove parameter max_size.
buf_pool_get_max_size(), buf_pool_is_block(): Remove.
buf_block_align(): Do not assume that the buffer pool is allocated
in one chunk. Replace dependency on buf_pool->blocks_of_frames
with a call to buf_page_hash_get().
btr_pcur_restore_position(): Add const qualifiers.
buf_LRU_block_remove_hashed_page(): Reduce the amount
of buf_page_hash_get() calls and add a UNIV_UNLIKELY hint
to an assertion-like test.
buf0lru.c: Always #include "srv0srv.h"
buf_block_get_lock_mutex(), buf_frame_get_lock_mutex(): Remove.
mtr0log.ic: Remove #include "page0page.h" and replace the page_
functions with lower-level ones to break an #include cycle.
dict0dict.ic: Remove unnecessary #include "trx0undo.h" and "trx0sys.h"
that would create an #include cycle.
Replace buf_frame_t* guess with buf_block_t* guess in order to avoid
a buf_block_align() call.
trx_undo_t: Replace page_t* guess_page with buf_block_t* guess_block.
btr_search_t: Replace page_t* root_guess with buf_block_t* root_guess.
passed as TRUE.
Enclose hash_table_t::adaptive and buf_block_t::n_pointers in
#ifdef UNIV_DEBUG.
btr_search_drop_page_hash_index(): Enclose the corruption check
(which depends on buf_block_t::n_pointers) in #ifdef UNIV_DEBUG.
the symbol UNIV_DEBUG_PRINT, which was introduced in r729.
buf_LRU_print(), buf_print(): Replace #ifdef UNIV_DEBUG_PRINT
with #if defined UNIV_DEBUG || defined UNIV_DEBUG_PRINT.
ibuf_reset_free_bits(): Remove, as there already is a similar function
ibuf_reset_free_bits_with_type().
ibuf_reset_free_bits_with_type(), ibuf_set_free_bits(),
ibuf_update_free_bits_if_full(), btr_leaf_page_release(),
buf_page_make_young(): Replace page_t with buf_block_t.
btr_compress(): Replace btr_page_get() with btr_block_get().
with page_get_page_no() and page_get_space_id(). We want to avoid
buf_block_align() calls, and the page_no and space_id are now stamped
on the 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.
dict_load_foreigns(): Enclose in #ifndef UNIV_HOTBACKUP.
fil_extend_tablespaces_to_stored_len(): Pass zip_size to fil_read().
buf_page_init_for_backup_restore(): Add parameter zip_size.
Enclose the declaration in buf0buf.h in #ifdef UNIV_HOTBACKUP.
recv_apply_log_recs_for_backup(): Replace the local variable "page"
with the local variable "block". Add local variable zip_size.
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).
for more accurate Valgrind debugging.
univ.i: Introduce UNIV_DEBUG_VALGRIND, UNIV_MEM_VALID, and UNIV_MEM_INVALID.
buf_LRU_block_free_non_file_page(): Invalidate the buffer frame
with UNIV_MEM_INVALID().
buf_LRU_get_free_block(): Declare the buffer frame valid
with UNIV_MEM_VALID().
Other memory is allocated and deallocated via malloc() and free(),
which are already overridden by Valgrind. Without the added
instrumentation, accesses to free pages in the buffer pool cannot
be caught.
The diagnostics could probably be improved further by declaring all
non-latched buffer frames invalid.
buf_LRU_get_free_block(): When zip_size changes, initialize all fields
of page_zip. This avoids an assertion failure in page_create_zip() when
a block with an originally larger zip_size is reallocated.
fsp_get_space_header(): Assert that the stored space id matches.
xdes_get_state(): Assert that the state is valid.
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.
buf_page_io_complete(): On FIL_PAGE_TYPE_ZBLOB (compressed BLOB pages),
read the space_id from a different location.
page_zip_compress(), page_zip_write_rec(), page_zip_write_blob_ptr():
Replace page_simple_validate_new() with page_validate().
page_zip_clear_rec(): When running out of log space, do not attempt to
recompress the page, because the directory slots might be unbalanced and
the page_validate() assertion in page_zip_compress() would fail.
Instead, clear the BLOB pointers of the deleted record on the
uncompressed page, so that page_zip_validate() will succeed.
page_zip_validate(): Remove the comment about page_zip_clear_rec().
A mismatch always indicates a serious inconsistency.
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()).