Skip to content

Commit 925999b

Browse files
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.
1 parent 8e6c896 commit 925999b

File tree

4 files changed

+53
-3
lines changed

4 files changed

+53
-3
lines changed

storage/spider/mysql-test/spider/r/variable_deprecation.result

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,35 @@ Warnings:
211211
Warning 1287 The table parameter 'init_sql_alloc_size' is deprecated and will be removed in a future release
212212
DROP TABLE tbl_a;
213213
DROP TABLE tbl_b;
214+
# MDEV-28829 Deprecate spider_semi_table_lock and spider_semi_table_lock_connection
215+
SET spider_semi_table_lock = 1;
216+
Warnings:
217+
Warning 1287 '@@spider_semi_table_lock' is deprecated and will be removed in a future release
218+
SHOW VARIABLES LIKE "spider_semi_table_lock";
219+
Variable_name Value
220+
spider_semi_table_lock 1
221+
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='stl "1"';
222+
Warnings:
223+
Warning 1287 The table parameter 'stl' is deprecated and will be removed in a future release
224+
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='semi_table_lock "1"';
225+
Warnings:
226+
Warning 1287 The table parameter 'semi_table_lock' is deprecated and will be removed in a future release
227+
DROP TABLE tbl_a;
228+
DROP TABLE tbl_b;
229+
SET spider_semi_table_lock_connection = 0;
230+
Warnings:
231+
Warning 1287 '@@spider_semi_table_lock_connection' is deprecated and will be removed in a future release
232+
SHOW VARIABLES LIKE "spider_semi_table_lock_connection";
233+
Variable_name Value
234+
spider_semi_table_lock_connection 0
235+
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='stc "0"';
236+
Warnings:
237+
Warning 1287 The table parameter 'stc' is deprecated and will be removed in a future release
238+
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='semi_table_lock_connection "0"';
239+
Warnings:
240+
Warning 1287 The table parameter 'semi_table_lock_connection' is deprecated and will be removed in a future release
241+
DROP TABLE tbl_a;
242+
DROP TABLE tbl_b;
214243
DROP DATABASE auto_test_local;
215244
for master_1
216245
for child2

storage/spider/mysql-test/spider/t/variable_deprecation.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@ eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='init_sql_alloc_size "1
126126
DROP TABLE tbl_a;
127127
DROP TABLE tbl_b;
128128

129+
--echo # MDEV-28829 Deprecate spider_semi_table_lock and spider_semi_table_lock_connection
130+
SET spider_semi_table_lock = 1;
131+
SHOW VARIABLES LIKE "spider_semi_table_lock";
132+
eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='stl "1"';
133+
eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='semi_table_lock "1"';
134+
135+
DROP TABLE tbl_a;
136+
DROP TABLE tbl_b;
137+
138+
SET spider_semi_table_lock_connection = 0;
139+
SHOW VARIABLES LIKE "spider_semi_table_lock_connection";
140+
eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='stc "0"';
141+
eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='semi_table_lock_connection "0"';
142+
143+
DROP TABLE tbl_a;
144+
DROP TABLE tbl_b;
145+
129146
DROP DATABASE auto_test_local;
130147

131148
--disable_query_log

storage/spider/spd_param.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,11 +805,11 @@ static int spider_param_semi_table_lock_check(
805805
*/
806806
static MYSQL_THDVAR_INT(
807807
semi_table_lock, /* name */
808-
PLUGIN_VAR_RQCMDARG, /* opt */
808+
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
809809
"Table lock during execute a sql", /* comment */
810810
&spider_param_semi_table_lock_check, /* check */
811811
NULL, /* update */
812-
1, /* def */
812+
0, /* def */
813813
0, /* min */
814814
1, /* max */
815815
0 /* blk */
@@ -870,7 +870,7 @@ static int spider_param_semi_table_lock_connection_check(
870870
*/
871871
static MYSQL_THDVAR_INT(
872872
semi_table_lock_connection, /* name */
873-
PLUGIN_VAR_RQCMDARG, /* opt */
873+
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
874874
"Use different connection if semi_table_lock is enabled", /* comment */
875875
&spider_param_semi_table_lock_connection_check, /* check */
876876
spider_var_deprecated_int, /* update */

storage/spider/spd_table.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,7 +2460,9 @@ int spider_parse_connect_info(
24602460
#ifdef WITH_PARTITION_STORAGE_ENGINE
24612461
SPIDER_PARAM_INT_WITH_MAX("ssy", sts_sync, 0, 2);
24622462
#endif
2463+
SPIDER_PARAM_DEPRECATED_WARNING("stc");
24632464
SPIDER_PARAM_INT_WITH_MAX("stc", semi_table_lock_conn, 0, 1);
2465+
SPIDER_PARAM_DEPRECATED_WARNING("stl");
24642466
SPIDER_PARAM_INT_WITH_MAX("stl", semi_table_lock, 0, 1);
24652467
SPIDER_PARAM_LONGLONG("srs", static_records_for_status, 0);
24662468
SPIDER_PARAM_LONG_LIST_WITH_MAX("svc", tgt_ssl_vscs, 0, 1);
@@ -2608,6 +2610,7 @@ int spider_parse_connect_info(
26082610
SPIDER_PARAM_DEPRECATED_WARNING("internal_offset");
26092611
SPIDER_PARAM_LONGLONG("internal_offset", internal_offset, 0);
26102612
SPIDER_PARAM_INT_WITH_MAX("reset_sql_alloc", reset_sql_alloc, 0, 1);
2613+
SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock");
26112614
SPIDER_PARAM_INT_WITH_MAX("semi_table_lock", semi_table_lock, 0, 1);
26122615
SPIDER_PARAM_LONGLONG("quick_page_byte", quick_page_byte, 0);
26132616
SPIDER_PARAM_LONGLONG("quick_page_size", quick_page_size, 0);
@@ -2749,6 +2752,7 @@ int spider_parse_connect_info(
27492752
error_num = connect_string_parse.print_param_error();
27502753
goto error;
27512754
case 26:
2755+
SPIDER_PARAM_DEPRECATED_WARNING("semi_table_lock_connection");
27522756
SPIDER_PARAM_INT_WITH_MAX(
27532757
"semi_table_lock_connection", semi_table_lock_conn, 0, 1);
27542758
error_num = connect_string_parse.print_param_error();

0 commit comments

Comments
 (0)