Use shorter timeouts in mxs1323_retry_read
The configuration for mxs1323_retry_read now uses shorter timeouts for monitors. This should help the monitors detect the server failures before the result of the SELECT returns. also increased the time the query sleeps before returning.
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
[maxscale]
|
[maxscale]
|
||||||
threads=###threads###
|
threads=###threads###
|
||||||
log_info=1
|
log_info=1
|
||||||
|
auth_read_timeout=1
|
||||||
|
auth_connect_timeout=1
|
||||||
|
|
||||||
[MySQL Monitor]
|
[MySQL Monitor]
|
||||||
type=monitor
|
type=monitor
|
||||||
@ -9,7 +11,9 @@ module=mysqlmon
|
|||||||
servers= server1,server2
|
servers= server1,server2
|
||||||
user=maxskysql
|
user=maxskysql
|
||||||
passwd= skysql
|
passwd= skysql
|
||||||
monitor_interval=500
|
monitor_interval=1000
|
||||||
|
backend_read_timeout=1
|
||||||
|
backend_connect_timeout=1
|
||||||
|
|
||||||
[RW Split Router]
|
[RW Split Router]
|
||||||
type=service
|
type=service
|
||||||
|
@ -18,7 +18,7 @@ std::string do_query(TestConnections& test)
|
|||||||
{
|
{
|
||||||
MYSQL* conn = test.open_rwsplit_connection();
|
MYSQL* conn = test.open_rwsplit_connection();
|
||||||
|
|
||||||
const char* query = "SELECT SLEEP(10), @@server_id";
|
const char* query = "SELECT SLEEP(15), @@server_id";
|
||||||
char output[512] = "";
|
char output[512] = "";
|
||||||
|
|
||||||
find_field(conn, query, "@@server_id", output);
|
find_field(conn, query, "@@server_id", output);
|
||||||
@ -38,11 +38,13 @@ int main(int argc, char *argv[])
|
|||||||
test.repl->close_connections();
|
test.repl->close_connections();
|
||||||
|
|
||||||
test.set_timeout(60);
|
test.set_timeout(60);
|
||||||
test.add_result(do_query(test) != slave, "The slave should respond to the first query");
|
std::string res = do_query(test);
|
||||||
|
test.add_result(res != slave, "The slave should respond to the first query: %s", res.c_str());
|
||||||
|
|
||||||
pthread_t thr;
|
pthread_t thr;
|
||||||
pthread_create(&thr, NULL, async_block, &test);
|
pthread_create(&thr, NULL, async_block, &test);
|
||||||
test.add_result(do_query(test) != master, "The master should respond to the second query");
|
res = do_query(test);
|
||||||
|
test.add_result(res != master, "The master should respond to the second query: %s", res.c_str());
|
||||||
pthread_join(thr, NULL);
|
pthread_join(thr, NULL);
|
||||||
test.repl->unblock_node(1);
|
test.repl->unblock_node(1);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user