C++ requires explicit type casts when converting from void*, and *.ic files
are now inlined in ha_innodb.cc.
fil_space_get_by_id(), fil_space_get_by_name(): New inline functions, to
replace occurrences of the HASH_SEARCH() macro in fil0fil.c. This should
improve readability.
mtr_commit(): Do not acquire the log mutex if no log records are to be written.
ibuf_set_free_bits_func(): Do not clear mtr.modifications, because that would
prevent the dirty insert buffer bitmap block from being moved to the flush
list. Instead, assume that mtr_commit() will not acquire log_sys->mutex
because redo logging is disabled.
buf_page_init_for_read(): I/O-fix the block before buf_buddy_alloc(), because
the newly allocated block could otherwise be reused by the compressed page.
allocated before overwriting some fields and flagging the frame freed.
Some of the buffer frame may have been flagged freed by the user
(such as mem_heap).
for displaying buddy allocator statistics.
buf_buddy_used[], buf_buddy_relocated[]: Declare as global symbols.
mysql_declare_plugin(innobase): Add MYSQL_INFORMATION_SCHEMA_PLUGIN
for innobase_is_buddy ("INNODB_BUDDY").
page_zip_max_ins_size(): New function.
btr_cur_optimistic_insert(), btr_cur_optimistic_delete(),
btr_page_split_and_insert(), btr_compress(): Do not update the
ibuf free bits for non-leaf pages or pages belonging to a clustered index.
The insert buffer only covers operations on leaf pages of secondary indexes.
For pages covered by the insert buffer, limit the max_ins_size to
page_zip_max_ins_size().
buf_page_get_gen(): Merge the insert buffer after decompressing the page.
buf_page_io_complete(): Relax the assertion about ibuf_count. For
compressed-only pages, the insert buffer merge takes place
in buf_page_get_gen().
ibuf_index_page_calc_free_bits(), ibuf_index_page_calc_free_from_bits(),
ibuf_index_page_calc_free(), ibuf_update_free_bits_if_full(),
ibuf_update_free_bits_low(), ibuf_update_free_bits_for_two_pages_low(),
ibuf_set_free_bits_low(): Add the parameter zip_size. Limit the maximum
insert size to page_zip_max_ins_size().
compressed pages, because doing so would require a call to
buf_buddy_alloc(), which in turn can invoke buf_LRU_get_free_block()
and buf_LRU_search_and_free_block(), potentially infinite recursion.
buf_buddy_n_frames: Number of buffer frames allocated for the buddy system
buf_buddy_used[]: Counts of allocated blocks, by buddy size.
buf_buddy_relocated[]: Counts of blocks relocated, bu buddy size.
buf_buddy_alloc_clean(): Note the added configuration parameter
buf_buddy_min_n_frames: Preferred minimum buf_buddy_n_frames
buf_buddy_alloc() until after the block has been found not to exist
in the buffer pool.
buf_buddy_alloc(), buf_buddy_alloc_low(): Make lru an output parameter.
Improve documentation.
buf_page_init_for_read(): Simplify the code. Check buf_page_hash_get()
again if buf_buddy_alloc() released buf_pool->mutex.
frame when reading compressed pages, unless crash recovery is in progress.
buf_page_read_low(): Adapt for buf_page_init_for_read() returning
buf_page_t* instead of buf_block_t*.
but in buf_page_get_gen(). Adjust comments. This prevents
unnecessary decompression in read-ahead when the compressed block
exists in the buffer pool.
If the block does not exist in the buffer pool, read-ahead will still
allocate an uncompressed page and decompress the block.
Move buf_block_init_low() and buf_zip_decompress() earlier in the file,
because some compilers are unable to inline functions that are defined
after the invocation.
buf_page_get_gen(): Decompress the block if needed.
buf_page_init_for_read(): Do not decompress.
of HASH_DELETE().
HASH_ASSERT_VALID(), HASH_INVALIDATE(): New macros, used in HASH_DELETE()
and HASH_SEARCH().
buf_page_init_low(): Add HASH_INVALIDATE(bpage, hash);
buf_page_init(): Call buf_page_init_low() before HASH_INSERT(), so that
bpage->hash will not be invalidated.
block->page.buf_fix_count. This mistake was made in r1255.
When access to the block is requested by some other thread,
buf_fix_count can be incremented during the execution of
buf_zip_decompress().
initialize all the fields of the control block.
buf_block_init_low(), buf_page_init_low(): New functions, used in
buf_page_init_for_backup_restore(), buf_page_init(), and
buf_page_init_for_read().
buf_buddy_relocate_block(): New function, split from buf_buddy_relocate().
Return FALSE when buf_page_can_relocate() returns FALSE.
Fix some formatting in buf_buddy_free_low() and buf_page_init_for_read().
uncompressed page frames.
buf_page_get_zip(), buf_page_release_zip(): New functions, used
by btr_copy_zblob_prefix().
btr_copy_zblob_prefix(): Do not call inflateEnd().
buf_LRU_free_block(): Do not allocate the control block when
a compressed-only page is being freed.
buf_validate(): Note that buf_pool->zip_clean may contain blocks
with io_fix == BUF_IO_READ.
buf_page_get_gen(). This saves one mutex operation per block request.
buf_page_get_gen(), various macros and functions: Add parameter zip_size.
btr_node_ptr_get_child(): Add parameter index.
fil_space_get_latch(): Add optional output parameter zip_size.
fil_space_get_zip_size(): Return 0 for space id==0, because the
system tablespace is never compressed.
fsp_header_init(): Remove the parameter zip_size.
ibuf_free_excess_pages(): Remove the parameter zip_size.
trx_rseg_t, trx_undo_t: Add field zip_size.
xdes_lst_get_next(): Remove, unused.
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.
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.
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.
compressed page) is not protected by block_mutex. Before releasing
buf_pool->mutex, we can simply assign b->io_fix. After reacquiring
buf_pool->mutex, we also have to acquire buf_pool->zip_mutex.
of a block, do not release buf_pool->mutex between the time the old control
block is removed from buf_pool->page_hash and the new control block is
added to it. Prevent operations on the compressed-only block while calling
btr_search_drop_page_hash_index() or page_zip_calc_checksum().
buf_LRU_invalidate_tablespace(): Revert the change done in r1223.
buf_pool->zip_mutex will have been released by
buf_LRU_block_remove_hashed_page() when it returns BUF_BLOCK_ZIP_FREE.
invoking buf_buddy_alloc(). An IO-fixed block must also be x-latched
when block->mutex and buf_pool->mutex are released.
buf_page_create(): Protect the block during buf_buddy_alloc() by
IO-fixing and X-latching it.
buf_zip_decompress(). This will prevent btr_cur_search_to_nth_level()
from accessing a half-decompressed leaf page. Internal B-tree nodes
(non-leaf pages) in B-tree searches are only protected by the tree
latch (index->lock) and by buffer-fixing.
buf_pool->page_hash and buf_pool->LRU before releasing buf_pool->mutex.
buf_page_init_for_read(), buf_page_create(): Allocate the compressed
page after the block has been added to the buffer pool. Document the
reason for this.
buf_page_init(): Declare block->frame valid only in the system tablespace.
trx_sysf_create(): Declare the rest of the page valid, although it is
uninitialized.
buf_buddy_relocate(): Document that src may have been split and some of
it may be in buf_pool->zip_free[j] for some j<i, thus mach_read_from_4()
may be reading from free memory. Check buffer pages only for addressability,
not for being completely initialized. Ensure that block descriptors are
completely initialized.
buf_buddy_remove_from_free(): Check prev->state and next->state in
UNIV_DEBUG && UNIV_DEBUG_VALGRIND builds.
buf_buddy_free_low(): Flag the entire block valid prior to invoking
buf_buddy_remove_from_free() in order to avoid a Valgrind warning about
the debug assertion on bpage->state. Remove the Valgrind check for
buddy being completely allocated. If it has been split to smaller blocks,
some of those blocks may be free.
UNIV_MEM_FREE(): Declare a memory area free.
UNIV_MEM_ALLOC(): Declare a memory area allocated (but uninitialized).
UNIV_MEM_DESC(): Associate a memory area with a control block.
UNIV_MEM_UNDESC(): Unassociate a control block.
trx_sys_create_doublewrite_buf(): Clear the buffer with memset().
buf_page_init(): Add a bogus UNIV_MEM_VALID(block->frame) to silence
valid warnings about InnoDB data pages containing uninitialized data.
buf_LRU_get_free_only(): Add UNIV_MEM_ALLOC(block->frame).
buf_LRU_get_free_block(): Add UNIV_MEM_DESC(block->page.zip.data, block).
buf_LRU_free_block(): Add UNIV_MEM_DESC(b->zip.data, b) when allocating
a compressed-only control block for a compressed page.
buf_LRU_block_free_non_file_page(): Replace UNIV_MEM_INVALID() with
UNIV_MEM_FREE().
buf_LRU_block_remove_hashed_page(): Add UNIV_MEM_UNDESC(bpage) when
deallocating a compressed-only control block. Add
UNIV_MEM_INVALID(block->frame). (The frame should be flagged free
by buf_LRU_block_free_non_file_page() moments later.)
buf0buddy.c: Disable some extra checks in Valgrind-instrumented builds.
Add UNIV_MEM_VALID(), UNIV_MEM_INVALID(), UNIV_MEM_FREE(), UNIV_MEM_ALLOC()
as necessary.
buf_buddy_block_free(), buf_buddy_free_low(): Flag the freed bytes
uninitialized.
buf_page_init_for_read(), buf_buddy_relocate(): Do not refer to bpage
after invoking buf_relocate().
buf_buddy_relocate(): Flag src uninitialized.