From bda40ccb854cc1531ec7bd1ab779504c7e00bd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 28 Aug 2024 07:18:03 +0300 Subject: [PATCH] MDEV-34803 innodb_lru_flush_size is no longer used In commit fa8a46eb68299776589e769844372813ebb16a99 (MDEV-33613) the parameter innodb_lru_flush_size ceased to have any effect. Let us declare the parameter as deprecated and additionally as MARIADB_REMOVED_OPTION, so that there will be a warning written to the error log in case the option is specified in the command line. Let us also do the same for the parameter innodb_purge_rseg_truncate_frequency that was deprecated&ignored earlier in MDEV-32050. Reviewed by: Debarun Banerjee --- .../suite/sys_vars/r/sysvars_innodb,32bit.rdiff | 2 +- .../suite/sys_vars/r/sysvars_innodb.result | 6 +++--- sql/mysqld.cc | 2 ++ storage/innobase/buf/buf0lru.cc | 13 +++---------- storage/innobase/handler/ha_innodb.cc | 16 +++++++++------- storage/innobase/include/buf0lru.h | 13 +++---------- 6 files changed, 21 insertions(+), 31 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff index 71e745369e3..531bae3fbdd 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff @@ -241,7 +241,7 @@ VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED - VARIABLE_COMMENT How many pages to flush on LRU eviction + VARIABLE_COMMENT Deprecated parameter with no effect NUMERIC_MIN_VALUE 1 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MAX_VALUE 4294967295 diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 893761e0ce8..0ed1051a393 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1044,13 +1044,13 @@ SESSION_VALUE NULL DEFAULT_VALUE 32 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT How many pages to flush on LRU eviction +VARIABLE_COMMENT Deprecated parameter with no effect NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 18446744073709551615 NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO -COMMAND_LINE_ARGUMENT REQUIRED +COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME INNODB_LRU_SCAN_DEPTH SESSION_VALUE NULL DEFAULT_VALUE 1536 @@ -1314,7 +1314,7 @@ NUMERIC_MAX_VALUE 128 NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO -COMMAND_LINE_ARGUMENT OPTIONAL +COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME INNODB_PURGE_THREADS SESSION_VALUE NULL DEFAULT_VALUE 4 diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 110e2c29797..8c1def600b2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5262,7 +5262,9 @@ static int init_server_components() MARIADB_REMOVED_OPTION("innodb-log-compressed-pages"), MARIADB_REMOVED_OPTION("innodb-log-files-in-group"), MARIADB_REMOVED_OPTION("innodb-log-optimize-ddl"), + MARIADB_REMOVED_OPTION("innodb-lru-flush-size"), MARIADB_REMOVED_OPTION("innodb-page-cleaners"), + MARIADB_REMOVED_OPTION("innodb-purge-truncate-frequency"), MARIADB_REMOVED_OPTION("innodb-replication-delay"), MARIADB_REMOVED_OPTION("innodb-scrub-log"), MARIADB_REMOVED_OPTION("innodb-scrub-log-speed"), diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 9ffd4c5db20..49a088b425f 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -39,9 +39,6 @@ Created 11/5/1995 Heikki Tuuri #include "srv0mon.h" #include "my_cpu.h" -/** Flush this many pages in buf_LRU_get_free_block() */ -size_t innodb_lru_flush_size; - /** The number of blocks from the LRU_old pointer onward, including the block pointed to, must be buf_pool.LRU_old_ratio/BUF_LRU_OLD_RATIO_DIV of the whole LRU list length, except that the tolerance defined below @@ -369,17 +366,13 @@ block to read in a page. Note that we only ever get a block from the free list. Even when we flush a page or find a page in LRU scan we put it to free list to be used. * iteration 0: - * get a block from the buf_pool.free list, success:done + * get a block from the buf_pool.free list * if buf_pool.try_LRU_scan is set * scan LRU up to 100 pages to free a clean block * success:retry the free list - * flush up to innodb_lru_flush_size LRU blocks to data files - (until UT_LIST_GET_GEN(buf_pool.free) < innodb_lru_scan_depth) - * on buf_page_write_complete() the blocks will put on buf_pool.free list - * success: retry the free list + * invoke buf_pool.page_cleaner_wakeup(true) and wait its completion * subsequent iterations: same as iteration 0 except: - * scan whole LRU list - * scan LRU list even if buf_pool.try_LRU_scan is not set + * scan the entire LRU list @param have_mutex whether buf_pool.mutex is already being held @return the free control block, in state BUF_BLOCK_MEMORY */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f569f4ba6d1..9869d0d0356 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19251,11 +19251,6 @@ static MYSQL_SYSVAR_ULONG(lru_scan_depth, srv_LRU_scan_depth, "How deep to scan LRU to keep it clean", NULL, NULL, 1536, 100, ~0UL, 0); -static MYSQL_SYSVAR_SIZE_T(lru_flush_size, innodb_lru_flush_size, - PLUGIN_VAR_RQCMDARG, - "How many pages to flush on LRU eviction", - NULL, NULL, 32, 1, SIZE_T_MAX, 0); - static MYSQL_SYSVAR_ULONG(flush_neighbors, srv_flush_neighbors, PLUGIN_VAR_OPCMDARG, "Set to 0 (don't flush neighbors from buffer pool)," @@ -19468,14 +19463,21 @@ static MYSQL_SYSVAR_ULONGLONG(max_undo_log_size, srv_max_undo_log_size, 10 << 20, 10 << 20, 1ULL << (32 + UNIV_PAGE_SIZE_SHIFT_MAX), 0); -static ulong innodb_purge_rseg_truncate_frequency; +static ulong innodb_purge_rseg_truncate_frequency= 128; static MYSQL_SYSVAR_ULONG(purge_rseg_truncate_frequency, innodb_purge_rseg_truncate_frequency, - PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_DEPRECATED, + PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_DEPRECATED | PLUGIN_VAR_NOCMDOPT, "Deprecated parameter with no effect", NULL, NULL, 128, 1, 128, 0); +static size_t innodb_lru_flush_size; + +static MYSQL_SYSVAR_SIZE_T(lru_flush_size, innodb_lru_flush_size, + PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED | PLUGIN_VAR_NOCMDOPT, + "Deprecated parameter with no effect", + NULL, NULL, 32, 1, SIZE_T_MAX, 0); + static void innodb_undo_log_truncate_update(THD *thd, struct st_mysql_sys_var*, void*, const void *save) { diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h index 28410276217..53a5f136fd2 100644 --- a/storage/innobase/include/buf0lru.h +++ b/storage/innobase/include/buf0lru.h @@ -33,9 +33,6 @@ Created 11/5/1995 Heikki Tuuri struct trx_t; struct fil_space_t; -/** Flush this many pages in buf_LRU_get_free_block() */ -extern size_t innodb_lru_flush_size; - /*####################################################################### These are low-level functions #########################################################################*/ @@ -71,17 +68,13 @@ block to read in a page. Note that we only ever get a block from the free list. Even when we flush a page or find a page in LRU scan we put it to free list to be used. * iteration 0: - * get a block from the buf_pool.free list, success:done + * get a block from the buf_pool.free list * if buf_pool.try_LRU_scan is set * scan LRU up to 100 pages to free a clean block * success:retry the free list - * flush up to innodb_lru_flush_size LRU blocks to data files - (until UT_LIST_GET_GEN(buf_pool.free) < innodb_lru_scan_depth) - * on buf_page_write_complete() the blocks will put on buf_pool.free list - * success: retry the free list + * invoke buf_pool.page_cleaner_wakeup(true) and wait its completion * subsequent iterations: same as iteration 0 except: - * scan whole LRU list - * scan LRU list even if buf_pool.try_LRU_scan is not set + * scan the entire LRU list @param have_mutex whether buf_pool.mutex is already being held @return the free control block, in state BUF_BLOCK_MEMORY */