MXS-2563: Add test case

Added a test case that reproduces the debug assertion with the old code
and verifies that it is fixed with the new one.
This commit is contained in:
Markus Mäkelä
2019-06-14 14:11:20 +03:00
parent f6a5b59067
commit 002281599e
3 changed files with 64 additions and 0 deletions

View File

@ -963,6 +963,9 @@ add_test_executable(mxs2520_master_read_reconnect.cpp mxs2520_master_read_reconn
# MXS-2464: Crash in route_stored_query with ReadWriteSplit # MXS-2464: Crash in route_stored_query with ReadWriteSplit
add_test_executable(mxs2464_sescmd_reconnect.cpp mxs2464_sescmd_reconnect mxs2464_sescmd_reconnect LABELS REPL_BACKEND readwritesplit) add_test_executable(mxs2464_sescmd_reconnect.cpp mxs2464_sescmd_reconnect mxs2464_sescmd_reconnect LABELS REPL_BACKEND readwritesplit)
# MXS-2563: Failing debug assertion at rwsplitsession.cc:1129 : m_expected_responses == 0
add_test_executable(mxs2563_concurrent_slave_failure.cpp mxs2563_concurrent_slave_failure mxs2563_concurrent_slave_failure LABELS REPL_BACKEND readwritesplit)
############################################ ############################################
# BEGIN: binlogrouter and avrorouter tests # # BEGIN: binlogrouter and avrorouter tests #
############################################ ############################################

View File

@ -0,0 +1,26 @@
[maxscale]
threads=###threads###
log_info=1
###server###
[MariaDB-Monitor]
type=monitor
module=mariadbmon
servers=###server_line###
user=maxskysql
password=skysql
monitor_interval=1000
[RW-Split-Router]
type=service
router=readwritesplit
servers=###server_line###
user=maxskysql
password=skysql
[RW-Split-Listener]
type=listener
service=RW-Split-Router
protocol=MySQLClient
port=4006

View File

@ -0,0 +1,35 @@
/**
* MXS-2563: Failing debug assertion at rwsplitsession.cc:1129 : m_expected_responses == 0
* https://jira.mariadb.org/browse/MXS-2563
*/
#include "testconnections.h"
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
test.maxctrl("alter monitor MariaDB-Monitor monitor_interval 99999");
auto conn = test.maxscales->rwsplit();
conn.connect();
conn.query("SET @a = (SELECT SLEEP(1))");
std::thread thr(
[&test]() {
sleep(5);
test.repl->stop_node(2);
test.repl->stop_node(3);
sleep(5);
test.repl->start_node(2);
test.repl->start_node(3);
});
// Should go to server2
conn.query("SELECT SLEEP(20)");
thr.join();
test.maxctrl("alter monitor MariaDB-Monitor monitor_interval 1000");
return test.global_result;
}