mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-35064 Reduce the default spider connect retry counts to 2
The existing default value 1000 is too big and could result in "hanging" when failing to connect a remote server. Three tries in total is a more sensible default.
This commit is contained in:
14
storage/spider/mysql-test/spider/bugfix/r/mdev_35064.result
Normal file
14
storage/spider/mysql-test/spider/bugfix/r/mdev_35064.result
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
for master_1
|
||||||
|
for child2
|
||||||
|
for child3
|
||||||
|
CREATE SERVER s FOREIGN DATA WRAPPER mysql OPTIONS(HOST '1');
|
||||||
|
CREATE TABLE t(c INT)ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "s",TABLE "foo"';
|
||||||
|
INSERT INTO t VALUES(1);
|
||||||
|
ERROR HY000: Unable to connect to foreign data source: s
|
||||||
|
INSERT INTO t VALUES(1);
|
||||||
|
ERROR HY000: Unable to connect to foreign data source: s
|
||||||
|
drop table t;
|
||||||
|
drop server s;
|
||||||
|
for master_1
|
||||||
|
for child2
|
||||||
|
for child3
|
20
storage/spider/mysql-test/spider/bugfix/t/mdev_35064.test
Normal file
20
storage/spider/mysql-test/spider/bugfix/t/mdev_35064.test
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
--disable_query_log
|
||||||
|
--disable_result_log
|
||||||
|
--source ../../t/test_init.inc
|
||||||
|
--enable_result_log
|
||||||
|
--enable_query_log
|
||||||
|
|
||||||
|
CREATE SERVER s FOREIGN DATA WRAPPER mysql OPTIONS(HOST '1');
|
||||||
|
CREATE TABLE t(c INT)ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "s",TABLE "foo"';
|
||||||
|
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
|
||||||
|
INSERT INTO t VALUES(1);
|
||||||
|
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
|
||||||
|
INSERT INTO t VALUES(1); # Hangs
|
||||||
|
drop table t;
|
||||||
|
drop server s;
|
||||||
|
|
||||||
|
--disable_query_log
|
||||||
|
--disable_result_log
|
||||||
|
--source ../../t/test_deinit.inc
|
||||||
|
--enable_result_log
|
||||||
|
--enable_query_log
|
@@ -2042,7 +2042,7 @@ int spider_db_mbase::connect(
|
|||||||
DBUG_RETURN(ER_CONNECT_TO_FOREIGN_DATA_SOURCE);
|
DBUG_RETURN(ER_CONNECT_TO_FOREIGN_DATA_SOURCE);
|
||||||
}
|
}
|
||||||
connect_retry_count--;
|
connect_retry_count--;
|
||||||
my_sleep((ulong) connect_retry_interval);
|
my_sleep((ulong) connect_retry_interval * 1000);
|
||||||
} else {
|
} else {
|
||||||
db_conn->net.thd = NULL;
|
db_conn->net.thd = NULL;
|
||||||
if (connect_mutex)
|
if (connect_mutex)
|
||||||
|
@@ -1803,7 +1803,7 @@ static MYSQL_THDVAR_INT(
|
|||||||
"Connect retry count", /* comment */
|
"Connect retry count", /* comment */
|
||||||
NULL, /* check */
|
NULL, /* check */
|
||||||
NULL, /* update */
|
NULL, /* update */
|
||||||
1000, /* def */
|
2, /* def */
|
||||||
0, /* min */
|
0, /* min */
|
||||||
2147483647, /* max */
|
2147483647, /* max */
|
||||||
0 /* blk */
|
0 /* blk */
|
||||||
|
Reference in New Issue
Block a user