Skip to content

Commit

Permalink
MDEV-27981 Deprecate spider_internal_limit
Browse files Browse the repository at this point in the history
The variable spider_internal_limit is for specifying the number of
records acquired by Spider from each remote server. 

There seems not to be much use of the variable. Thus, we deprecate it
and the corresponding table options. 

Reviewed-by: Nayuta Yanagisawa <nayuta.yanagisawa@hey.com>
  • Loading branch information
TakeKiyo committed Apr 13, 2022
1 parent aa3a9d1 commit e87c710
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
17 changes: 17 additions & 0 deletions storage/spider/mysql-test/spider/r/variable_deprecation.result
Expand Up @@ -26,6 +26,8 @@ Warning 1287 The table parameter 'uhd' is deprecated and will be removed in a fu
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='use_handler "3"';
Warnings:
Warning 1287 The table parameter 'use_handler' is deprecated and will be removed in a future release
DROP TABLE tbl_a;
DROP TABLE tbl_b;
# MDEV-28005 Deprecate Spider plugin variables regarding UDFs
SET GLOBAL spider_udf_ds_bulk_insert_rows = 1;
Warnings:
Expand Down Expand Up @@ -57,6 +59,21 @@ Warning 1287 '@@spider_udf_ct_bulk_insert_rows' is deprecated and will be remove
SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_rows";
Variable_name Value
spider_udf_ct_bulk_insert_rows 1
# MDEV-27981 Deprecate spider_internal_limit
SET spider_internal_limit = 1;
Warnings:
Warning 1287 '@@spider_internal_limit' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_internal_limit";
Variable_name Value
spider_internal_limit 9223372032559808513
CREATE TABLE tbl_a (a INT) ENGINE=Spider COMMENT='ilm "1"';
Warnings:
Warning 1287 The table parameter 'ilm' is deprecated and will be removed in a future release
CREATE TABLE tbl_b (a INT) ENGINE=Spider COMMENT='internal_limit "1"';
Warnings:
Warning 1287 The table parameter 'internal_limit' 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
Expand Down
12 changes: 12 additions & 0 deletions storage/spider/mysql-test/spider/t/variable_deprecation.test
Expand Up @@ -18,6 +18,9 @@ SHOW VARIABLES LIKE "spider_use_handler";
eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='uhd "3"';
eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='use_handler "3"';

DROP TABLE tbl_a;
DROP TABLE tbl_b;

--echo # MDEV-28005 Deprecate Spider plugin variables regarding UDFs
SET GLOBAL spider_udf_ds_bulk_insert_rows = 1;
SHOW VARIABLES LIKE "spider_udf_ds_bulk_insert_rows";
Expand All @@ -34,6 +37,15 @@ SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_interval";
SET GLOBAL spider_udf_ct_bulk_insert_rows = 1;
SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_rows";

--echo # MDEV-27981 Deprecate spider_internal_limit
SET spider_internal_limit = 1;
SHOW VARIABLES LIKE "spider_internal_limit";
eval CREATE TABLE tbl_a (a INT) $MASTER_1_ENGINE COMMENT='ilm "1"';
eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='internal_limit "1"';

DROP TABLE tbl_a;
DROP TABLE tbl_b;

DROP DATABASE auto_test_local;

--disable_query_log
Expand Down
2 changes: 1 addition & 1 deletion storage/spider/spd_param.cc
Expand Up @@ -494,7 +494,7 @@ longlong spider_param_internal_offset(
*/
static MYSQL_THDVAR_LONGLONG(
internal_limit, /* name */
PLUGIN_VAR_RQCMDARG, /* opt */
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Internal limit", /* comment */
NULL, /* check */
spider_use_table_value_deprecated, /* update */
Expand Down
2 changes: 2 additions & 0 deletions storage/spider/spd_table.cc
Expand Up @@ -2375,6 +2375,7 @@ int spider_parse_connect_info(
#endif
SPIDER_PARAM_INT("isa", init_sql_alloc_size, 0);
SPIDER_PARAM_INT_WITH_MAX("idl", internal_delayed, 0, 1);
SPIDER_PARAM_DEPRECATED_WARNING("ilm");
SPIDER_PARAM_LONGLONG("ilm", internal_limit, 0);
SPIDER_PARAM_LONGLONG("ios", internal_offset, 0);
SPIDER_PARAM_INT_WITH_MAX("iom", internal_optimize, 0, 1);
Expand Down Expand Up @@ -2563,6 +2564,7 @@ int spider_parse_connect_info(
error_num = connect_string_parse.print_param_error();
goto error;
case 14:
SPIDER_PARAM_DEPRECATED_WARNING("internal_limit");
SPIDER_PARAM_LONGLONG("internal_limit", internal_limit, 0);
#ifndef WITHOUT_SPIDER_BG_SEARCH
SPIDER_PARAM_LONGLONG("bgs_first_read", bgs_first_read, 0);
Expand Down

0 comments on commit e87c710

Please sign in to comment.