]>
Commit | Line | Data |
---|---|---|
1 | # name : innodb_buffer_pool_shm.patch | |
2 | # introduced : 12 | |
3 | # maintainer : Yasufumi | |
4 | # | |
5 | #!!! notice !!! | |
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 @@ | |
11 | buf_block_t* block; | |
12 | byte* frame; | |
13 | ulint i; | |
14 | + ulint size_target; | |
15 | ||
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 @@ | |
24 | chunk->size = size; | |
25 | } | |
26 | ||
27 | + if (chunk->size > size_target) { | |
28 | + chunk->size = size_target; | |
29 | + } | |
30 | + | |
31 | /* Init block structs and assign frames for them. Then we | |
32 | assign the frames to the first blocks (we already mapped the | |
33 | memory above). */ | |
34 | --- a/storage/innobase/handler/ha_innodb.cc | |
35 | +++ b/storage/innobase/handler/ha_innodb.cc | |
36 | @@ -195,6 +195,8 @@ | |
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; | |
42 | ||
43 | ||
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; | |
48 | ||
49 | + if (innobase_buffer_pool_shm_key) { | |
50 | + fprintf(stderr, | |
51 | + "InnoDB: Warning: innodb_buffer_pool_shm_key is deprecated function.\n" | |
52 | + "InnoDB: innodb_buffer_pool_shm_key was ignored.\n"); | |
53 | + } | |
54 | + | |
55 | srv_mem_pool_size = (ulint) innobase_additional_mem_pool_size; | |
56 | ||
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); | |
61 | ||
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); | |
66 | + | |
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", | |
70 | + NULL, NULL, TRUE); | |
71 | + | |
72 | static MYSQL_SYSVAR_ULONG(commit_concurrency, innobase_commit_concurrency, | |
73 | PLUGIN_VAR_RQCMDARG, | |
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), | |
84 | --- /dev/null | |
85 | +++ b/mysql-test/r/percona_innodb_buffer_pool_shm.result | |
86 | @@ -0,0 +1,4 @@ | |
87 | +show variables like 'innodb_buffer_pool_shm%'; | |
88 | +Variable_name Value | |
89 | +innodb_buffer_pool_shm_checksum ON | |
90 | +innodb_buffer_pool_shm_key 123456 | |
91 | --- /dev/null | |
92 | +++ b/mysql-test/t/percona_innodb_buffer_pool_shm-master.opt | |
93 | @@ -0,0 +1 @@ | |
94 | +--innodb_buffer_pool_shm_key=123456 | |
95 | --- /dev/null | |
96 | +++ b/mysql-test/t/percona_innodb_buffer_pool_shm.test | |
97 | @@ -0,0 +1,2 @@ | |
98 | +--source include/have_innodb.inc | |
99 | +show variables like 'innodb_buffer_pool_shm%'; |