# name : innodb_buffer_pool_shm.patch # introduced : 12 # maintainer : Yasufumi # #!!! notice !!! # Any small change to this file in the main branch # should be done or reviewed by the maintainer! --- a/storage/innobase/buf/buf0buf.c +++ b/storage/innobase/buf/buf0buf.c @@ -1022,10 +1022,12 @@ buf_block_t* block; byte* frame; ulint i; + ulint size_target; /* Round down to a multiple of page size, although it already should be. */ mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE); + size_target = (mem_size / UNIV_PAGE_SIZE) - 1; /* Reserve space for the block descriptors. */ mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block) + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE); @@ -1063,6 +1065,10 @@ chunk->size = size; } + if (chunk->size > size_target) { + chunk->size = size_target; + } + /* Init block structs and assign frames for them. Then we assign the frames to the first blocks (we already mapped the memory above). */ --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -195,6 +195,8 @@ static my_bool innobase_stats_on_metadata = TRUE; static my_bool innobase_large_prefix = FALSE; static my_bool innobase_use_sys_stats_table = FALSE; +static my_bool innobase_buffer_pool_shm_checksum = TRUE; +static uint innobase_buffer_pool_shm_key = 0; static char* internal_innobase_data_file_path = NULL; @@ -2706,6 +2708,12 @@ srv_buf_pool_size = (ulint) innobase_buffer_pool_size; srv_buf_pool_instances = (ulint) innobase_buffer_pool_instances; + if (innobase_buffer_pool_shm_key) { + fprintf(stderr, + "InnoDB: Warning: innodb_buffer_pool_shm_key is deprecated function.\n" + "InnoDB: innodb_buffer_pool_shm_key was ignored.\n"); + } + srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size; srv_n_file_io_threads = (ulint) innobase_file_io_threads; @@ -11863,6 +11871,16 @@ "Number of buffer pool instances, set to higher value on high-end machines to increase scalability", NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L); +static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, innobase_buffer_pool_shm_key, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, + "[Deprecated option] no effect", + NULL, NULL, 0, 0, INT_MAX32, 0); + +static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum, + PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, + "[Deprecated option] no effect", + NULL, NULL, TRUE); + static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, PLUGIN_VAR_RQCMDARG, "Helps in performance tuning in heavily concurrent environments.", @@ -12209,6 +12227,8 @@ MYSQL_SYSVAR(autoextend_increment), MYSQL_SYSVAR(buffer_pool_size), MYSQL_SYSVAR(buffer_pool_instances), + MYSQL_SYSVAR(buffer_pool_shm_key), + MYSQL_SYSVAR(buffer_pool_shm_checksum), MYSQL_SYSVAR(checksums), MYSQL_SYSVAR(fast_checksum), MYSQL_SYSVAR(commit_concurrency), --- /dev/null +++ b/mysql-test/r/percona_innodb_buffer_pool_shm.result @@ -0,0 +1,4 @@ +show variables like 'innodb_buffer_pool_shm%'; +Variable_name Value +innodb_buffer_pool_shm_checksum ON +innodb_buffer_pool_shm_key 123456 --- /dev/null +++ b/mysql-test/t/percona_innodb_buffer_pool_shm-master.opt @@ -0,0 +1 @@ +--innodb_buffer_pool_shm_key=123456 --- /dev/null +++ b/mysql-test/t/percona_innodb_buffer_pool_shm.test @@ -0,0 +1,2 @@ +--source include/have_innodb.inc +show variables like 'innodb_buffer_pool_shm%';