From a4bad5ffd2b17dbd701c393e632873ecb353ff24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 18 Sep 2017 13:41:24 +0300 Subject: [PATCH] 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. --- maxscale-system-test/cnf/maxscale.cnf.template.mxs1323 | 6 +++++- maxscale-system-test/mxs1323_retry_read.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs1323 b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1323 index f5fff9976..031dbf9a1 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mxs1323 +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1323 @@ -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 diff --git a/maxscale-system-test/mxs1323_retry_read.cpp b/maxscale-system-test/mxs1323_retry_read.cpp index 7d17f337f..3bd64f621 100644 --- a/maxscale-system-test/mxs1323_retry_read.cpp +++ b/maxscale-system-test/mxs1323_retry_read.cpp @@ -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);