[Commits] 7b9029b17fe: Remove innodb_use_trim, innodb_instrument_semaphores.

marko.makela at mariadb.com marko.makela at mariadb.com
Wed Mar 1 11:43:12 EET 2017


revision-id: 7b9029b17fe055bafd60d34eeedcead86dd98af5 (mariadb-10.2.2-164-g7b9029b17fe)
parent(s): 7a9dc5ab3aa477757bf52f3ce0febe62e3980f54
author: Marko Mäkelä
committer: Marko Mäkelä
timestamp: 2017-03-01 11:41:13 +0200
message:

Remove innodb_use_trim, innodb_instrument_semaphores.

MDEV-11254 deprecated innodb_use_trim in 10.2.

MDEV-12146 deprecated innodb_instrument_semaphores in 10.2.

---
 mysql-test/suite/innodb/t/innodb-trim.opt          |  1 -
 .../r/innodb_instrument_semaphores_basic.result    | 57 ------------------
 .../suite/sys_vars/r/innodb_use_trim_basic.result  | 37 ------------
 mysql-test/suite/sys_vars/r/sysvars_innodb.result  | 30 +---------
 .../t/innodb_instrument_semaphores_basic.test      | 42 -------------
 .../suite/sys_vars/t/innodb_use_trim_basic.test    | 36 ------------
 storage/innobase/fil/fil0pagecompress.cc           |  7 ---
 storage/innobase/handler/ha_innodb.cc              | 68 +---------------------
 storage/innobase/include/os0file.h                 | 10 ++--
 storage/innobase/include/srv0srv.h                 |  3 -
 storage/innobase/os/os0file.cc                     |  2 +-
 storage/innobase/srv/srv0srv.cc                    |  3 -
 12 files changed, 7 insertions(+), 289 deletions(-)

diff --git a/mysql-test/suite/innodb/t/innodb-trim.opt b/mysql-test/suite/innodb/t/innodb-trim.opt
deleted file mode 100644
index c33d075b002..00000000000
--- a/mysql-test/suite/innodb/t/innodb-trim.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-use-trim=1
diff --git a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result b/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result
deleted file mode 100644
index 561ddeb5a84..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_instrument_semaphores_basic.result
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# innodb_instrument_semaphores
-#
-# save the initial value
-SET @innodb_instrument_semaphores_global_saved = @@global.innodb_instrument_semaphores;
-# default
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-0
-
-# scope
-SELECT @@session.innodb_instrument_semaphores;
-ERROR HY000: Variable 'innodb_instrument_semaphores' is a GLOBAL variable
-SET @@global.innodb_instrument_semaphores=OFF;
-Warnings:
-Warning	131	Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-0
-SET @@global.innodb_instrument_semaphores=ON;
-Warnings:
-Warning	131	Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-1
-
-# valid values
-SET @@global.innodb_instrument_semaphores='OFF';
-Warnings:
-Warning	131	Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-0
-SET @@global.innodb_instrument_semaphores=ON;
-Warnings:
-Warning	131	Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-1
-SET @@global.innodb_instrument_semaphores=default;
-Warnings:
-Warning	131	Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_instrument_semaphores;
-@@global.innodb_instrument_semaphores
-0
-
-# invalid values
-SET @@global.innodb_instrument_semaphores=NULL;
-ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'NULL'
-SET @@global.innodb_instrument_semaphores='junk';
-ERROR 42000: Variable 'innodb_instrument_semaphores' can't be set to the value of 'junk'
-
-# restore the initial value
-SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved;
-Warnings:
-Warning	131	Using innodb_instrument_semaphores is deprecated and the parameter will be removed in MariaDB 10.3.
-# End of test
diff --git a/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result b/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result
deleted file mode 100644
index 855bccad522..00000000000
--- a/mysql-test/suite/sys_vars/r/innodb_use_trim_basic.result
+++ /dev/null
@@ -1,37 +0,0 @@
-SET @start_use_trim = @@global.innodb_use_trim;
-SELECT @start_use_trim;
- at start_use_trim
-1
-SELECT COUNT(@@GLOBAL.innodb_use_trim);
-COUNT(@@GLOBAL.innodb_use_trim)
-1
-1 Expected
-SET @@GLOBAL.innodb_use_trim=1;
-Warnings:
-Warning	131	Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT COUNT(@@GLOBAL.innodb_use_trim);
-COUNT(@@GLOBAL.innodb_use_trim)
-1
-1 Expected
-SELECT IF(@@GLOBAL.innodb_use_trim, 'ON', 'OFF') = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_use_trim';
-IF(@@GLOBAL.innodb_use_trim, 'ON', 'OFF') = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.innodb_use_trim);
-COUNT(@@GLOBAL.innodb_use_trim)
-1
-1 Expected
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='innodb_use_trim';
-COUNT(VARIABLE_VALUE)
-1
-1 Expected
-SET @@global.innodb_use_trim = @start_use_trim;
-Warnings:
-Warning	131	Using innodb_use_trim is deprecated and the parameter will be removed in MariaDB 10.3.
-SELECT @@global.innodb_use_trim;
-@@global.innodb_use_trim
-1
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index b0a92f1ce21..019402004b9 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -1294,20 +1294,6 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	OFF,ON
 READ_ONLY	NO
 COMMAND_LINE_ARGUMENT	REQUIRED
-VARIABLE_NAME	INNODB_INSTRUMENT_SEMAPHORES
-SESSION_VALUE	NULL
-GLOBAL_VALUE	OFF
-GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	OFF
-VARIABLE_SCOPE	GLOBAL
-VARIABLE_TYPE	BOOLEAN
-VARIABLE_COMMENT	DEPRECATED. This setting has no effect.
-NUMERIC_MIN_VALUE	NULL
-NUMERIC_MAX_VALUE	NULL
-NUMERIC_BLOCK_SIZE	NULL
-ENUM_VALUE_LIST	OFF,ON
-READ_ONLY	NO
-COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_IO_CAPACITY
 SESSION_VALUE	NULL
 GLOBAL_VALUE	200
@@ -2491,7 +2477,7 @@ GLOBAL_VALUE_ORIGIN	COMPILE-TIME
 DEFAULT_VALUE	ON
 VARIABLE_SCOPE	GLOBAL
 VARIABLE_TYPE	BOOLEAN
-VARIABLE_COMMENT	Enable atomic writes, instead of using the doublewrite buffer, for files on devices that supports atomic writes. To use this option one must use file_per_table=1, flush_method=O_DIRECT and use_fallocate=1. This option only works on Linux with either FusionIO cards using the directFS filesystem or with Shannon cards using any file system.
+VARIABLE_COMMENT	Enable atomic writes, instead of using the doublewrite buffer, for files on devices that supports atomic writes. To use this option one must use innodb_file_per_table=1, innodb_flush_method=O_DIRECT. This option only works on Linux with either FusionIO cards using the directFS filesystem or with Shannon cards using any file system.
 NUMERIC_MIN_VALUE	NULL
 NUMERIC_MAX_VALUE	NULL
 NUMERIC_BLOCK_SIZE	NULL
@@ -2512,20 +2498,6 @@ NUMERIC_BLOCK_SIZE	NULL
 ENUM_VALUE_LIST	OFF,ON
 READ_ONLY	YES
 COMMAND_LINE_ARGUMENT	NONE
-VARIABLE_NAME	INNODB_USE_TRIM
-SESSION_VALUE	NULL
-GLOBAL_VALUE	ON
-GLOBAL_VALUE_ORIGIN	COMPILE-TIME
-DEFAULT_VALUE	ON
-VARIABLE_SCOPE	GLOBAL
-VARIABLE_TYPE	BOOLEAN
-VARIABLE_COMMENT	Deallocate (punch_hole|trim) unused portions of the page compressed page (on by default)
-NUMERIC_MIN_VALUE	NULL
-NUMERIC_MAX_VALUE	NULL
-NUMERIC_BLOCK_SIZE	NULL
-ENUM_VALUE_LIST	OFF,ON
-READ_ONLY	NO
-COMMAND_LINE_ARGUMENT	OPTIONAL
 VARIABLE_NAME	INNODB_VERSION
 SESSION_VALUE	NULL
 GLOBAL_VALUE	5.7.14
diff --git a/mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test b/mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test
deleted file mode 100644
index 9b302be79b5..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_instrument_semaphores_basic.test
+++ /dev/null
@@ -1,42 +0,0 @@
---source include/have_innodb.inc
-
---echo #
---echo # innodb_instrument_semaphores
---echo #
-
---echo # save the initial value
-SET @innodb_instrument_semaphores_global_saved = @@global.innodb_instrument_semaphores;
-
---echo # default
-SELECT @@global.innodb_instrument_semaphores;
-
---echo
---echo # scope
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SELECT @@session.innodb_instrument_semaphores;
-SET @@global.innodb_instrument_semaphores=OFF;
-SELECT @@global.innodb_instrument_semaphores;
-SET @@global.innodb_instrument_semaphores=ON;
-SELECT @@global.innodb_instrument_semaphores;
-
---echo
---echo # valid values
-SET @@global.innodb_instrument_semaphores='OFF';
-SELECT @@global.innodb_instrument_semaphores;
-SET @@global.innodb_instrument_semaphores=ON;
-SELECT @@global.innodb_instrument_semaphores;
-SET @@global.innodb_instrument_semaphores=default;
-SELECT @@global.innodb_instrument_semaphores;
-
---echo
---echo # invalid values
---error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_instrument_semaphores=NULL;
---error ER_WRONG_VALUE_FOR_VAR
-SET @@global.innodb_instrument_semaphores='junk';
-
---echo
---echo # restore the initial value
-SET @@global.innodb_instrument_semaphores = @innodb_instrument_semaphores_global_saved;
-
---echo # End of test
diff --git a/mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test b/mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test
deleted file mode 100644
index c1b0f142179..00000000000
--- a/mysql-test/suite/sys_vars/t/innodb_use_trim_basic.test
+++ /dev/null
@@ -1,36 +0,0 @@
---source include/have_innodb.inc
-
-SET @start_use_trim = @@global.innodb_use_trim;
-SELECT @start_use_trim;
-
-SELECT COUNT(@@GLOBAL.innodb_use_trim);
---echo 1 Expected
-
-####################################################################
-#   Check if Value can set                                         #
-####################################################################
-
-SET @@GLOBAL.innodb_use_trim=1;
-
-SELECT COUNT(@@GLOBAL.innodb_use_trim);
---echo 1 Expected
-
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable  #
-#################################################################
-
-SELECT IF(@@GLOBAL.innodb_use_trim, 'ON', 'OFF') = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_use_trim';
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.innodb_use_trim);
---echo 1 Expected
-
-SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
-WHERE VARIABLE_NAME='innodb_use_trim';
---echo 1 Expected
-
-SET @@global.innodb_use_trim = @start_use_trim;
-SELECT @@global.innodb_use_trim;
\ No newline at end of file
diff --git a/storage/innobase/fil/fil0pagecompress.cc b/storage/innobase/fil/fil0pagecompress.cc
index 18f95c94d75..8c471d06b49 100644
--- a/storage/innobase/fil/fil0pagecompress.cc
+++ b/storage/innobase/fil/fil0pagecompress.cc
@@ -349,13 +349,6 @@ fil_compress_page(
 	srv_stats.page_compression_saved.add((len - write_size));
 	srv_stats.pages_page_compressed.inc();
 
-	/* If we do not persistently trim rest of page, we need to write it
-	all */
-	if (!srv_use_trim) {
-		memset(out_buf+write_size,0,len-write_size);
-		write_size = len;
-	}
-
 	*out_len = write_size;
 
 	if (allocated) {
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 3dba273cee2..9ea10ad5943 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -3748,18 +3748,6 @@ static const char*	deprecated_file_format_check
 static const char*	deprecated_file_format_max
 	= DEPRECATED_FORMAT_PARAMETER("innodb_file_format_max");
 
-/** Deprecation message about innodb_use_trim */
-static const char*	deprecated_use_trim
-	= "Using innodb_use_trim is deprecated"
-	" and the parameter will be removed in MariaDB 10.3.";
-
-/** Deprecation message about innodb_instrument_semaphores */
-static const char*	deprecated_instrument_semaphores
-	= "Using innodb_instrument_semaphores is deprecated"
-	" and the parameter will be removed in MariaDB 10.3.";
-
-static my_bool innodb_instrument_semaphores;
-
 /** 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
@@ -4115,10 +4103,6 @@ innobase_init(
 		ib::warn() << deprecated_file_format;
 	}
 
-	if (innodb_instrument_semaphores) {
-		ib::warn() << deprecated_instrument_semaphores;
-	}
-
 	/* Validate the file format by animal name */
 	if (innobase_file_format_name != NULL) {
 
@@ -20606,44 +20590,6 @@ wsrep_fake_trx_id(
 
 #endif /* WITH_WSREP */
 
-/** Update the innodb_use_trim parameter.
- at param[in]	thd	thread handle
- at param[in]	var	system variable
- at param[out]	var_ptr	current value
- at param[in]	save	immediate result from check function */
-static
-void
-innodb_use_trim_update(
-	THD*				thd,
-	struct st_mysql_sys_var*	var,
-	void*				var_ptr,
-	const void*			save)
-{
-	srv_use_trim = *static_cast<const my_bool*>(save);
-
-	push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
-		     HA_ERR_WRONG_COMMAND, deprecated_use_trim);
-}
-
-/** Update the innodb_instrument_sempahores parameter.
- at param[in]	thd	thread handle
- at param[in]	var	system variable
- at param[out]	var_ptr	current value
- at param[in]	save	immediate result from check function */
-static
-void
-innodb_instrument_semaphores_update(
-	THD*				thd,
-	struct st_mysql_sys_var*	var,
-	void*				var_ptr,
-	const void*			save)
-{
-	innodb_instrument_semaphores = *static_cast<const my_bool*>(save);
-
-	push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
-		     HA_ERR_WRONG_COMMAND, deprecated_instrument_semaphores);
-}
-
 /* plugin options */
 
 static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm,
@@ -20699,7 +20645,7 @@ static MYSQL_SYSVAR_BOOL(use_atomic_writes, innobase_use_atomic_writes,
   "Enable atomic writes, instead of using the doublewrite buffer, for files "
   "on devices that supports atomic writes. "
   "To use this option one must use "
-  "file_per_table=1, flush_method=O_DIRECT and use_fallocate=1. "
+  "innodb_file_per_table=1, innodb_flush_method=O_DIRECT. "
   "This option only works on Linux with either FusionIO cards using "
   "the directFS filesystem or with Shannon cards using any file system.",
   NULL, NULL, TRUE);
@@ -21702,11 +21648,6 @@ static MYSQL_SYSVAR_BOOL(force_primary_key,
   "Do not allow to create table without primary key (off by default)",
   NULL, NULL, FALSE);
 
-static MYSQL_SYSVAR_BOOL(use_trim, srv_use_trim,
-  PLUGIN_VAR_OPCMDARG,
-  "Deallocate (punch_hole|trim) unused portions of the page compressed page (on by default)",
-  NULL, innodb_use_trim_update, TRUE);
-
 static const char *page_compression_algorithms[]= { "none", "zlib", "lz4", "lzo", "lzma", "bzip2", "snappy", 0 };
 static TYPELIB page_compression_algorithms_typelib=
 {
@@ -21852,11 +21793,6 @@ static MYSQL_SYSVAR_BOOL(debug_force_scrubbing,
 			 NULL, NULL, FALSE);
 #endif /* UNIV_DEBUG */
 
-static MYSQL_SYSVAR_BOOL(instrument_semaphores, innodb_instrument_semaphores,
-  PLUGIN_VAR_OPCMDARG,
-  "DEPRECATED. This setting has no effect.",
-  NULL, innodb_instrument_semaphores_update, FALSE);
-
 static struct st_mysql_sys_var* innobase_system_variables[]= {
   MYSQL_SYSVAR(autoextend_increment),
   MYSQL_SYSVAR(buffer_pool_size),
@@ -22038,7 +21974,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
   MYSQL_SYSVAR(force_primary_key),
   MYSQL_SYSVAR(fatal_semaphore_wait_threshold),
   /* Table page compression feature */
-  MYSQL_SYSVAR(use_trim),
   MYSQL_SYSVAR(compression_default),
   MYSQL_SYSVAR(compression_algorithm),
   MYSQL_SYSVAR(mtflush_threads),
@@ -22061,7 +21996,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
 #ifdef UNIV_DEBUG
   MYSQL_SYSVAR(debug_force_scrubbing),
 #endif
-  MYSQL_SYSVAR(instrument_semaphores),
   MYSQL_SYSVAR(buf_dump_status_frequency),
   MYSQL_SYSVAR(background_thread),
   NULL
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h
index ffe7b1a48bf..a5ec87adefd 100644
--- a/storage/innobase/include/os0file.h
+++ b/storage/innobase/include/os0file.h
@@ -50,7 +50,6 @@ struct fil_node_t;
 struct fil_space_t;
 
 extern bool	os_has_said_disk_full;
-extern my_bool	srv_use_trim;
 
 /** Number of pending read operations */
 extern ulint	os_n_pending_reads;
@@ -240,7 +239,7 @@ class IORequest {
 		m_fil_node(NULL),
 		m_type(static_cast<uint16_t>(type))
 	{
-		if (!is_punch_hole_supported() || !srv_use_trim) {
+		if (!is_punch_hole_supported()) {
 			clear_punch_hole();
 		}
 	}
@@ -259,7 +258,7 @@ class IORequest {
 			set_punch_hole();
 		}
 
-		if (!is_punch_hole_supported() || !srv_use_trim) {
+		if (!is_punch_hole_supported()) {
 			clear_punch_hole();
 		}
 	}
@@ -346,7 +345,7 @@ class IORequest {
 	/** Set the punch hole flag */
 	void set_punch_hole()
 	{
-		if (is_punch_hole_supported() && srv_use_trim) {
+		if (is_punch_hole_supported()) {
 			m_type |= PUNCH_HOLE;
 		}
 	}
@@ -361,8 +360,7 @@ class IORequest {
 	@param[in] node			File node */
 	void set_fil_node(fil_node_t* node)
 	{
-		if (!srv_use_trim ||
-		   (node && !fil_node_should_punch_hole(node))) {
+		if (node && !fil_node_should_punch_hole(node)) {
 			clear_punch_hole();
 		}
 
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
index cbf01564cce..357ce658a80 100644
--- a/storage/innobase/include/srv0srv.h
+++ b/storage/innobase/include/srv0srv.h
@@ -279,9 +279,6 @@ Currently we support native aio on windows and linux */
 extern my_bool	srv_use_native_aio;
 extern my_bool	srv_numa_interleave;
 
-/* Use trim operation */
-extern my_bool srv_use_trim;
-
 /* Use atomic writes i.e disable doublewrite buffer */
 extern my_bool srv_use_atomic_writes;
 
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index 270bfa2887e..0630caec939 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -5533,7 +5533,7 @@ IORequest::punch_hole(
 
 	/* Check does file system support punching holes for this
 	tablespace. */
-	if (!should_punch_hole() || !srv_use_trim) {
+	if (!should_punch_hole()) {
 		return DB_IO_NO_PUNCH_HOLE;
 	}
 
diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc
index 0d249dfd824..4906956825c 100644
--- a/storage/innobase/srv/srv0srv.cc
+++ b/storage/innobase/srv/srv0srv.cc
@@ -182,9 +182,6 @@ use simulated aio we build below with threads.
 Currently we support native aio on windows and linux */
 my_bool	srv_use_native_aio = TRUE;
 my_bool	srv_numa_interleave = FALSE;
-/* If this flag is TRUE, then we will use fallocate(PUCH_HOLE)
-to the pages */
-UNIV_INTERN my_bool	srv_use_trim;
 /* If this flag is TRUE, then we disable doublewrite buffer */
 UNIV_INTERN my_bool	srv_use_atomic_writes = FALSE;
 /* If this flag IS TRUE, then we use this algorithm for page compressing the pages */


More information about the commits mailing list