Bug #74151 Clean up some code in the InnoDB change buffer
Submitted: 30 Sep 2014 9:11 Modified: 7 Oct 2014 13:51
Reporter: Marko Mäkelä Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[30 Sep 2014 9:11] Marko Mäkelä
The InnoDB change buffer tree is created inside the InnoDB data dictionary cache as an ordinary table, even though there are no table name or table id lookups on it, and no undo logging or purge for it.

The flag DICT_UNIVERSAL is always set in connection with DICT_IBUF. Thus, the flag is redundant. Neither flag is ever set in any persistent data structure.

How to repeat:
See Description.

Suggested fix:
Create the pseudo-table for the InnoDB change buffer directly, bypassing the cache.
Remove the DICT_UNIVERSAL flag (replace it with DICT_IBUF).

dict_index_is_univ(): Remove and replace with dict_index_is_ibuf().

dict_index_add_to_cache(), dict_index_build_internal_clust(): Assert
that the index is not the change buffer.
ibuf_close(), ibuf_init_at_db_start(): Create ibuf->index directly
using lower-level functions, without involving the data dictionary cache.
[7 Oct 2014 13:53] Daniel Price
Fixed as of the upcoming 5.7.6 release, and here's the changelog entry:

The "InnoDB" change buffer tree, which was created inside the "InnoDB"
data dictionary cache unnecessarily, is now created directly, bypassing
the cache. This patch also removes the "DICT_UNIVERSAL" flag, which was
always set in in connection with "DICT_IBUF". Neither flag is used for
persistent data structures, which makes the "DICT_UNIVERSAL" flag