MXS-2520: Add test case
The test reproduces the problem and verifies that the fix works.
This commit is contained in:
@ -948,6 +948,9 @@ add_test_executable(mxs2450_change_user_crash.cpp mxs2450_change_user_crash mxs2
|
|||||||
# PAM authentication
|
# PAM authentication
|
||||||
add_test_executable(pam_authentication.cpp pam_authentication pam_authentication LABELS REPL_BACKEND)
|
add_test_executable(pam_authentication.cpp pam_authentication pam_authentication LABELS REPL_BACKEND)
|
||||||
|
|
||||||
|
# MXS-2520: Allow master reconnection on reads
|
||||||
|
add_test_executable(mxs2520_master_read_reconnect.cpp mxs2520_master_read_reconnect mxs2520_master_read_reconnect LABELS REPL_BACKEND readwritesplit)
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
# BEGIN: binlogrouter and avrorouter tests #
|
# BEGIN: binlogrouter and avrorouter tests #
|
||||||
############################################
|
############################################
|
||||||
|
|||||||
@ -0,0 +1,30 @@
|
|||||||
|
[maxscale]
|
||||||
|
threads=###threads###
|
||||||
|
log_info=1
|
||||||
|
|
||||||
|
[MySQL-Monitor]
|
||||||
|
type=monitor
|
||||||
|
module=mysqlmon
|
||||||
|
servers=server1
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
monitor_interval=1000
|
||||||
|
backend_read_timeout=1
|
||||||
|
backend_connect_timeout=1
|
||||||
|
|
||||||
|
[RW-Split-Router]
|
||||||
|
type=service
|
||||||
|
router=readwritesplit
|
||||||
|
servers=server1
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
delayed_retry_timeout=45
|
||||||
|
transaction_replay=true
|
||||||
|
|
||||||
|
[RW-Split-Listener]
|
||||||
|
type=listener
|
||||||
|
service=RW-Split-Router
|
||||||
|
protocol=MySQLClient
|
||||||
|
port=4006
|
||||||
|
|
||||||
|
###server###
|
||||||
34
maxscale-system-test/mxs2520_master_read_reconnect.cpp
Normal file
34
maxscale-system-test/mxs2520_master_read_reconnect.cpp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* MXS-2520: Allow master reconnection on reads
|
||||||
|
* https://jira.mariadb.org/browse/MXS-2520
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "testconnections.h"
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
TestConnections test(argc, argv);
|
||||||
|
|
||||||
|
test.maxscales->connect();
|
||||||
|
std::thread thr([&]() {
|
||||||
|
sleep(5);
|
||||||
|
test.tprintf("block node 0");
|
||||||
|
test.repl->block_node(0);
|
||||||
|
test.tprintf("wait for monitor");
|
||||||
|
test.maxscales->wait_for_monitor(2);
|
||||||
|
test.tprintf("unblock node 0");
|
||||||
|
test.repl->unblock_node(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
test.set_timeout(60);
|
||||||
|
test.tprintf("SELECT SLEEP(10)");
|
||||||
|
test.try_query(test.maxscales->conn_rwsplit[0], "SELECT SLEEP(10)");
|
||||||
|
test.stop_timeout();
|
||||||
|
|
||||||
|
test.tprintf("disconnect");
|
||||||
|
test.maxscales->disconnect();
|
||||||
|
test.tprintf("join");
|
||||||
|
thr.join();
|
||||||
|
|
||||||
|
return test.global_result;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user