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:
Markus Mäkelä 2017-09-18 13:41:24 +03:00
parent d003983e5a
commit a4bad5ffd2
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,8 @@
[maxscale]
threads=###threads###
log_info=1
auth_read_timeout=1
auth_connect_timeout=1
[MySQL Monitor]
type=monitor
@ -9,7 +11,9 @@ module=mysqlmon
servers= server1,server2
user=maxskysql
passwd= skysql
monitor_interval=500
monitor_interval=1000
backend_read_timeout=1
backend_connect_timeout=1
[RW Split Router]
type=service

View File

@ -18,7 +18,7 @@ std::string do_query(TestConnections& test)
{
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] = "";
find_field(conn, query, "@@server_id", output);
@ -38,11 +38,13 @@ int main(int argc, char *argv[])
test.repl->close_connections();
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_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);
test.repl->unblock_node(1);