-
-
Notifications
You must be signed in to change notification settings - Fork 2k
MDEV-38947 Reimplement SET GLOBAL innodb_buffer_pool_size #4729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 10.6
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* Copyright (c) 2025, MariaDB | ||
|
|
||
| This program is free software; you can redistribute it and/or modify | ||
| it under the terms of the GNU General Public License as published by | ||
| the Free Software Foundation; version 2 of the License. | ||
|
|
||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ | ||
|
|
||
| #pragma once | ||
| /* | ||
| Functionality for handling virtual memory | ||
| (reserve, commit, decommit, release) | ||
| */ | ||
| #include <stddef.h> /*size_t*/ | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #ifdef _WIN32 | ||
| char *my_virtual_mem_reserve(size_t *size); | ||
| #endif | ||
| char *my_virtual_mem_commit(char *ptr, size_t size); | ||
| void my_virtual_mem_decommit(char *ptr, size_t size); | ||
| void my_virtual_mem_release(char *ptr, size_t size); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| --large-pages | ||
| --large-pages --loose-innodb-buffer-pool-size-max=16m |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| --innodb_buffer_pool_size=5M | ||
| --innodb_buffer_pool_size=6M | ||
| --innodb_encrypt_temporary_tables=1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,4 @@ wsrep_sst_method=mariabackup | |
| wsrep_sst_auth="root:" | ||
|
|
||
| [mariabackup] | ||
| use_memory=123m | ||
| use_memory=121m | ||
|
Comment on lines
7
to
+8
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It took a while for me to figure out that this test
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right! For reference, 9a6540c introduced a similar change in |
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| call mtr.add_suppression("InnoDB: Cannot allocate memory for the buffer pool"); | ||
| call mtr.add_suppression("InnoDB: Cannot map innodb_buffer_pool_size_max="); | ||
| call mtr.add_suppression("InnoDB: Plugin initialization aborted at srv0start.cc.*"); | ||
| call mtr.add_suppression("Plugin 'InnoDB' init function returned error."); | ||
| call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed."); | ||
| # | ||
| # MDEV-25019 memory allocation failures during startup cause server failure in different, confusing ways | ||
| # | ||
| # restart: --debug_dbug=+d,ib_buf_chunk_init_fails | ||
| FOUND 1 /\[ERROR\] InnoDB: Cannot allocate memory for the buffer pool/ in mysqld.1.err | ||
| FOUND 1 /\[ERROR\] InnoDB: Cannot map innodb_buffer_pool_size_max=16m/ in mysqld.1.err |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,60 @@ | ||
| # | ||
| # MDEV-29445: Reorganize buffer pool (and remove chunks) | ||
| # | ||
| set global innodb_adaptive_hash_index=ON; | ||
| select @@innodb_buffer_pool_size; | ||
| @@innodb_buffer_pool_size | ||
| 8388608 | ||
| set global innodb_buffer_pool_size = 9437184; | ||
iMineLink marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| set global innodb_buffer_pool_size = 10485760; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '10485760' | ||
| select @@innodb_buffer_pool_size; | ||
| @@innodb_buffer_pool_size | ||
| 16777216 | ||
| create table t1 (id int not null, val int not null default '0', primary key (id)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; | ||
| create or replace view view0 as select 1 union all select 1; | ||
| set @`v_id` := 0; | ||
| set @`v_val` := 0; | ||
| replace into t1 select (@`v_id` := (@`v_id` + 4) mod 4294967296) as id, (@`v_val` := (@`v_val` + 4) mod 4294967296) as val from view0 v0, view0 v1, view0 v2, view0 v3, view0 v4, view0 v5, view0 v6, view0 v7, view0 v8, view0 v9, view0 v10, view0 v11, view0 v12, view0 v13, view0 v14, view0 v15, view0 v16, view0 v17; | ||
| 10485760 | ||
| create table t1 (id int primary key, val int not null) | ||
| ENGINE=InnoDB ROW_FORMAT=COMPRESSED; | ||
| create table t2 (id int primary key, val int not null) | ||
| ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$kbs; | ||
| SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR | ||
| INSERT INTO t1 SELECT seq*4,seq*4 FROM seq_1_to_262144; | ||
| SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR | ||
| INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384; | ||
| SELECT @@GLOBAL.innodb_adaptive_hash_index; | ||
| @@GLOBAL.innodb_adaptive_hash_index | ||
| 1 | ||
| SET STATEMENT max_statement_time=1e-9 FOR | ||
| SET GLOBAL innodb_buffer_pool_size = 7340032; | ||
| SELECT @@GLOBAL.innodb_adaptive_hash_index; | ||
| @@GLOBAL.innodb_adaptive_hash_index | ||
| 1 | ||
| FOUND 1 /innodb_buffer_pool_size=7m.*resized from|innodb_buffer_pool_size change aborted/ in mysqld.1.err | ||
| set global innodb_buffer_pool_size = 7340032; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '7340032' | ||
| select @@innodb_buffer_pool_size; | ||
| @@innodb_buffer_pool_size | ||
| 8388608 | ||
| select count(val) from t1; | ||
| count(val) | ||
| 262144 | ||
| select count(val) from t2; | ||
| count(val) | ||
| 16384 | ||
| set global innodb_adaptive_hash_index=OFF; | ||
| set global innodb_buffer_pool_size = 25165824; | ||
| set global innodb_buffer_pool_size = 24117248; | ||
| set global innodb_buffer_pool_size = 26214400; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect innodb_buffer_pool_size value: '26214400' | ||
| select @@innodb_buffer_pool_size; | ||
| @@innodb_buffer_pool_size | ||
| 25165824 | ||
| select count(val) from t1; | ||
| count(val) | ||
| 262144 | ||
| drop table t1; | ||
| drop view view0; | ||
| select count(val) from t2; | ||
| count(val) | ||
| 16384 | ||
| drop table t1,t2; | ||
| SET GLOBAL innodb_max_purge_lag_wait = 0; | ||
| SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct; | ||
| SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm; | ||
| SET GLOBAL innodb_max_dirty_pages_pct_lwm = 0.0; | ||
| SET GLOBAL innodb_max_dirty_pages_pct = 0.0; | ||
| SET GLOBAL innodb_buffer_pool_size = @old_innodb_buffer_pool_size; | ||
| SET GLOBAL innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index; | ||
| SET GLOBAL innodb_max_dirty_pages_pct = @save_pct; | ||
| SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm; | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| call mtr.add_suppression("innodb_buffer_pool_size change aborted"); | ||
| CREATE TABLE t (c INT) ENGINE=InnoDB PARTITION BY HASH(c) PARTITIONS 512; | ||
| BEGIN; | ||
| SELECT * FROM t LOCK IN SHARE MODE; | ||
| c | ||
| SET @save_size = @@GLOBAL.innodb_buffer_pool_size; | ||
| SET GLOBAL innodb_buffer_pool_size=6291456; | ||
| COMMIT; | ||
| SET GLOBAL innodb_buffer_pool_size=6291456; | ||
| SET GLOBAL innodb_buffer_pool_size = @save_size; | ||
| DROP TABLE t; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| call mtr.add_suppression("innodb_buffer_pool_size change aborted"); | ||
| SET @b=REPEAT('0',1048576); | ||
| CREATE TEMPORARY TABLE t (c MEDIUMTEXT) ENGINE=InnoDB; | ||
| INSERT INTO t VALUES | ||
| (@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b),(@b); | ||
| SET STATEMENT max_statement_time=0.000001 FOR | ||
| SET GLOBAL innodb_buffer_pool_size=6291456; | ||
| SET STATEMENT max_statement_time=0.000001 FOR | ||
| SET GLOBAL innodb_buffer_pool_size=6291456; | ||
| SET STATEMENT max_statement_time=0.000001 FOR | ||
| SET GLOBAL innodb_buffer_pool_size=6291456; | ||
| SET GLOBAL innodb_buffer_pool_size=6291456; | ||
| SET GLOBAL innodb_buffer_pool_size=16777216; | ||
| CHECKSUM TABLE t; | ||
| Table Checksum | ||
| test.t 4050893687 | ||
| DROP TEMPORARY TABLE t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a backport difference, but
xtrabackup_use_memoryhas typelonglonginextra/mariabackup/xtrabackup.cc. But possibly it should beulonglonginstead. I thinkGET_ULLis fine here.