Commit 925999bb authored by Nayuta Yanagisawa's avatar Nayuta Yanagisawa

MDEV-28829 Deprecate spider_semi_table_lock and spider_semi_table_lock_connection

When the variable, spider_semi_table_lock, is 1, Spider sends
LOCK TABLES before each SQL execution. The feature is for
non-transactional remote tables and adds some overhead to query
executions.

We change the default value of the plugin variable to 0 and then
deprecate the variable because it is rare to use non-transactional
engines these days and the variable complicates the code.

The variable, spider_semi_table_lock_connection, should be too
deprecated because it is for tweaking the semi-table locking.
parent 8e6c8967
......@@ -211,6 +211,35 @@ Warnings:
Warning 1287 The table parameter 'init_sql_alloc_size' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-28829 Deprecate spider_semi_table_lock and spider_semi_table_lock_connection
SET spider_semi_table_lock = 1;
Warnings:
Warning 1287 '@@spider_semi_table_lock' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_semi_table_lock";
Variable_name Value
spider_semi_table_lock 1
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='stl "1"';
Warnings:
Warning 1287 The table parameter 'stl' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='semi_table_lock "1"';
Warnings:
Warning 1287 The table parameter 'semi_table_lock' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
SET spider_semi_table_lock_connection = 0;
Warnings:
Warning 1287 '@@spider_semi_table_lock_connection' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_semi_table_lock_connection";
Variable_name Value
spider_semi_table_lock_connection 0
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='stc "0"';
Warnings:
Warning 1287 The table parameter 'stc' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='semi_table_lock_connection "0"';
Warnings:
Warning 1287 The table parameter 'semi_table_lock_connection' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
DROP DATABASE auto_test_local;
for master_1
for child2
......
......@@ -126,6 +126,23 @@ eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='init_sql_alloc_size "1
DROP TABLE tbl_a;
DROP TABLE tbl_b;
--echo # MDEV-28829 Deprecate spider_semi_table_lock and spider_semi_table_lock_connection
SET spider_semi_table_lock = 1;
SHOW VARIABLES LIKE "spider_semi_table_lock";
eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='stl "1"';
eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='semi_table_lock "1"';
DROP TABLE tbl_a;
DROP TABLE tbl_b;
SET spider_semi_table_lock_connection = 0;
SHOW VARIABLES LIKE "spider_semi_table_lock_connection";
eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='stc "0"';
eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='semi_table_lock_connection "0"';
DROP TABLE tbl_a;
DROP TABLE tbl_b;
DROP DATABASE auto_test_local;
--disable_query_log
......
......@@ -805,11 +805,11 @@ static int spider_param_semi_table_lock_check(
*/
static MYSQL_THDVAR_INT(
semi_table_lock, /* name */
PLUGIN_VAR_RQCMDARG, /* opt */
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Table lock during execute a sql", /* comment */
&spider_param_semi_table_lock_check, /* check */
NULL, /* update */
1, /* def */
0, /* def */
0, /* min */
1, /* max */
0 /* blk */
......@@ -870,7 +870,7 @@ static int spider_param_semi_table_lock_connection_check(
*/
static MYSQL_THDVAR_INT(
semi_table_lock_connection, /* name */
PLUGIN_VAR_RQCMDARG, /* opt */
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Use different connection if semi_table_lock is enabled", /* comment */
&spider_param_semi_table_lock_connection_check, /* check */
spider_var_deprecated_int, /* update */
......
......@@ -2460,7 +2460,9 @@ int spider_parse_connect_info(
#ifdef WITH_PARTITION_STORAGE_ENGINE
SPIDER_PARAM_INT_WITH_MAX("ssy", sts_sync, 0, 2);
#endif
SPIDER_PARAM_DEPRECATED_WARNING("stc");
SPIDER_PARAM_INT_WITH_MAX("stc", semi_table_lock_conn, 0, 1);
SPIDER_PARAM_DEPRECATED_WARNING("stl");
SPIDER_PARAM_INT_WITH_MAX("stl", semi_table_lock, 0, 1);
SPIDER_PARAM_LONGLONG("srs", static_records_for_status, 0);
SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1);
......@@ -2608,6 +2610,7 @@ int spider_parse_connect_info(
SPIDER_PARAM_DEPRECATED_WARNING("internal_offset");
SPIDER_PARAM_LONGLONG("internal_offset", internal_offset, 0);
SPIDER_PARAM_INT_WITH_MAX("reset_sql_alloc", reset_sql_alloc, 0, 1);
SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock");
SPIDER_PARAM_INT_WITH_MAX("semi_table_lock", semi_table_lock, 0, 1);
SPIDER_PARAM_LONGLONG("quick_page_byte", quick_page_byte, 0);
SPIDER_PARAM_LONGLONG("quick_page_size", quick_page_size, 0);
......@@ -2749,6 +2752,7 @@ int spider_parse_connect_info(
error_num = connect_string_parse.print_param_error();
goto error;
case 26:
SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock_connection");
SPIDER_PARAM_INT_WITH_MAX(
"semi_table_lock_connection", semi_table_lock_conn, 0, 1);
error_num = connect_string_parse.print_param_error();
......
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