Merge branch '2.3' into develop

This commit is contained in:
Esa Korhonen
2019-04-30 12:06:06 +03:00
11 changed files with 212 additions and 92 deletions

View File

@ -943,6 +943,9 @@ add_test_executable(mxs2313_rank.cpp mxs2313_rank mxs2313_rank LABELS readwrites
# MXS-2417: Ignore persisted configs with load_persisted_configs=false
add_test_executable(mxs2417_ignore_persisted_cnf.cpp mxs2417_ignore_persisted_cnf mxs2417_ignore_persisted_cnf LABELS REPL_BACKEND)
# MXS-2450: Crash on COM_CHANGE_USER with disable_sescmd_history=true
add_test_executable(mxs2450_change_user_crash.cpp mxs2450_change_user_crash mxs2450_change_user_crash LABELS REPL_BACKEND)
# MXS-1662: PAM admin authentication
add_test_executable(mxs1662_pam_admin.cpp mxs1662_pam_admin mxs1662_pam_admin LABELS REPL_BACKEND)

View File

@ -0,0 +1,49 @@
[maxscale]
threads=###threads###
log_info=1
[server1]
type=server
address=###node_server_IP_1###
port=###node_server_port_1###
protocol=MySQLBackend
[server2]
type=server
address=###node_server_IP_2###
port=###node_server_port_2###
protocol=MySQLBackend
[server3]
type=server
address=###node_server_IP_3###
port=###node_server_port_3###
protocol=MySQLBackend
[server4]
type=server
address=###node_server_IP_4###
port=###node_server_port_4###
protocol=MySQLBackend
[MySQL Monitor]
type=monitor
module=mysqlmon
servers=server1,server2,server3,server4
user=maxskysql
password=skysql
monitor_interval=1000
[RW Split Router]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
user=maxskysql
password=skysql
disable_sescmd_history=true
[RW Split Listener]
type=listener
service=RW Split Router
protocol=MySQLClient
port=4006

View File

@ -4,17 +4,16 @@
#include <string>
#include "envv.h"
Maxscales::Maxscales(const char *pref, const char *test_cwd, bool verbose, bool use_valgrind,
Maxscales::Maxscales(const char *pref, const char *test_cwd, bool verbose,
std::string network_config)
{
strcpy(prefix, pref);
this->verbose = verbose;
this->use_valgrind = use_valgrind;
valgring_log_num = 0;
strcpy(test_dir, test_cwd);
this->network_config = network_config;
read_env();
if (use_valgrind)
if (this->use_valgrind)
{
for (int i = 0; i < N; i++)
{
@ -61,6 +60,13 @@ int Maxscales::read_env()
}
}
use_valgrind = readenv_bool("use_valgrind", false);
use_callgrind = readenv_bool("use_callgrind", false);
if (use_callgrind)
{
use_valgrind = true;
}
return 0;
}
@ -211,10 +217,23 @@ int Maxscales::start_maxscale(int m)
int res;
if (use_valgrind)
{
res = ssh_node_f(m, false,
"sudo --user=maxscale valgrind --leak-check=full --show-leak-kinds=all "
"--log-file=/%s/valgrind%02d.log --trace-children=yes "
"--track-origins=yes /usr/bin/maxscale", maxscale_log_dir[m], valgring_log_num);
if (use_callgrind)
{
res = ssh_node_f(m, false,
"sudo --user=maxscale valgrind -d "
"--log-file=/%s/valgrind%02d.log --trace-children=yes "
" --tool=callgrind --callgrind-out-file=/%s/callgrind%02d.log "
" /usr/bin/maxscale",
maxscale_log_dir[m], valgring_log_num,
maxscale_log_dir[m], valgring_log_num);
}
else
{
res = ssh_node_f(m, false,
"sudo --user=maxscale valgrind --leak-check=full --show-leak-kinds=all "
"--log-file=/%s/valgrind%02d.log --trace-children=yes "
"--track-origins=yes /usr/bin/maxscale", maxscale_log_dir[m], valgring_log_num);
}
valgring_log_num++;
}
else

View File

@ -20,7 +20,7 @@ public:
READCONN_SLAVE
};
Maxscales(const char *pref, const char *test_cwd, bool verbose, bool use_valgrind,
Maxscales(const char *pref, const char *test_cwd, bool verbose,
std::string network_config);
int read_env();
@ -338,6 +338,12 @@ public:
*/
bool use_valgrind;
/**
* @brief use_callgrind if true Maxscale will be executed under Valgrind with
* --callgrind option
*/
bool use_callgrind;
/**
* @brief valgring_log_num Counter for Maxscale restarts to avoid Valgrind log overwriting
*/

View File

@ -0,0 +1,20 @@
/**
* MXS-2450: Crash on COM_CHANGE_USER with disable_sescmd_history=true
* https://jira.mariadb.org/browse/MXS-2450
*/
#include "testconnections.h"
int main(int argc, char *argv[])
{
TestConnections test(argc, argv);
Connection conn = test.maxscales->rwsplit();
test.expect(conn.connect(), "Connection failed: %s", conn.error());
for (int i = 0; i < 10; i++)
{
test.expect(conn.reset_connection(), "Connection reset failed: %s", conn.error());
}
return test.global_result;
}

View File

@ -139,7 +139,6 @@ TestConnections::TestConnections(int argc, char* argv[])
, no_vm_revert(true)
, threads(4)
, use_ipv6(false)
, use_valgrind(false)
{
std::ios::sync_with_stdio(true);
signal_set(SIGSEGV, sigfatal_handler);
@ -387,7 +386,7 @@ TestConnections::TestConnections(int argc, char* argv[])
galera = NULL;
}
maxscales = new Maxscales("maxscale", test_dir, verbose, use_valgrind, network_config);
maxscales = new Maxscales("maxscale", test_dir, verbose, network_config);
bool maxscale_ok = maxscales->check_nodes();
bool repl_ok = no_repl || repl_future.get();
@ -517,7 +516,7 @@ TestConnections::~TestConnections()
// galera->disable_ssl();
}
if (use_valgrind)
if (maxscales->use_valgrind)
{
// stop all Maxscales to get proper Valgrind logs
for (int i = 0; i < maxscales->N; i++)
@ -680,7 +679,6 @@ void TestConnections::read_env()
revert_snapshot_command = readenv("revert_snapshot_command",
"mdbci snapshot revert --path-to-nodes %s --snapshot-name ", mdbci_config_name);
no_vm_revert = readenv_bool("no_vm_revert", true);
use_valgrind = readenv_bool("use_valgrind", false);
}
void TestConnections::print_env()
@ -1478,7 +1476,7 @@ int TestConnections::find_connected_slave1(int m)
int TestConnections::check_maxscale_processes(int m, int expected)
{
const char* ps_cmd = use_valgrind ?
const char* ps_cmd = maxscales->use_valgrind ?
"ps ax | grep valgrind | grep maxscale | grep -v grep | wc -l" :
"ps -C maxscale | grep maxscale | wc -l";

View File

@ -686,11 +686,6 @@ public:
*/
int call_mdbci(const char *options);
/**
* @brief use_valrind if true Maxscale will be executed under Valgrind
*/
bool use_valgrind;
/**
* @brief resinstall_maxscales Remove Maxscale form all nodes and installs new ones
* (to be used for run_test_snapshot)