Commit 016c35a7 authored by Jan Lindström's avatar Jan Lindström

MDEV-13690: Remove unnecessary innodb_use_mtflush, innodb_mtflush_threads...

MDEV-13690: Remove unnecessary innodb_use_mtflush, innodb_mtflush_threads parameters and related code

Users can use innodb-page-cleaners instead.
parent 9ff7129f
select @@global.innodb_mtflush_threads;
@@global.innodb_mtflush_threads
8
select @@session.innodb_mtflush_threads;
ERROR HY000: Variable 'innodb_mtflush_threads' is a GLOBAL variable
show global variables like 'innodb_mtflush_threads';
Variable_name Value
innodb_mtflush_threads 8
show session variables like 'innodb_mtflush_threads';
Variable_name Value
innodb_mtflush_threads 8
select * from information_schema.global_variables where variable_name='innodb_mtflush_threads';
VARIABLE_NAME VARIABLE_VALUE
INNODB_MTFLUSH_THREADS 8
select * from information_schema.session_variables where variable_name='innodb_mtflush_threads';
VARIABLE_NAME VARIABLE_VALUE
INNODB_MTFLUSH_THREADS 8
set global innodb_mtflush_threads=1;
ERROR HY000: Variable 'innodb_mtflush_threads' is a read only variable
set session innodb_mtflush_threads=1;
ERROR HY000: Variable 'innodb_mtflush_threads' is a read only variable
select @@global.innodb_use_mtflush;
@@global.innodb_use_mtflush
0
select @@session.innodb_use_mtflush;
ERROR HY000: Variable 'innodb_use_mtflush' is a GLOBAL variable
show global variables like 'innodb_use_mtflush';
Variable_name Value
innodb_use_mtflush OFF
show session variables like 'innodb_use_mtflush';
Variable_name Value
innodb_use_mtflush OFF
select * from information_schema.global_variables where variable_name='innodb_use_mtflush';
VARIABLE_NAME VARIABLE_VALUE
INNODB_USE_MTFLUSH OFF
select * from information_schema.session_variables where variable_name='innodb_use_mtflush';
VARIABLE_NAME VARIABLE_VALUE
INNODB_USE_MTFLUSH OFF
set global innodb_use_mtflush=1;
ERROR HY000: Variable 'innodb_use_mtflush' is a read only variable
set session innodb_use_mtflush=1;
ERROR HY000: Variable 'innodb_use_mtflush' is a read only variable
......@@ -364,15 +364,6 @@
VARIABLE_COMMENT Maximum delay of user threads in micro-seconds
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 10000000
@@ -1636,7 +1636,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT
+VARIABLE_TYPE INT
VARIABLE_COMMENT DEPRECATED. Number of multi-threaded flush threads
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
@@ -1692,10 +1692,10 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
......
......@@ -1630,20 +1630,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_MTFLUSH_THREADS
SESSION_VALUE NULL
GLOBAL_VALUE 8
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT
VARIABLE_COMMENT DEPRECATED. Number of multi-threaded flush threads
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 64
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_OLD_BLOCKS_PCT
SESSION_VALUE NULL
GLOBAL_VALUE 37
......@@ -2442,20 +2428,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_USE_MTFLUSH
SESSION_VALUE NULL
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT DEPRECATED. Use multi-threaded flush. Default FALSE.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT NONE
VARIABLE_NAME INNODB_VERSION
SESSION_VALUE NULL
GLOBAL_VALUE 5.7.19
......
--source include/have_innodb.inc
# bool readonly
#
# show values;
#
select @@global.innodb_mtflush_threads;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_mtflush_threads;
show global variables like 'innodb_mtflush_threads';
show session variables like 'innodb_mtflush_threads';
select * from information_schema.global_variables where variable_name='innodb_mtflush_threads';
select * from information_schema.session_variables where variable_name='innodb_mtflush_threads';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_mtflush_threads=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session innodb_mtflush_threads=1;
--source include/have_innodb.inc
# bool readonly
#
# show values;
#
select @@global.innodb_use_mtflush;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_use_mtflush;
show global variables like 'innodb_use_mtflush';
show session variables like 'innodb_use_mtflush';
select * from information_schema.global_variables where variable_name='innodb_use_mtflush';
select * from information_schema.session_variables where variable_name='innodb_use_mtflush';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_use_mtflush=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session innodb_use_mtflush=1;
......@@ -36,7 +36,6 @@ SET(INNOBASE_SOURCES
buf/buf0flu.cc
buf/buf0lru.cc
buf/buf0rea.cc
buf/buf0mtflu.cc
data/data0data.cc
data/data0type.cc
dict/dict0boot.cc
......
......@@ -31,7 +31,6 @@ Created 11/11/1995 Heikki Tuuri
#include "buf0flu.h"
#include "buf0buf.h"
#include "buf0mtflu.h"
#include "buf0checksum.h"
#include "srv0start.h"
#include "srv0srv.h"
......@@ -2142,10 +2141,6 @@ buf_flush_lists(
ulint n_flushed = 0;
bool success = true;
if (buf_mtflu_init_done()) {
return(buf_mtflu_flush_list(min_n, lsn_limit, n_processed));
}
if (n_processed) {
*n_processed = 0;
}
......@@ -2304,11 +2299,6 @@ buf_flush_LRU_list(
memset(&n, 0, sizeof(flush_counters_t));
if(buf_mtflu_init_done())
{
return(buf_mtflu_flush_LRU_tail());
}
ut_ad(buf_pool);
/* srv_LRU_scan_depth can be arbitrarily large value.
We cap it with current LRU size. */
......
This diff is collapsed.
......@@ -3645,16 +3645,6 @@ static uint innobase_partition_flags()
return (0);
}
static const char* deprecated_use_mtflush
= "Using innodb_use_mtflush is deprecated"
" and the parameter will be removed in MariaDB 10.3."
" Use innodb-page-cleaners instead. ";
static const char* deprecated_mtflush_threads
= "Using innodb_mtflush_threads is deprecated"
" and the parameter will be removed in MariaDB 10.3."
" Use innodb-page-cleaners instead. ";
/** Update log_checksum_algorithm_ptr with a pointer to the function
corresponding to whether checksums are enabled.
@param[in,out] thd client session, or NULL if at startup
......@@ -3992,14 +3982,6 @@ innobase_init(
DBUG_RETURN(innobase_init_abort());
}
if (srv_use_mtflush) {
ib::warn() << deprecated_use_mtflush;
}
if (srv_use_mtflush && srv_mtflush_threads != MTFLUSH_DEFAULT_WORKER) {
ib::warn() << deprecated_mtflush_threads;
}
if (innobase_change_buffering) {
ulint use;
......@@ -21012,20 +20994,6 @@ static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
PAGE_ZLIB_ALGORITHM,
&page_compression_algorithms_typelib);
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"DEPRECATED. Number of multi-threaded flush threads",
NULL, NULL,
MTFLUSH_DEFAULT_WORKER, /* Default setting */
1, /* Minimum setting */
MTFLUSH_MAX_WORKER, /* Max setting */
0);
static MYSQL_SYSVAR_BOOL(use_mtflush, srv_use_mtflush,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"DEPRECATED. Use multi-threaded flush. Default FALSE.",
NULL, NULL, FALSE);
static MYSQL_SYSVAR_ULONG(fatal_semaphore_wait_threshold, srv_fatal_semaphore_wait_threshold,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Maximum number of seconds that semaphore times out in InnoDB.",
......@@ -21324,8 +21292,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
/* Table page compression feature */
MYSQL_SYSVAR(compression_default),
MYSQL_SYSVAR(compression_algorithm),
MYSQL_SYSVAR(mtflush_threads),
MYSQL_SYSVAR(use_mtflush),
/* Encryption feature */
MYSQL_SYSVAR(encrypt_tables),
MYSQL_SYSVAR(encryption_threads),
......
/*****************************************************************************
Copyright (C) 2014 SkySQL Ab. All Rights Reserved.
Copyright (C) 2014 Fusion-io. All Rights Reserved.
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-1301 USA
*****************************************************************************/
/******************************************************************//**
@file include/buf0mtflu.h
Multi-threadef flush method interface function prototypes
Created 06/02/2014 Jan Lindström jan.lindstrom@skysql.com
Dhananjoy Das DDas@fusionio.com
***********************************************************************/
#ifndef buf0mtflu_h
#define buf0mtflu_h
/******************************************************************//**
Add exit work item to work queue to signal multi-threded flush
threads that they should exit.
*/
void
buf_mtflu_io_thread_exit(void);
/*===========================*/
/******************************************************************//**
Initialize multi-threaded flush thread syncronization data.
@return Initialized multi-threaded flush thread syncroniztion data. */
void*
buf_mtflu_handler_init(
/*===================*/
ulint n_threads, /*!< in: Number of threads to create */
ulint wrk_cnt); /*!< in: Number of work items */
/******************************************************************//**
Return true if multi-threaded flush is initialized
@return true if initialized, false if not */
bool
buf_mtflu_init_done(void);
/*======================*/
/*********************************************************************//**
Clears up tail of the LRU lists:
* Put replaceable pages at the tail of LRU to the free list
* Flush dirty pages at the tail of LRU to the disk
The depth to which we scan each buffer pool is controlled by dynamic
config parameter innodb_LRU_scan_depth.
@return total pages flushed */
UNIV_INTERN
ulint
buf_mtflu_flush_LRU_tail(void);
/*===========================*/
/*******************************************************************//**
Multi-threaded version of buf_flush_list
*/
bool
buf_mtflu_flush_list(
/*=================*/
ulint min_n, /*!< in: wished minimum mumber of blocks
flushed (it is not guaranteed that the
actual number is that big, though) */
lsn_t lsn_limit, /*!< in the case BUF_FLUSH_LIST all
blocks whose oldest_modification is
smaller than this should be flushed
(if their number does not exceed
min_n), otherwise ignored */
ulint* n_processed); /*!< out: the number of pages
which were processed is passed
back to caller. Ignored if NULL */
/*********************************************************************//**
Set correct thread identifiers to io thread array based on
information we have. */
void
buf_mtflu_set_thread_ids(
/*=====================*/
ulint n_threads, /*!<in: Number of threads to fill */
void* ctx, /*!<in: thread context */
os_thread_id_t* thread_ids); /*!<in: thread id array */
#endif
......@@ -275,16 +275,6 @@ extern my_bool srv_use_atomic_writes;
/* Compression algorithm*/
extern ulong innodb_compression_algorithm;
/* Number of flush threads */
#define MTFLUSH_MAX_WORKER 64
#define MTFLUSH_DEFAULT_WORKER 8
/* Number of threads used for multi-threaded flush */
extern long srv_mtflush_threads;
/* If this flag is TRUE, then we will use multi threaded flush. */
extern my_bool srv_use_mtflush;
/** TRUE if the server was successfully started */
extern bool srv_was_started;
......
......@@ -379,8 +379,6 @@ enum latch_id_t {
LATCH_ID_SCRUB_STAT_MUTEX,
LATCH_ID_DEFRAGMENT_MUTEX,
LATCH_ID_BTR_DEFRAGMENT_MUTEX,
LATCH_ID_MTFLUSH_THREAD_MUTEX,
LATCH_ID_MTFLUSH_MUTEX,
LATCH_ID_FIL_CRYPT_MUTEX,
LATCH_ID_FIL_CRYPT_STAT_MUTEX,
LATCH_ID_FIL_CRYPT_DATA_MUTEX,
......
......@@ -172,10 +172,6 @@ my_bool srv_numa_interleave;
my_bool srv_use_atomic_writes;
/** innodb_compression_algorithm; used with page compression */
ulong innodb_compression_algorithm;
/** innodb_mtflush_threads; number of threads used for multi-threaded flush */
long srv_mtflush_threads;
/** innodb_use_mtflush; whether to use multi threaded flush. */
my_bool srv_use_mtflush;
#ifdef UNIV_DEBUG
/** Used by SET GLOBAL innodb_master_thread_disabled_debug = X. */
......
......@@ -83,7 +83,6 @@ Created 2/16/1996 Heikki Tuuri
#include "os0proc.h"
#include "buf0flu.h"
#include "buf0rea.h"
#include "buf0mtflu.h"
#include "dict0boot.h"
#include "dict0load.h"
#include "dict0stats_bg.h"
......@@ -191,9 +190,7 @@ static ulint n[SRV_MAX_N_IO_THREADS + 6];
/** io_handler_thread identifiers, 32 is the maximum number of purge threads */
/** 6 is the ? */
#define START_OLD_THREAD_CNT (SRV_MAX_N_IO_THREADS + 6 + 32)
static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + 32 + MTFLUSH_MAX_WORKER];
/* Thread contex data for multi-threaded flush */
void *mtflush_ctx=NULL;
static os_thread_id_t thread_ids[SRV_MAX_N_IO_THREADS + 6 + 32];
/** Thead handles */
static os_thread_t thread_handles[SRV_MAX_N_IO_THREADS + 6 + 32];
......@@ -1307,10 +1304,6 @@ srv_shutdown_all_bg_threads()
}
os_event_set(buf_flush_event);
if (srv_use_mtflush) {
buf_mtflu_io_thread_exit();
}
}
if (!os_thread_count) {
......@@ -2633,19 +2626,6 @@ innobase_start_or_create_for_mysql()
if (!srv_read_only_mode) {
/* wake main loop of page cleaner up */
os_event_set(buf_flush_event);
if (srv_use_mtflush) {
/* Start multi-threaded flush threads */
mtflush_ctx = buf_mtflu_handler_init(
srv_mtflush_threads,
srv_buf_pool_instances);
/* Set up the thread ids */
buf_mtflu_set_thread_ids(
srv_mtflush_threads,
mtflush_ctx,
(thread_ids + 6 + 32));
}
}
if (srv_print_verbose_log) {
......
......@@ -1552,10 +1552,6 @@ sync_latch_meta_init()
PFS_NOT_INSTRUMENTED);
LATCH_ADD_MUTEX(BTR_DEFRAGMENT_MUTEX, SYNC_NO_ORDER_CHECK,
PFS_NOT_INSTRUMENTED);
LATCH_ADD_MUTEX(MTFLUSH_THREAD_MUTEX, SYNC_NO_ORDER_CHECK,
PFS_NOT_INSTRUMENTED);
LATCH_ADD_MUTEX(MTFLUSH_MUTEX, SYNC_NO_ORDER_CHECK,
PFS_NOT_INSTRUMENTED);
LATCH_ADD_MUTEX(FIL_CRYPT_MUTEX, SYNC_NO_ORDER_CHECK,
PFS_NOT_INSTRUMENTED);
LATCH_ADD_MUTEX(FIL_CRYPT_STAT_MUTEX, SYNC_NO_ORDER_CHECK,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment