From 36f2af810a29e1282ffa1ff25353c3c8386a09f1 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 23 Nov 2020 12:47:32 +0200 Subject: [PATCH 1/5] 2.4.14 Fix xpand_basics The test assumed a certain node would always be present. Now the test figures out what id to use. Also fix broken clustrix -> xpand renaming. --- system-test/xpand_basics.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/system-test/xpand_basics.cpp b/system-test/xpand_basics.cpp index 353a8f43c..e94dc066e 100644 --- a/system-test/xpand_basics.cpp +++ b/system-test/xpand_basics.cpp @@ -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"); From 454e9aca1430f3d914dadb28ebca20ac6945ba78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 23 Nov 2020 14:19:54 +0200 Subject: [PATCH 2/5] Stop timeout before finishing test This helps distinguish actual timeouts that happen during the test and timeouts that happen during the test shutdown. --- system-test/mxs1787_call_ps.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system-test/mxs1787_call_ps.cpp b/system-test/mxs1787_call_ps.cpp index 11222e2e9..d8af154e4 100644 --- a/system-test/mxs1787_call_ps.cpp +++ b/system-test/mxs1787_call_ps.cpp @@ -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; } From 3003ad6385474796043350ac6142cf764fa94248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 23 Nov 2020 14:27:38 +0200 Subject: [PATCH 3/5] Remove Python tests The tests are not very good and require custom Python modules to be installed. In addition, they were written for Python2 which is no longer available on all modern systems. --- system-test/CMakeLists.txt | 6 -- .../cnf/maxscale.cnf.template.nsfilter | 93 ------------------- system-test/maxpython.py | 89 ------------------ system-test/mxs585.py | 16 ---- system-test/mxs598.py | 27 ------ system-test/nsfilter.py | 16 ---- 6 files changed, 247 deletions(-) delete mode 100644 system-test/cnf/maxscale.cnf.template.nsfilter delete mode 100644 system-test/maxpython.py delete mode 100755 system-test/mxs585.py delete mode 100755 system-test/mxs598.py delete mode 100755 system-test/nsfilter.py diff --git a/system-test/CMakeLists.txt b/system-test/CMakeLists.txt index bc5ecf747..7a86ce719 100644 --- a/system-test/CMakeLists.txt +++ b/system-test/CMakeLists.txt @@ -410,12 +410,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) diff --git a/system-test/cnf/maxscale.cnf.template.nsfilter b/system-test/cnf/maxscale.cnf.template.nsfilter deleted file mode 100644 index 012708955..000000000 --- a/system-test/cnf/maxscale.cnf.template.nsfilter +++ /dev/null @@ -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 diff --git a/system-test/maxpython.py b/system-test/maxpython.py deleted file mode 100644 index 7f1ad021b..000000000 --- a/system-test/maxpython.py +++ /dev/null @@ -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) diff --git a/system-test/mxs585.py b/system-test/mxs585.py deleted file mode 100755 index 772a0b209..000000000 --- a/system-test/mxs585.py +++ /dev/null @@ -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") diff --git a/system-test/mxs598.py b/system-test/mxs598.py deleted file mode 100755 index ddb07180f..000000000 --- a/system-test/mxs598.py +++ /dev/null @@ -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() diff --git a/system-test/nsfilter.py b/system-test/nsfilter.py deleted file mode 100755 index 329be7886..000000000 --- a/system-test/nsfilter.py +++ /dev/null @@ -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) From abd1efefc6773c7ff0b71299706912b34b59e575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 24 Nov 2020 10:06:14 +0200 Subject: [PATCH 4/5] Group Galera tests correctly Grouping tests that require Galera backend together delays the creation of those backends until they are needed. --- system-test/CMakeLists.txt | 156 ++++++++++++++++++------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/system-test/CMakeLists.txt b/system-test/CMakeLists.txt index 7a86ce719..82f156d5c 100644 --- a/system-test/CMakeLists.txt +++ b/system-test/CMakeLists.txt @@ -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) @@ -429,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) @@ -560,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) @@ -652,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) @@ -694,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) @@ -880,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) @@ -1118,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 # ############################################ From 885077b4d084976ae9a78efeff73b980c3621bca Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Tue, 24 Nov 2020 10:42:52 +0200 Subject: [PATCH 5/5] Avoid using test.repl->N in MariaDBMonitor tests The value may not match the nodes used by the test. --- system-test/mariadbmonitor/mysqlmon_fail_switch_events.cpp | 5 +++-- .../mariadbmonitor/mysqlmon_failover_rejoin_old_slave.cpp | 3 +-- .../mariadbmonitor/mysqlmon_failover_rolling_master.cpp | 3 +-- .../mysqlmon_failover_rolling_restart_slaves.cpp | 3 +-- system-test/mariadbmonitor/mysqlmon_failover_stress.cpp | 5 ++++- system-test/mariadbmonitor/mysqlmon_rejoin_bad.cpp | 2 +- system-test/mariadbmonitor/mysqlmon_rejoin_manual2.cpp | 2 +- system-test/mariadbmonitor/mysqlmon_reset_replication.cpp | 3 ++- system-test/mariadbmonitor/mysqlmon_switchover.cpp | 3 +-- system-test/mariadbmonitor/mysqlmon_switchover_auto.cpp | 7 ++++--- .../mariadbmonitor/mysqlmon_switchover_bad_master.cpp | 3 +-- 11 files changed, 20 insertions(+), 19 deletions(-) diff --git a/system-test/mariadbmonitor/mysqlmon_fail_switch_events.cpp b/system-test/mariadbmonitor/mysqlmon_fail_switch_events.cpp index 14dc6e08a..348be3bc6 100644 --- a/system-test/mariadbmonitor/mysqlmon_fail_switch_events.cpp +++ b/system-test/mariadbmonitor/mysqlmon_fail_switch_events.cpp @@ -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()); } } diff --git a/system-test/mariadbmonitor/mysqlmon_failover_rejoin_old_slave.cpp b/system-test/mariadbmonitor/mysqlmon_failover_rejoin_old_slave.cpp index ec2e2a3ed..a219d0f55 100644 --- a/system-test/mariadbmonitor/mysqlmon_failover_rejoin_old_slave.cpp +++ b/system-test/mariadbmonitor/mysqlmon_failover_rejoin_old_slave.cpp @@ -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"); diff --git a/system-test/mariadbmonitor/mysqlmon_failover_rolling_master.cpp b/system-test/mariadbmonitor/mysqlmon_failover_rolling_master.cpp index 43066ac1c..1987eaee1 100644 --- a/system-test/mariadbmonitor/mysqlmon_failover_rolling_master.cpp +++ b/system-test/mariadbmonitor/mysqlmon_failover_rolling_master.cpp @@ -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(); diff --git a/system-test/mariadbmonitor/mysqlmon_failover_rolling_restart_slaves.cpp b/system-test/mariadbmonitor/mysqlmon_failover_rolling_restart_slaves.cpp index b04c496c7..00edff0d1 100644 --- a/system-test/mariadbmonitor/mysqlmon_failover_rolling_restart_slaves.cpp +++ b/system-test/mariadbmonitor/mysqlmon_failover_rolling_restart_slaves.cpp @@ -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); diff --git a/system-test/mariadbmonitor/mysqlmon_failover_stress.cpp b/system-test/mariadbmonitor/mysqlmon_failover_stress.cpp index a89ba676b..a94960c0e 100644 --- a/system-test/mariadbmonitor/mysqlmon_failover_stress.cpp +++ b/system-test/mariadbmonitor/mysqlmon_failover_stress.cpp @@ -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 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)); } diff --git a/system-test/mariadbmonitor/mysqlmon_rejoin_bad.cpp b/system-test/mariadbmonitor/mysqlmon_rejoin_bad.cpp index 778406163..e735eb85d 100644 --- a/system-test/mariadbmonitor/mysqlmon_rejoin_bad.cpp +++ b/system-test/mariadbmonitor/mysqlmon_rejoin_bad.cpp @@ -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++) { diff --git a/system-test/mariadbmonitor/mysqlmon_rejoin_manual2.cpp b/system-test/mariadbmonitor/mysqlmon_rejoin_manual2.cpp index 612507751..22feed339 100644 --- a/system-test/mariadbmonitor/mysqlmon_rejoin_manual2.cpp +++ b/system-test/mariadbmonitor/mysqlmon_rejoin_manual2.cpp @@ -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++) diff --git a/system-test/mariadbmonitor/mysqlmon_reset_replication.cpp b/system-test/mariadbmonitor/mysqlmon_reset_replication.cpp index df2b8df60..b571a4457 100644 --- a/system-test/mariadbmonitor/mysqlmon_reset_replication.cpp +++ b/system-test/mariadbmonitor/mysqlmon_reset_replication.cpp @@ -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, diff --git a/system-test/mariadbmonitor/mysqlmon_switchover.cpp b/system-test/mariadbmonitor/mysqlmon_switchover.cpp index 55fdc856d..094b71c9f 100644 --- a/system-test/mariadbmonitor/mysqlmon_switchover.cpp +++ b/system-test/mariadbmonitor/mysqlmon_switchover.cpp @@ -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"); diff --git a/system-test/mariadbmonitor/mysqlmon_switchover_auto.cpp b/system-test/mariadbmonitor/mysqlmon_switchover_auto.cpp index c2939c44b..3615de216 100644 --- a/system-test/mariadbmonitor/mysqlmon_switchover_auto.cpp +++ b/system-test/mariadbmonitor/mysqlmon_switchover_auto.cpp @@ -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';"); diff --git a/system-test/mariadbmonitor/mysqlmon_switchover_bad_master.cpp b/system-test/mariadbmonitor/mysqlmon_switchover_bad_master.cpp index 75ece026a..d4f8e505d 100644 --- a/system-test/mariadbmonitor/mysqlmon_switchover_bad_master.cpp +++ b/system-test/mariadbmonitor/mysqlmon_switchover_bad_master.cpp @@ -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");