Skip to content

Commit

Permalink
MDEV-15058: Deprecate and ignore innodb_buffer_pool_instances
Browse files Browse the repository at this point in the history
Our benchmarking efforts indicate that the reasons for splitting the
buf_pool in commit c18084f
have mostly gone away, possibly as a result of
mysql/mysql-server@ce6109e
or similar work.

Only in one write-heavy benchmark where the working set size is
ten times the buffer pool size, the buf_pool->mutex would be
less contended with 4 buffer pool instances than with 1 instance,
in buf_page_io_complete(). That contention could be alleviated
further by making more use of std::atomic and by splitting
buf_pool_t::mutex further (MDEV-15053).

We will deprecate and ignore the following parameters:

	innodb_buffer_pool_instances
	innodb_page_cleaners

There will be only one buffer pool and one page cleaner task.

In a number of INFORMATION_SCHEMA views, columns that indicated
the buffer pool instance will be removed:

	information_schema.innodb_buffer_page.pool_id
	information_schema.innodb_buffer_page_lru.pool_id
	information_schema.innodb_buffer_pool_stats.pool_id
	information_schema.innodb_cmpmem.buffer_pool_instance
	information_schema.innodb_cmpmem_reset.buffer_pool_instance
  • Loading branch information
dr-m committed Feb 12, 2020
1 parent 0448c61 commit 1a6f708
Show file tree
Hide file tree
Showing 47 changed files with 2,072 additions and 4,956 deletions.
2 changes: 0 additions & 2 deletions extra/mariabackup/xtrabackup.cc
Expand Up @@ -1905,8 +1905,6 @@ static bool innodb_init_param()

srv_buf_pool_size = (ulint) xtrabackup_use_memory;
srv_buf_pool_chunk_unit = (ulong)srv_buf_pool_size;
srv_buf_pool_instances = 1;
srv_n_page_cleaners = 1;

srv_n_file_io_threads = (ulint) innobase_file_io_threads;
srv_n_read_io_threads = (ulint) innobase_read_io_threads;
Expand Down
12 changes: 6 additions & 6 deletions mysql-test/main/information_schema_all_engines.result
Expand Up @@ -99,9 +99,9 @@ GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
INNODB_BUFFER_PAGE POOL_ID
INNODB_BUFFER_PAGE_LRU POOL_ID
INNODB_BUFFER_POOL_STATS POOL_ID
INNODB_BUFFER_PAGE BLOCK_ID
INNODB_BUFFER_PAGE_LRU LRU_POSITION
INNODB_BUFFER_POOL_STATS POOL_SIZE
INNODB_CMP page_size
INNODB_CMPMEM page_size
INNODB_CMPMEM_RESET page_size
Expand Down Expand Up @@ -180,9 +180,9 @@ GEOMETRY_COLUMNS F_TABLE_SCHEMA
GLOBAL_STATUS VARIABLE_NAME
GLOBAL_VARIABLES VARIABLE_NAME
INDEX_STATISTICS TABLE_SCHEMA
INNODB_BUFFER_PAGE POOL_ID
INNODB_BUFFER_PAGE_LRU POOL_ID
INNODB_BUFFER_POOL_STATS POOL_ID
INNODB_BUFFER_PAGE BLOCK_ID
INNODB_BUFFER_PAGE_LRU LRU_POSITION
INNODB_BUFFER_POOL_STATS POOL_SIZE
INNODB_CMP page_size
INNODB_CMPMEM page_size
INNODB_CMPMEM_RESET page_size
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/main/sp-group.result
Expand Up @@ -22,9 +22,9 @@ ORDER BY table1.NUMBER_RECORDS
LIMIT 0
;
CALL s1;
POOL_ID LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK pk f0 f1 f2 f3 f4 f5 f6 f7 f8 f9
LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK pk f0 f1 f2 f3 f4 f5 f6 f7 f8 f9
CALL s1;
POOL_ID LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK pk f0 f1 f2 f3 f4 f5 f6 f7 f8 f9
LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK pk f0 f1 f2 f3 f4 f5 f6 f7 f8 f9
drop table t1;
drop view view_t1;
drop procedure s1;
Expand Down
45 changes: 0 additions & 45 deletions mysql-test/suite/innodb/r/innodb-page-cleaners.result

This file was deleted.

8 changes: 4 additions & 4 deletions mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
Expand Up @@ -27,11 +27,11 @@ database_name table_name index_name compress_ops compress_ops_ok compress_time u
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmp_per_index_reset but the InnoDB storage engine is not installed
select * from information_schema.innodb_cmpmem;
page_size buffer_pool_instance pages_used pages_free relocation_ops relocation_time
page_size pages_used pages_free relocation_ops relocation_time
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmpmem but the InnoDB storage engine is not installed
select * from information_schema.innodb_cmpmem_reset;
page_size buffer_pool_instance pages_used pages_free relocation_ops relocation_time
page_size pages_used pages_free relocation_ops relocation_time
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_cmpmem_reset but the InnoDB storage engine is not installed
select * from information_schema.innodb_metrics;
Expand Down Expand Up @@ -344,11 +344,11 @@ KEY VALUE
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_ft_config but the InnoDB storage engine is not installed
select * from information_schema.innodb_buffer_page;
POOL_ID BLOCK_ID SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE PAGE_STATE IO_FIX IS_OLD FREE_PAGE_CLOCK
BLOCK_ID SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE PAGE_STATE IO_FIX IS_OLD FREE_PAGE_CLOCK
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_buffer_page but the InnoDB storage engine is not installed
select * from information_schema.innodb_buffer_page_lru;
POOL_ID LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK
LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK
Warnings:
Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_buffer_page_lru but the InnoDB storage engine is not installed
select * from information_schema.innodb_buffer_stats;
Expand Down
100 changes: 0 additions & 100 deletions mysql-test/suite/innodb/t/innodb-page-cleaners.test

This file was deleted.

1 change: 0 additions & 1 deletion mysql-test/suite/innodb_i_s/innodb_buffer_page.result
@@ -1,7 +1,6 @@
SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
Table Create Table
INNODB_BUFFER_PAGE CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE` (
`POOL_ID` int(11) unsigned NOT NULL DEFAULT 0,
`BLOCK_ID` bigint(21) unsigned NOT NULL DEFAULT 0,
`SPACE` int(11) unsigned NOT NULL DEFAULT 0,
`PAGE_NUMBER` int(11) unsigned NOT NULL DEFAULT 0,
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/innodb_i_s/innodb_buffer_page_lru.result
@@ -1,7 +1,6 @@
SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_BUFFER_PAGE_LRU;
Table Create Table
INNODB_BUFFER_PAGE_LRU CREATE TEMPORARY TABLE `INNODB_BUFFER_PAGE_LRU` (
`POOL_ID` int(11) unsigned NOT NULL DEFAULT 0,
`LRU_POSITION` bigint(21) unsigned NOT NULL DEFAULT 0,
`SPACE` int(11) unsigned NOT NULL DEFAULT 0,
`PAGE_NUMBER` int(11) unsigned NOT NULL DEFAULT 0,
Expand Down
@@ -1,7 +1,6 @@
SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
Table Create Table
INNODB_BUFFER_POOL_STATS CREATE TEMPORARY TABLE `INNODB_BUFFER_POOL_STATS` (
`POOL_ID` int(11) unsigned NOT NULL DEFAULT 0,
`POOL_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0,
`FREE_BUFFERS` bigint(21) unsigned NOT NULL DEFAULT 0,
`DATABASE_PAGES` bigint(21) unsigned NOT NULL DEFAULT 0,
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/innodb_i_s/innodb_cmpmem.result
Expand Up @@ -2,7 +2,6 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMPMEM;
Table Create Table
INNODB_CMPMEM CREATE TEMPORARY TABLE `INNODB_CMPMEM` (
`page_size` int(5) NOT NULL DEFAULT 0,
`buffer_pool_instance` int(11) NOT NULL DEFAULT 0,
`pages_used` int(11) NOT NULL DEFAULT 0,
`pages_free` int(11) NOT NULL DEFAULT 0,
`relocation_ops` bigint(21) NOT NULL DEFAULT 0,
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/innodb_i_s/innodb_cmpmem_reset.result
Expand Up @@ -2,7 +2,6 @@ SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_CMPMEM_RESET;
Table Create Table
INNODB_CMPMEM_RESET CREATE TEMPORARY TABLE `INNODB_CMPMEM_RESET` (
`page_size` int(5) NOT NULL DEFAULT 0,
`buffer_pool_instance` int(11) NOT NULL DEFAULT 0,
`pages_used` int(11) NOT NULL DEFAULT 0,
`pages_free` int(11) NOT NULL DEFAULT 0,
`relocation_ops` bigint(21) NOT NULL DEFAULT 0,
Expand Down
16 changes: 12 additions & 4 deletions mysql-test/suite/sys_vars/r/innodb_page_cleaners_basic.result
Expand Up @@ -7,32 +7,40 @@ SELECT @@innodb_page_cleaners;
1
1 Expected
SET @@GLOBAL.innodb_page_cleaners=2;
Warnings:
Warning 138 The parameter innodb_page_cleaners is deprecated and has no effect.
Expected to pass
SELECT @@innodb_page_cleaners;
@@innodb_page_cleaners
2
1
2 Expected
SET @@GLOBAL.innodb_page_cleaners=1;
Warnings:
Warning 138 The parameter innodb_page_cleaners is deprecated and has no effect.
Expected to pass
SELECT @@innodb_page_cleaners;
@@innodb_page_cleaners
1
1 Expected
SET @@GLOBAL.innodb_page_cleaners=6;
Warnings:
Warning 138 The parameter innodb_page_cleaners is deprecated and has no effect.
Expected to pass
SELECT @@innodb_page_cleaners;
@@innodb_page_cleaners
6
1
6 Expected
SET @@GLOBAL.innodb_page_cleaners=4;
Warnings:
Warning 138 The parameter innodb_page_cleaners is deprecated and has no effect.
Expected to pass
SELECT @@innodb_page_cleaners;
@@innodb_page_cleaners
4
1
4 Expected
SET @@GLOBAL.innodb_page_cleaners=0;
Warnings:
Warning 1292 Truncated incorrect innodb_page_cleaners value: '0'
Warning 138 The parameter innodb_page_cleaners is deprecated and has no effect.
Warning expected
SELECT @@innodb_page_cleaners;
@@innodb_page_cleaners
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
Expand Up @@ -42,7 +42,7 @@
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Size of a single memory chunk within each buffer pool instance for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
VARIABLE_COMMENT Size of a single memory chunk for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
NUMERIC_MIN_VALUE 1048576
-NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_MAX_VALUE 2147483647
Expand All @@ -64,7 +64,7 @@
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Number of buffer pool instances, set to higher value on high-end machines to increase scalability
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
@@ -289,7 +289,7 @@
Expand Down Expand Up @@ -377,8 +377,8 @@
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Page cleaner threads can be from 1 to 64. Default is 4.
NUMERIC_MIN_VALUE 1
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
@@ -1513,7 +1513,7 @@
SESSION_VALUE NULL
Expand Down
10 changes: 5 additions & 5 deletions mysql-test/suite/sys_vars/r/sysvars_innodb.result
Expand Up @@ -158,7 +158,7 @@ SESSION_VALUE NULL
DEFAULT_VALUE 134217728
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of a single memory chunk within each buffer pool instance for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
VARIABLE_COMMENT Size of a single memory chunk for resizing buffer pool. Online buffer pool resizing happens at this granularity. 0 means disable resizing buffer pool.
NUMERIC_MIN_VALUE 1048576
NUMERIC_MAX_VALUE 9223372036854775807
NUMERIC_BLOCK_SIZE 1048576
Expand Down Expand Up @@ -230,7 +230,7 @@ SESSION_VALUE NULL
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Number of buffer pool instances, set to higher value on high-end machines to increase scalability
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
NUMERIC_BLOCK_SIZE 0
Expand Down Expand Up @@ -1487,11 +1487,11 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_PAGE_CLEANERS
SESSION_VALUE NULL
DEFAULT_VALUE 4
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Page cleaner threads can be from 1 to 64. Default is 4.
NUMERIC_MIN_VALUE 1
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 64
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
Expand Down
Expand Up @@ -2,5 +2,4 @@
--loose-innodb_buffer_pool_load_at_startup=0
--loose-innodb_buffer_pool_dump_at_shutdown=0
--loose-innodb-buffer-pool-size=8M
--loose-innodb-buffer-pool-instances=1
--loose-innodb-page-size=16k
3 changes: 1 addition & 2 deletions storage/innobase/btr/btr0btr.cc
Expand Up @@ -1391,7 +1391,6 @@ btr_page_reorganize_low(
mtr_t* mtr) /*!< in/out: mini-transaction */
{
buf_block_t* block = page_cur_get_block(cursor);
buf_pool_t* buf_pool = buf_pool_from_bpage(&block->page);
page_t* page = buf_block_get_frame(block);
page_zip_des_t* page_zip = buf_block_get_page_zip(block);
buf_block_t* temp_block;
Expand Down Expand Up @@ -1420,7 +1419,7 @@ btr_page_reorganize_low(
/* Turn logging off */
mtr_log_t log_mode = mtr_set_log_mode(mtr, MTR_LOG_NONE);

temp_block = buf_block_alloc(buf_pool);
temp_block = buf_block_alloc();

MONITOR_INC(MONITOR_INDEX_REORG_ATTEMPTS);

Expand Down

0 comments on commit 1a6f708

Please sign in to comment.