1 # name : innodb_buffer_pool_shm.patch
3 # maintainer : Yasufumi
6 # Any small change to this file in the main branch
7 # should be done or reviewed by the maintainer!
8 --- a/storage/innobase/buf/buf0buf.c
9 +++ b/storage/innobase/buf/buf0buf.c
10 @@ -1022,10 +1022,12 @@
16 /* Round down to a multiple of page size,
17 although it already should be. */
18 mem_size = ut_2pow_round(mem_size, UNIV_PAGE_SIZE);
19 + size_target = (mem_size / UNIV_PAGE_SIZE) - 1;
20 /* Reserve space for the block descriptors. */
21 mem_size += ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (sizeof *block)
22 + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
23 @@ -1063,6 +1065,10 @@
27 + if (chunk->size > size_target) {
28 + chunk->size = size_target;
31 /* Init block structs and assign frames for them. Then we
32 assign the frames to the first blocks (we already mapped the
34 --- a/storage/innobase/handler/ha_innodb.cc
35 +++ b/storage/innobase/handler/ha_innodb.cc
37 static my_bool innobase_stats_on_metadata = TRUE;
38 static my_bool innobase_large_prefix = FALSE;
39 static my_bool innobase_use_sys_stats_table = FALSE;
40 +static my_bool innobase_buffer_pool_shm_checksum = TRUE;
41 +static uint innobase_buffer_pool_shm_key = 0;
44 static char* internal_innobase_data_file_path = NULL;
45 @@ -2706,6 +2708,12 @@
46 srv_buf_pool_size = (ulint) innobase_buffer_pool_size;
47 srv_buf_pool_instances = (ulint) innobase_buffer_pool_instances;
49 + if (innobase_buffer_pool_shm_key) {
51 + "InnoDB: Warning: innodb_buffer_pool_shm_key is deprecated function.\n"
52 + "InnoDB: innodb_buffer_pool_shm_key was ignored.\n");
55 srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size;
57 srv_n_file_io_threads = (ulint) innobase_file_io_threads;
58 @@ -11863,6 +11871,16 @@
59 "Number of buffer pool instances, set to higher value on high-end machines to increase scalability",
60 NULL, NULL, 1L, 1L, MAX_BUFFER_POOLS, 1L);
62 +static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, innobase_buffer_pool_shm_key,
63 + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
64 + "[Deprecated option] no effect",
65 + NULL, NULL, 0, 0, INT_MAX32, 0);
67 +static MYSQL_SYSVAR_BOOL(buffer_pool_shm_checksum, innobase_buffer_pool_shm_checksum,
68 + PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
69 + "[Deprecated option] no effect",
72 static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency,
74 "Helps in performance tuning in heavily concurrent environments.",
75 @@ -12209,6 +12227,8 @@
76 MYSQL_SYSVAR(autoextend_increment),
77 MYSQL_SYSVAR(buffer_pool_size),
78 MYSQL_SYSVAR(buffer_pool_instances),
79 + MYSQL_SYSVAR(buffer_pool_shm_key),
80 + MYSQL_SYSVAR(buffer_pool_shm_checksum),
81 MYSQL_SYSVAR(checksums),
82 MYSQL_SYSVAR(fast_checksum),
83 MYSQL_SYSVAR(commit_concurrency),
85 +++ b/mysql-test/r/percona_innodb_buffer_pool_shm.result
87 +show variables like 'innodb_buffer_pool_shm%';
89 +innodb_buffer_pool_shm_checksum ON
90 +innodb_buffer_pool_shm_key 123456
92 +++ b/mysql-test/t/percona_innodb_buffer_pool_shm-master.opt
94 +--innodb_buffer_pool_shm_key=123456
96 +++ b/mysql-test/t/percona_innodb_buffer_pool_shm.test
98 +--source include/have_innodb.inc
99 +show variables like 'innodb_buffer_pool_shm%';