Merge branch '2.4.14' into 2.4
This commit is contained in:
commit
27528628e2
@ -5,7 +5,7 @@
|
||||
|
||||
set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version")
|
||||
set(MAXSCALE_VERSION_MINOR "4" CACHE STRING "Minor version")
|
||||
set(MAXSCALE_VERSION_PATCH "14" CACHE STRING "Patch version")
|
||||
set(MAXSCALE_VERSION_PATCH "15" CACHE STRING "Patch version")
|
||||
|
||||
# This should only be incremented if a package is rebuilt
|
||||
set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number")
|
||||
|
@ -251,59 +251,6 @@ add_test_executable(mxs2785_binlogfilter_rewrite.cpp mxs2785_binlogfilter_rewrit
|
||||
# END: Tests that require GTID #
|
||||
############################################
|
||||
|
||||
############################################
|
||||
# BEGIN: Galera tests #
|
||||
############################################
|
||||
|
||||
# Crash in case of backend node in Galera cluster stopping and then reconnect to Maxscale
|
||||
add_test_executable(bug676.cpp bug676 galera LABELS galeramon GALERA_BACKEND)
|
||||
|
||||
# Galera node priority test
|
||||
add_test_executable(galera_priority.cpp galera_priority galera_priority LABELS galeramon LIGHT GALERA_BACKEND)
|
||||
|
||||
# INSERT extremelly big number of rows
|
||||
add_test_executable(lots_of_rows.cpp lots_of_rows galera LABELS readwritesplit HEAVY GALERA_BACKEND)
|
||||
|
||||
# Prepearing and execution statements in the loop
|
||||
add_test_executable(mxs244_prepared_stmt_loop.cpp mxs244_prepared_stmt_loop galera LABELS readwritesplit readconnroute LIGHT GALERA_BACKEND)
|
||||
|
||||
# Tries prepared stmt 'SELECT 1,1,1,1...." with different nu,ber of '1'
|
||||
add_test_executable(mxs314.cpp mxs314 galera LABELS MySQLProtocol readwritesplit LIGHT GALERA_BACKEND)
|
||||
|
||||
# Playing with blocking and unblocking nodes under INSERT load
|
||||
add_test_executable(mxs564_big_dump.cpp mxs564_big_dump galera_mxs564 LABELS readwritesplit readconnroute GALERA_BACKEND)
|
||||
|
||||
# MXS-1476: priority value ignored when a Galera node rejoins with a lower wsrep_local_index than current master
|
||||
# https://jira.mariadb.org/browse/MXS-1476
|
||||
add_test_executable(mxs1476.cpp mxs1476 mxs1476 LABELS galeramon GALERA_BACKEND)
|
||||
|
||||
# MXS-1751: Maxscale crashes when certain config is in play (with nodes down)
|
||||
# https://jira.mariadb.org/browse/MXS-1751
|
||||
add_test_executable(mxs1751_available_when_donor_crash.cpp mxs1751_available_when_donor_crash mxs1751_available_when_donor_crash LABELS galeramon GALERA_BACKEND)
|
||||
|
||||
# Persistant connection test
|
||||
add_test_executable(pers_01.cpp pers_01 pers_01 LABELS maxscale REPL_BACKEND readwritesplit GALERA_BACKEND)
|
||||
|
||||
# MXS-1980: Support Galera cluster nodes as masters for Binlog Router
|
||||
# https://jira.mariadb.org/browse/MXS-1980
|
||||
add_test_executable(mxs1980_blr_galera_server_ids.cpp mxs1980_blr_galera_server_ids mxs1980_blr_galera_server_ids LABELS binlogrouter GALERA_BACKEND REPL_BACKEND)
|
||||
|
||||
############################################
|
||||
# END: Galera tests #
|
||||
############################################
|
||||
|
||||
############################################
|
||||
# BEGIN: ColumnStore tests #
|
||||
############################################
|
||||
|
||||
# MXS-2146: Add test case for csmon
|
||||
# https://jira.mariadb.org/browse/MXS-2146
|
||||
add_test_executable(csmon_test.cpp csmon_test csmon_test LABELS csmon CS_BACKEND)
|
||||
|
||||
############################################
|
||||
# END: ColumnStore tests #
|
||||
############################################
|
||||
|
||||
############################################
|
||||
# BEGIN: Normal tests #
|
||||
############################################
|
||||
@ -339,9 +286,6 @@ add_test_derived(load_balancing_pers10 load_balancing load_pers10 LABELS readwri
|
||||
# Test with extremely big blob inserting
|
||||
add_test_executable(longblob.cpp longblob longblob LABELS readwritesplit readconnroute UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
# Test with extremely big blob inserting/selecting with > 16 mb data blocks
|
||||
add_test_executable(mxs1110_16mb.cpp mxs1110_16mb longblob_filters LABELS readwritesplit readconnroute HEAVY REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
# Schemarouter implicit database detection
|
||||
add_test_executable(mxs1310_implicit_db.cpp mxs1310_implicit_db mxs1310_implicit_db LABELS schemarouter REPL_BACKEND)
|
||||
|
||||
@ -352,9 +296,6 @@ add_test_executable(mxs1323_stress.cpp mxs1323_stress mxs1323 LABELS readwritesp
|
||||
# A set of MariaDB server tests executed against Maxscale RWSplit
|
||||
add_test_script(mariadb_tests_hartmut.sh mariadb_tests_hartmut.sh replication LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# A set of MariaDB server tests executed against Maxscale RWSplit (Galera backend)
|
||||
add_test_script(mariadb_tests_hartmut_galera.sh mariadb_tests_hartmut.sh galera_hartmut LABELS readwritesplit GALERA_BACKEND)
|
||||
|
||||
# Creates a number of connections > max_connections setting
|
||||
add_test_executable(max_connections.cpp max_connections replication LABELS MySQLAuth MySQLProtocol UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
@ -392,9 +333,6 @@ add_test_executable(binary_ps_cursor.cpp binary_ps_cursor replication LABELS rea
|
||||
# Creates and closes a lot of connections, checks that 'maxadmin list servers' shows 0 connections at the end
|
||||
add_test_executable(mxs321.cpp mxs321 replication LABELS maxscale readwritesplit REPL_BACKEND)
|
||||
|
||||
# Crash with Galera and backend restart when persistant cfonnections are in use
|
||||
add_test_derived(mxs361 pers_02 mxs361 mxs361 LABELS maxscale REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
# Load huge file with 'LOAD DATA LOCAL INFILE'
|
||||
add_test_executable(mxs365.cpp mxs365 replication LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
@ -410,12 +348,6 @@ add_test_executable(mxs548_short_session_change_user.cpp mxs548_short_session_ch
|
||||
# Playing with blocking and unblocking Master under load
|
||||
add_test_executable(mxs559_block_master.cpp mxs559_block_master mxs559 LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# Executes simple queries from python script in the loop
|
||||
add_test_script(mxs585.py mxs585.py replication LABELS readwritesplit readconnroute UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
# Simple transactions in the loop from python script with client SSL on
|
||||
add_test_script(mxs598.py mxs598.py ssl LABELS MySQLProtocol UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
# Regression case for the bug "MaxScale fails to start silently if config file is not readable"
|
||||
add_test_executable(mxs621_unreadable_cnf.cpp mxs621_unreadable_cnf replication LABELS maxscale REPL_BACKEND)
|
||||
|
||||
@ -435,9 +367,6 @@ add_test_executable(mxs729_maxadmin.cpp mxs729_maxadmin replication LABELS MaxAd
|
||||
# Simple connect test in bash, checks that defined in cmd line DB is selected
|
||||
add_test_script(mxs791.sh mxs791.sh replication LABELS UNSTABLE HEAVY REPL_BACKEND)
|
||||
|
||||
# Simple connect test in bash, checks that defined in cmd line DB is selected (Galera backend)
|
||||
add_test_script(mxs791_galera.sh mxs791.sh galera LABELS UNSTABLE HEAVY GALERA_BACKEND)
|
||||
|
||||
# Checks "Current no. of conns" maxadmin output after long blob inserting
|
||||
add_test_executable(mxs812_1.cpp mxs812_1 longblob LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
@ -566,10 +495,6 @@ add_test_executable(mxs1516.cpp mxs1516 replication LABELS readconnroute REPL_BA
|
||||
# https://jira.mariadb.org/browse/MXS-1549
|
||||
add_test_executable(mxs1549_optimistic_trx.cpp mxs1549_optimistic_trx mxs1549_optimistic_trx LABELS readwritesplit REPL_BACKEND)
|
||||
|
||||
# MXS-1585: Crash in MaxScale 2.1.12
|
||||
# https://jira.mariadb.org/browse/MXS-1585
|
||||
add_test_executable(mxs1585.cpp mxs1585 mxs1585 LABELS GALERA_BACKEND)
|
||||
|
||||
# MXS-1643: Too many monitor events are triggered
|
||||
# https://jira.mariadb.org/browse/MXS-1643
|
||||
add_test_executable(mxs1643_extra_events.cpp mxs1643_extra_events mxs1643_extra_events LABELS mysqlmon REPL_BACKEND)
|
||||
@ -658,9 +583,6 @@ add_test_executable(no_password.cpp no_password replication LABELS MySQLAuth LIG
|
||||
# Open and immediatelly close a big number of connections
|
||||
add_test_executable(open_close_connections.cpp open_close_connections replication LABELS maxscale readwritesplit REPL_BACKEND)
|
||||
|
||||
# Test with persistant connections configured and big number iof opened connections ,expect no crash
|
||||
add_test_executable(pers_02.cpp pers_02 pers_01 LABELS maxscale GALERA_BACKEND REPL_BACKEND readwritesplit)
|
||||
|
||||
# Check if prepared statement works via Maxscale (via RWSplit)
|
||||
add_test_executable(prepared_statement.cpp prepared_statement replication LABELS readwritesplit LIGHT REPL_BACKEND)
|
||||
|
||||
@ -700,9 +622,6 @@ add_test_executable(rwsplit_multi_stmt.cpp rwsplit_multi_stmt rwsplit_multi_stmt
|
||||
# Schemarouter duplicate database detection test: create DB on all nodes and then try query againt schema router
|
||||
add_test_executable(schemarouter_duplicate.cpp schemarouter_duplicate schemarouter_duplicate LABELS schemarouter REPL_BACKEND)
|
||||
|
||||
# Test of external script execution
|
||||
add_test_executable(script.cpp script script LABELS maxscale REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
# Test 10.3 SEQUENCE objects
|
||||
add_test_executable(sequence.cpp sequence replication LABELS LIGHT REPL_BACKEND)
|
||||
|
||||
@ -886,9 +805,6 @@ add_test_executable(mxs2450_change_user_crash.cpp mxs2450_change_user_crash mxs2
|
||||
# MXS-1662: PAM admin authentication
|
||||
add_test_executable(mxs1662_pam_admin.cpp mxs1662_pam_admin mxs1662_pam_admin LABELS REPL_BACKEND)
|
||||
|
||||
# MXS-2441: Add support for read-only slaves to galeramon
|
||||
add_test_executable(mxs2441_galera_slaves.cpp mxs2441_galera_slaves mxs2441_galera_slaves LABELS REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
# MXS-2414: Block host after repeated authentication failures
|
||||
add_test_executable(mxs2414_host_blocking.cpp mxs2414_host_blocking replication LABELS REPL_BACKEND)
|
||||
|
||||
@ -1124,6 +1040,84 @@ set_tests_properties(bug471_big PROPERTIES TIMEOUT 3600)
|
||||
# END: tests with 15 machines backend #
|
||||
############################################
|
||||
|
||||
############################################
|
||||
# BEGIN: Galera tests #
|
||||
############################################
|
||||
|
||||
# Crash in case of backend node in Galera cluster stopping and then reconnect to Maxscale
|
||||
add_test_executable(bug676.cpp bug676 galera LABELS galeramon GALERA_BACKEND)
|
||||
|
||||
# Galera node priority test
|
||||
add_test_executable(galera_priority.cpp galera_priority galera_priority LABELS galeramon LIGHT GALERA_BACKEND)
|
||||
|
||||
# INSERT extremelly big number of rows
|
||||
add_test_executable(lots_of_rows.cpp lots_of_rows galera LABELS readwritesplit HEAVY GALERA_BACKEND)
|
||||
|
||||
# Prepearing and execution statements in the loop
|
||||
add_test_executable(mxs244_prepared_stmt_loop.cpp mxs244_prepared_stmt_loop galera LABELS readwritesplit readconnroute LIGHT GALERA_BACKEND)
|
||||
|
||||
# Tries prepared stmt 'SELECT 1,1,1,1...." with different nu,ber of '1'
|
||||
add_test_executable(mxs314.cpp mxs314 galera LABELS MySQLProtocol readwritesplit LIGHT GALERA_BACKEND)
|
||||
|
||||
# Playing with blocking and unblocking nodes under INSERT load
|
||||
add_test_executable(mxs564_big_dump.cpp mxs564_big_dump galera_mxs564 LABELS readwritesplit readconnroute GALERA_BACKEND)
|
||||
|
||||
# MXS-1476: priority value ignored when a Galera node rejoins with a lower wsrep_local_index than current master
|
||||
# https://jira.mariadb.org/browse/MXS-1476
|
||||
add_test_executable(mxs1476.cpp mxs1476 mxs1476 LABELS galeramon GALERA_BACKEND)
|
||||
|
||||
# MXS-1751: Maxscale crashes when certain config is in play (with nodes down)
|
||||
# https://jira.mariadb.org/browse/MXS-1751
|
||||
add_test_executable(mxs1751_available_when_donor_crash.cpp mxs1751_available_when_donor_crash mxs1751_available_when_donor_crash LABELS galeramon GALERA_BACKEND)
|
||||
|
||||
# Persistant connection test
|
||||
add_test_executable(pers_01.cpp pers_01 pers_01 LABELS maxscale REPL_BACKEND readwritesplit GALERA_BACKEND)
|
||||
|
||||
# MXS-1980: Support Galera cluster nodes as masters for Binlog Router
|
||||
# https://jira.mariadb.org/browse/MXS-1980
|
||||
add_test_executable(mxs1980_blr_galera_server_ids.cpp mxs1980_blr_galera_server_ids mxs1980_blr_galera_server_ids LABELS binlogrouter GALERA_BACKEND REPL_BACKEND)
|
||||
|
||||
# MXS-2441: Add support for read-only slaves to galeramon
|
||||
add_test_executable(mxs2441_galera_slaves.cpp mxs2441_galera_slaves mxs2441_galera_slaves LABELS REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
# Test of external script execution
|
||||
add_test_executable(script.cpp script script LABELS maxscale REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
# Test with persistant connections configured and big number iof opened connections ,expect no crash
|
||||
add_test_executable(pers_02.cpp pers_02 pers_01 LABELS maxscale GALERA_BACKEND REPL_BACKEND readwritesplit)
|
||||
|
||||
# MXS-1585: Crash in MaxScale 2.1.12
|
||||
# https://jira.mariadb.org/browse/MXS-1585
|
||||
add_test_executable(mxs1585.cpp mxs1585 mxs1585 LABELS GALERA_BACKEND)
|
||||
|
||||
# Simple connect test in bash, checks that defined in cmd line DB is selected (Galera backend)
|
||||
add_test_script(mxs791_galera.sh mxs791.sh galera LABELS UNSTABLE HEAVY GALERA_BACKEND)
|
||||
|
||||
# Crash with Galera and backend restart when persistant cfonnections are in use
|
||||
add_test_derived(mxs361 pers_02 mxs361 mxs361 LABELS maxscale REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
# A set of MariaDB server tests executed against Maxscale RWSplit (Galera backend)
|
||||
add_test_script(mariadb_tests_hartmut_galera.sh mariadb_tests_hartmut.sh galera_hartmut LABELS readwritesplit GALERA_BACKEND)
|
||||
|
||||
# Test with extremely big blob inserting/selecting with > 16 mb data blocks
|
||||
add_test_executable(mxs1110_16mb.cpp mxs1110_16mb longblob_filters LABELS readwritesplit readconnroute HEAVY REPL_BACKEND GALERA_BACKEND)
|
||||
|
||||
############################################
|
||||
# END: Galera tests #
|
||||
############################################
|
||||
|
||||
############################################
|
||||
# BEGIN: ColumnStore tests #
|
||||
############################################
|
||||
|
||||
# MXS-2146: Add test case for csmon
|
||||
# https://jira.mariadb.org/browse/MXS-2146
|
||||
add_test_executable(csmon_test.cpp csmon_test csmon_test LABELS csmon CS_BACKEND)
|
||||
|
||||
############################################
|
||||
# END: ColumnStore tests #
|
||||
############################################
|
||||
|
||||
############################################
|
||||
# BEGIN: tests for Xpand monitor #
|
||||
############################################
|
||||
|
@ -1,93 +0,0 @@
|
||||
[maxscale]
|
||||
threads=###threads###
|
||||
log_warning=1
|
||||
|
||||
[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
|
||||
filters=nsfilter
|
||||
|
||||
[nsfilter]
|
||||
type=filter
|
||||
module=namedserverfilter
|
||||
match=test
|
||||
server=server1
|
||||
|
||||
[Read-Connection-Router-Slave]
|
||||
type=service
|
||||
router=readconnroute
|
||||
router_options=slave
|
||||
servers=server1, server2, server3, server4
|
||||
user=maxskysql
|
||||
password=skysql
|
||||
|
||||
[Read-Connection-Router-Master]
|
||||
type=service
|
||||
router=readconnroute
|
||||
router_options=master
|
||||
servers=server1, server2, server3, server4
|
||||
user=maxskysql
|
||||
password=skysql
|
||||
|
||||
[RW-Split-Listener]
|
||||
type=listener
|
||||
service=RW-Split-Router
|
||||
protocol=MySQLClient
|
||||
port=4006
|
||||
|
||||
[Read-Connection-Listener-Slave]
|
||||
type=listener
|
||||
service=Read-Connection-Router-Slave
|
||||
protocol=MySQLClient
|
||||
port=4009
|
||||
|
||||
[Read-Connection-Listener-Master]
|
||||
type=listener
|
||||
service=Read-Connection-Router-Master
|
||||
protocol=MySQLClient
|
||||
port=4008
|
||||
|
||||
[CLI]
|
||||
type=service
|
||||
router=cli
|
||||
|
||||
[CLI-Listener]
|
||||
type=listener
|
||||
service=CLI
|
||||
protocol=maxscaled
|
||||
socket=default
|
||||
|
||||
[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
|
@ -209,6 +209,7 @@ int main(int argc, char** argv)
|
||||
int server2_ind = 1;
|
||||
int server1_id = test.repl->get_server_id(server1_ind);
|
||||
|
||||
const int N = 4;
|
||||
const char* server_names[] = {"server1", "server2", "server3", "server4"};
|
||||
auto server1_name = server_names[server1_ind];
|
||||
auto server2_name = server_names[server2_ind];
|
||||
@ -307,10 +308,10 @@ int main(int argc, char** argv)
|
||||
if (test.ok())
|
||||
{
|
||||
// Check that all other nodes are slaves.
|
||||
for (int i = 1; i < test.repl->N; i++)
|
||||
for (int i = 1; i < N; i++)
|
||||
{
|
||||
string server_name = server_names[i];
|
||||
auto states = test.maxscales->get_server_status(server_name.c_str());
|
||||
states = test.maxscales->get_server_status(server_name.c_str());
|
||||
test.expect(states.count("Slave") == 1, "%s is not a slave.", server_name.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -105,8 +105,7 @@ void run(TestConnections& test)
|
||||
{
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
int N = test.repl->N;
|
||||
cout << "Nodes: " << N << endl;
|
||||
const int N = 4;
|
||||
|
||||
expect(test, "server1", "Master", "Running");
|
||||
expect(test, "server2", "Slave", "Running");
|
||||
|
@ -208,8 +208,7 @@ void run(XTestConnections& test)
|
||||
{
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
int N = test.repl->N;
|
||||
cout << "Nodes: " << N << endl;
|
||||
const int N = 4;
|
||||
|
||||
cout << "\nConnecting to MaxScale." << endl;
|
||||
test.connect_maxscale();
|
||||
|
@ -158,8 +158,7 @@ void run(TestConnections& test)
|
||||
{
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
int N = test.repl->N;
|
||||
cout << "Nodes: " << N << endl;
|
||||
const int N = 4;
|
||||
|
||||
check_server_status(test, N);
|
||||
|
||||
|
@ -34,6 +34,9 @@ const time_t FAILOVER_DURATION = 5;
|
||||
// The test now runs only two failovers. Change for a longer time limit later.
|
||||
// TODO: add semisync to remove this limitation.
|
||||
|
||||
// Number of backends
|
||||
const int N = 4;
|
||||
|
||||
#define CMESSAGE(msg) \
|
||||
do { \
|
||||
stringstream ss; \
|
||||
@ -506,7 +509,7 @@ bool is_valid_server_id(TestConnections& test, int id)
|
||||
std::set<int> ids;
|
||||
test.repl->connect();
|
||||
|
||||
for (int i = 0; i < test.repl->N; i++)
|
||||
for (int i = 0; i < N; i++)
|
||||
{
|
||||
ids.insert(test.repl->get_server_id(i));
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ int main(int argc, char** argv)
|
||||
const char READ_ONLY_OFF[] = "SET GLOBAL read_only=0;";
|
||||
|
||||
const int FIRST_MOD_NODE = 2; // Modify nodes 2 & 3
|
||||
const int NODE_COUNT = test.repl->N;
|
||||
const int NODE_COUNT = 4;
|
||||
MYSQL** nodes = test.repl->nodes;
|
||||
for (int i = FIRST_MOD_NODE; i < NODE_COUNT; i++)
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ int main(int argc, char** argv)
|
||||
const char READ_ONLY_OFF[] = "SET GLOBAL read_only=0;";
|
||||
test.repl->connect();
|
||||
const int FIRST_MOD_NODE = 2; // Modify nodes 2 & 3
|
||||
const int NODE_COUNT = test.repl->N;
|
||||
const int NODE_COUNT = 4;
|
||||
MYSQL** nodes = test.repl->nodes;
|
||||
|
||||
for (int i = FIRST_MOD_NODE; i < NODE_COUNT; i++)
|
||||
|
@ -50,6 +50,7 @@ int main(int argc, char** argv)
|
||||
const char drop_query[] = "DROP TABLE test.t1;";
|
||||
const char strict_mode[] = "SET GLOBAL gtid_strict_mode=%i;";
|
||||
|
||||
const int N = 4;
|
||||
string server_names[] = {"server1", "server2", "server3", "server4"};
|
||||
string master = "Master";
|
||||
string slave = "Slave";
|
||||
@ -118,7 +119,7 @@ int main(int argc, char** argv)
|
||||
expect_server_status(server_names[3], slave);
|
||||
// Check that the values on the databases are identical by summing the values.
|
||||
int expected_sum = 55; // 11 * 5
|
||||
for (int i = 0; i < test.repl->N; i++)
|
||||
for (int i = 0; i < N; i++)
|
||||
{
|
||||
int sum = read_sum(i);
|
||||
test.expect(sum == expected_sum,
|
||||
|
@ -123,8 +123,7 @@ void run(TestConnections& test)
|
||||
{
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
int N = test.repl->N;
|
||||
cout << "Nodes: " << N << endl;
|
||||
const int N = 4;
|
||||
|
||||
expect(test, "server1", "Master", "Running");
|
||||
expect(test, "server2", "Slave", "Running");
|
||||
|
@ -29,13 +29,14 @@ int main(int argc, char** argv)
|
||||
|
||||
test.repl->connect();
|
||||
delete_slave_binlogs(test);
|
||||
const int N = 4;
|
||||
|
||||
// Enable the disks-plugin on all servers. Has to be done before MaxScale is on to prevent disk space
|
||||
// monitoring from disabling itself.
|
||||
bool disks_plugin_loaded = false;
|
||||
const char strict_mode[] = "SET GLOBAL gtid_strict_mode=%i;";
|
||||
test.repl->connect();
|
||||
for (int i = 0; i < test.repl->N; i++)
|
||||
for (int i = 0; i < N; i++)
|
||||
{
|
||||
MYSQL* conn = test.repl->nodes[i];
|
||||
test.try_query(conn, "INSTALL SONAME 'disks';");
|
||||
@ -149,8 +150,8 @@ int main(int argc, char** argv)
|
||||
|
||||
if (disks_plugin_loaded)
|
||||
{
|
||||
// Enable the disks-plugin on all servers.
|
||||
for (int i = 0; i < test.repl->N; i++)
|
||||
// Disable the disks-plugin on all servers.
|
||||
for (int i = 0; i < N; i++)
|
||||
{
|
||||
MYSQL* conn = test.repl->nodes[i];
|
||||
test.try_query(conn, "UNINSTALL SONAME 'disks';");
|
||||
|
@ -123,8 +123,7 @@ void run(TestConnections& test)
|
||||
{
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
int N = test.repl->N;
|
||||
cout << "Nodes: " << N << endl;
|
||||
const int N = 4;
|
||||
|
||||
expect(test, "server1", "Master", "Running");
|
||||
expect(test, "server2", "Slave", "Running");
|
||||
|
@ -1,89 +0,0 @@
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
import os
|
||||
import time
|
||||
import jaydebeapi
|
||||
|
||||
# Abstract SQL connection
|
||||
class SQLConnection:
|
||||
def __init__(self, port = '3306', host = '127.0.0.1', user = 'root', password = ''):
|
||||
self.host = str(host)
|
||||
self.port = str(port)
|
||||
self.user = str(user)
|
||||
self.password = str(password)
|
||||
|
||||
# Connect to a server
|
||||
def connect(self, options = ""):
|
||||
try:
|
||||
self.conn = jaydebeapi.connect("org.mariadb.jdbc.Driver", ["jdbc:mariadb://" + self.host + ":" + self.port + "/test?" + options, self.user, self.password],"./maxscale/java/mariadb-java-client-1.3.3.jar")
|
||||
except Exception as ex:
|
||||
print("Failed to connect to " + self.host + ":" + self.port + " as " + self.user + ":" + self.password)
|
||||
print(unicode(ex))
|
||||
exit(1)
|
||||
|
||||
# Start a transaction
|
||||
def begin(self):
|
||||
curs = self.conn.cursor()
|
||||
curs.execute("BEGIN")
|
||||
curs.close()
|
||||
# Commit a transaction
|
||||
def commit(self):
|
||||
curs = self.conn.cursor()
|
||||
curs.execute("COMMIT")
|
||||
curs.close()
|
||||
|
||||
# Query and test if the result matches the expected value if one is provided
|
||||
def query(self, query, compare = None, column = 0):
|
||||
curs = self.conn.cursor()
|
||||
curs.execute(query)
|
||||
return curs.fetchall()
|
||||
|
||||
def query_and_compare(self, query, column):
|
||||
data = self.query(query)
|
||||
for row in data:
|
||||
if str(row[column]) == compare:
|
||||
return True
|
||||
return False
|
||||
|
||||
def disconnect(self):
|
||||
self.conn.close()
|
||||
|
||||
def query_and_close(self, query):
|
||||
self.connect()
|
||||
self.query(query)
|
||||
self.disconnect()
|
||||
|
||||
# Test environment abstraction
|
||||
class MaxScaleTest:
|
||||
def __init__(self, testname = "python_test"):
|
||||
|
||||
self.testname = testname
|
||||
# prepare_test(testname)
|
||||
|
||||
# MaxScale connections
|
||||
self.maxscale = dict()
|
||||
self.maxscale['rwsplit'] = SQLConnection(host = os.getenv("maxscale_000_network"), port = "4006", user = os.getenv("maxscale_user"), password = os.getenv("maxscale_password"))
|
||||
self.maxscale['rcmaster'] = SQLConnection(host = os.getenv("maxscale_000_network"), port = "4008", user = os.getenv("maxscale_user"), password = os.getenv("maxscale_password"))
|
||||
self.maxscale['rcslave'] = SQLConnection(host = os.getenv("maxscale_000_network"), port = "4009", user = os.getenv("maxscale_user"), password = os.getenv("maxscale_password"))
|
||||
|
||||
# Master-Slave nodes
|
||||
self.repl = dict()
|
||||
self.repl['node0'] = SQLConnection(host = os.getenv("node_000_network"), port = os.getenv("node_000_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
self.repl['node1'] = SQLConnection(host = os.getenv("node_001_network"), port = os.getenv("node_001_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
self.repl['node2'] = SQLConnection(host = os.getenv("node_002_network"), port = os.getenv("node_002_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
self.repl['node3'] = SQLConnection(host = os.getenv("node_003_network"), port = os.getenv("node_003_port"), user = os.getenv("node_user"), password = os.getenv("node_password"))
|
||||
|
||||
# Galera nodes
|
||||
self.galera = dict()
|
||||
self.galera['node0'] = SQLConnection(host = os.getenv("galera_000_network"), port = os.getenv("galera_000_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
self.galera['node1'] = SQLConnection(host = os.getenv("galera_001_network"), port = os.getenv("galera_001_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
self.galera['node2'] = SQLConnection(host = os.getenv("galera_002_network"), port = os.getenv("galera_002_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
self.galera['node3'] = SQLConnection(host = os.getenv("galera_003_network"), port = os.getenv("galera_003_port"), user = os.getenv("galera_user"), password = os.getenv("galera_password"))
|
||||
|
||||
# def __del__(self):
|
||||
# subprocess.call(os.getcwd() + "/copy_logs.sh " + str(self.testname), shell=True)
|
||||
|
||||
# Read test environment variables
|
||||
#def prepare_test(testname = "replication"):
|
||||
# subprocess.call(os.getcwd() + "/non_native_setup " + str(testname), shell=True)
|
@ -64,5 +64,7 @@ int main(int argc, char* argv[])
|
||||
test.expect(mysql_query(test.maxscales->conn_rwsplit[0], "SELECT 1") == 0, "Normal queries should work");
|
||||
test.maxscales->disconnect();
|
||||
|
||||
test.stop_timeout();
|
||||
|
||||
return test.global_result;
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
###
|
||||
## @file mxs585.py Regression case for MXS-585 "Intermittent connection failure with MaxScale 1.2/1.3 using MariaDB/J 1.3"
|
||||
## - open connection, execute simple query and close connection in the loop
|
||||
|
||||
import maxpython
|
||||
|
||||
test1 = maxpython.MaxScaleTest("mxs585.py1")
|
||||
|
||||
for i in range(0,100):
|
||||
if i % 10 == 0:
|
||||
print(str(i))
|
||||
test1.maxscale['rwsplit'].query_and_close("select 1")
|
||||
test1.maxscale['rcmaster'].query_and_close("select 1")
|
||||
test1.maxscale['rcslave'].query_and_close("select 1")
|
@ -1,27 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
|
||||
###
|
||||
## @file mxs598.py Regression case for MXS-598 "SSL RW Router / JDBC Exception"
|
||||
## - use SSL for Maxscale client connection
|
||||
## - simple transactions in the loop
|
||||
|
||||
import maxpython
|
||||
|
||||
test1 = maxpython.MaxScaleTest("mxs598.py")
|
||||
|
||||
print("Connecting to MaxScale")
|
||||
for i in test1.maxscale.values():
|
||||
i.connect("useSSL=true&requireSSL=true&verifyServerCert=false")
|
||||
|
||||
print("Trying 100 simple transactions on all services")
|
||||
for i in range(0,100):
|
||||
for x in test1.maxscale.values():
|
||||
x.begin()
|
||||
x.query("insert into test.t1 values (1)")
|
||||
x.query("select * from test.t1")
|
||||
x.commit()
|
||||
|
||||
print("Closing connections")
|
||||
for i in test1.maxscale.values():
|
||||
i.disconnect()
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import maxpython
|
||||
|
||||
test = maxpython.MaxScaleTest("nsfilter")
|
||||
|
||||
server_id = []
|
||||
|
||||
for conn in test.repl:
|
||||
server_id[conn] = conn.query("SELECT @@server_id")
|
||||
|
||||
nomatch = test.maxscale['rwsplit'].query("SELECT @@server_id")
|
||||
match = test.maxscale['rwsplit'].query("SELECT \"test\", @@server_id")
|
||||
|
||||
print(nomatch)
|
||||
print(match)
|
@ -154,19 +154,36 @@ void check_softfailing(const MaxRest& maxrest)
|
||||
{
|
||||
TestConnections& test = maxrest.test();
|
||||
|
||||
string id("@@Xpand-Monitor:node-2"); // Just an arbitrary dynamic node.
|
||||
// We'll softfail the node with the largest nid. Any node would do,
|
||||
// but for repeatability the same should be selected each time.
|
||||
auto servers = maxrest.list_servers();
|
||||
string id;
|
||||
int max_nid = -1;
|
||||
|
||||
for (const auto& server : servers)
|
||||
{
|
||||
auto i = server.name.find_last_of("-");
|
||||
auto s = server.name.substr(i + 1);
|
||||
int nid = atoi(s.c_str());
|
||||
|
||||
if (nid > max_nid)
|
||||
{
|
||||
id = server.name;
|
||||
max_nid = nid;
|
||||
}
|
||||
}
|
||||
|
||||
MaxRest::Server before = maxrest.show_server(id);
|
||||
expect_server_to_be(maxrest, before, "Master, Running");
|
||||
|
||||
cout << "Softfailing " << id << "." << endl;
|
||||
maxrest.call_command("xpandmon", "softfail", monitor_name, { "@@Xpand-Monitor:node-2" });
|
||||
maxrest.call_command("xpandmon", "softfail", monitor_name, { id });
|
||||
|
||||
MaxRest::Server during = maxrest.show_server(id);
|
||||
expect_server_to_be(maxrest, during, "Drained");
|
||||
|
||||
cout << "Unsoftfailing " << id << "." << endl;
|
||||
maxrest.call_command("xpandrixmon", "unsoftfail", monitor_name, { "@@Xpand-Monitor:node-2" });
|
||||
maxrest.call_command("xpandmon", "unsoftfail", monitor_name, { id });
|
||||
|
||||
MaxRest::Server after = maxrest.show_server(id);
|
||||
expect_server_to_be(maxrest, after, "Master, Running");
|
||||
|
Loading…
x
Reference in New Issue
Block a user