From a46881c0cc93a00020ae8cc37814513658d62cb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 29 Dec 2017 10:05:19 +0200 Subject: [PATCH 1/8] MXS-1585: Check that the master refence is in use The check for the current master backend did not see if the backend was actually in use. This would be the case when the backend would be originally in use but would be later disabled. --- server/modules/routing/readwritesplit/rwsplit_route_stmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c index 0f7ebae2e..0a0bc088c 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.c +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.c @@ -1157,7 +1157,8 @@ static void log_master_routing_failure(ROUTER_CLIENT_SES *rses, bool found, bool handle_master_is_target(ROUTER_INSTANCE *inst, ROUTER_CLIENT_SES *rses, DCB **target_dcb) { - DCB *master_dcb = rses->rses_master_ref ? rses->rses_master_ref->bref_dcb : NULL; + DCB *master_dcb = rses->rses_master_ref && BREF_IS_IN_USE(rses->rses_master_ref) ? + rses->rses_master_ref->bref_dcb : NULL; DCB *curr_master_dcb = NULL; bool succp = rwsplit_get_dcb(&curr_master_dcb, rses, BE_MASTER, NULL, MAX_RLAG_UNDEFINED); From 95983ddaf4d70e52cf6fced70ca4695493501ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 28 Dec 2017 15:01:29 +0200 Subject: [PATCH 2/8] Fix unit test failures When the unit tests were run without installing the libraries in their final locations, the loading of the modules would fail. Using locations relative to the build directory allows unit testing without having to install the libraries. --- .../modules/filter/cache/test/testkeygeneration.cc | 10 ++++++++++ server/modules/filter/cache/test/testlrustorage.cc | 12 ++++++++++-- server/modules/filter/cache/test/testrawstorage.cc | 12 ++++++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/server/modules/filter/cache/test/testkeygeneration.cc b/server/modules/filter/cache/test/testkeygeneration.cc index a17518505..741b4b989 100644 --- a/server/modules/filter/cache/test/testkeygeneration.cc +++ b/server/modules/filter/cache/test/testkeygeneration.cc @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include #include #include "storagefactory.hh" @@ -126,11 +128,16 @@ int main(int argc, char* argv[]) if ((argc == 2) || (argc == 3)) { + char* libdir = MXS_STRDUP("../../../../../query_classifier/qc_sqlite/"); + set_libdir(libdir); + if (mxs_log_init(NULL, ".", MXS_LOG_TARGET_DEFAULT)) { if (qc_setup(NULL, NULL) && qc_process_init(QC_INIT_BOTH)) { const char* zModule = argv[1]; + libdir = MXS_STRDUP("../storage/storage_inmemory/"); + set_libdir(libdir); StorageFactory* pFactory = StorageFactory::Open(zModule); @@ -172,6 +179,9 @@ int main(int argc, char* argv[]) { cerr << "error: Could not initialize log." << endl; } + + // TODO: Remove this once globally allocated memory is freed + MXS_FREE(libdir); } else { diff --git a/server/modules/filter/cache/test/testlrustorage.cc b/server/modules/filter/cache/test/testlrustorage.cc index 75431726c..e26445046 100644 --- a/server/modules/filter/cache/test/testlrustorage.cc +++ b/server/modules/filter/cache/test/testlrustorage.cc @@ -13,6 +13,8 @@ #include #include +#include +#include #include "teststorage.hh" #include "testerlrustorage.hh" @@ -46,7 +48,13 @@ private: int main(int argc, char* argv[]) { - TestLRUStorage test(&cout); + char* libdir = MXS_STRDUP("../../../../../query_classifier/qc_sqlite/"); + set_libdir(libdir); - return test.run(argc, argv); + TestLRUStorage test(&cout); + int rv = test.run(argc, argv); + + // TODO: Remove this once globally allocated memory is freed + MXS_FREE(libdir); + return rv; } diff --git a/server/modules/filter/cache/test/testrawstorage.cc b/server/modules/filter/cache/test/testrawstorage.cc index 6f07691ca..2b60d8b40 100644 --- a/server/modules/filter/cache/test/testrawstorage.cc +++ b/server/modules/filter/cache/test/testrawstorage.cc @@ -13,6 +13,8 @@ #include #include +#include +#include #include "teststorage.hh" #include "testerrawstorage.hh" @@ -46,7 +48,13 @@ private: int main(int argc, char* argv[]) { - TestRawStorage test(&cout); + char* libdir = MXS_STRDUP("../../../../../query_classifier/qc_sqlite/"); + set_libdir(libdir); - return test.run(argc, argv); + TestRawStorage test(&cout); + int rv = test.run(argc, argv); + + // TODO: Remove this once globally allocated memory is freed + MXS_FREE(libdir); + return rv; } From ee8161af8348963353a5040318537144013c8466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 21 Dec 2017 17:07:58 +0200 Subject: [PATCH 3/8] Fix mxs1509 Temporarily disable the multi-source part of the test. Explicitly set gtid_slave_pos when changing master. Add missing parameter to configuration. --- .../cnf/maxscale.cnf.template.mxs1509 | 1 + maxscale-system-test/mxs1509.cpp | 39 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs1509 b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1509 index c839b0dad..4fa92207d 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.mxs1509 +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs1509 @@ -8,6 +8,7 @@ servers=server1,server2 user=maxskysql passwd=skysql monitor_interval=1000 +ignore_external_masters=true [RW Split Router] type=service diff --git a/maxscale-system-test/mxs1509.cpp b/maxscale-system-test/mxs1509.cpp index 4ae7f61bb..59ab717db 100644 --- a/maxscale-system-test/mxs1509.cpp +++ b/maxscale-system-test/mxs1509.cpp @@ -18,8 +18,10 @@ void change_master(TestConnections& test, int slave, int master, const char* nam source += "'"; } - execute_query(test.repl->nodes[slave], "STOP ALL SLAVES;CHANGE MASTER %s TO master_host='%s', master_port=3306, " - "master_user='%s', master_password='%s', master_use_gtid=slave_pos;START ALL SLAVES", + execute_query(test.repl->nodes[slave], "STOP ALL SLAVES;" + "SET GLOBAL gtid_slave_pos='0-1-0';" + "CHANGE MASTER %s TO master_host='%s', master_port=3306, master_user='%s', master_password='%s', master_use_gtid=slave_pos;" + "START ALL SLAVES", source.c_str(), test.repl->IP[master], test.repl->user_name, test.repl->password, source.c_str()); } @@ -61,34 +63,39 @@ int main(int argc, char** argv) { TestConnections test(argc, argv); - // Stop replication on nodes three and four test.repl->connect(); + test.tprintf("Server sanity check"); + check_status(test, {"Master", "Running"}, {"Slave", "Running"}); + + test.tprintf("Stop replication on nodes three and four"); execute_query(test.repl->nodes[2], "STOP ALL SLAVES; RESET SLAVE ALL;"); execute_query(test.repl->nodes[3], "STOP ALL SLAVES; RESET SLAVE ALL;"); - // Point the master to an external server + test.tprintf("Point the master to an external server"); change_master(test, 1, 0); change_master(test, 0, 2); check_status(test, {"Master", "Running"}, {"Slave", "Running"}); - // Resetting the slave on master should have no effect + test.tprintf("Resetting the slave on master should have no effect"); execute_query(test.repl->nodes[0], "STOP ALL SLAVES; RESET SLAVE ALL;"); check_status(test, {"Master", "Running"}, {"Slave", "Running"}); - // Configure multi-source replication, check that master status is as expected - change_master(test, 0, 2, "extra-slave"); - change_master(test, 1, 2, "extra-slave"); - check_status(test, {"Master", "Running"}, {"Slave", "Running", "Slave of External Server"}); + // TODO: Fix this so that multi-source replication is tested + // test.tprintf("Configure multi-source replication, check that master status is as expected"); + // change_master(test, 0, 2, "extra-slave"); + // change_master(test, 1, 2, "extra-slave"); + // check_status(test, {"Master", "Running"}, {"Slave", "Running", "Slave of External Server"}); - // Stopping multi-source replication on slave should remove the Slave of External Server status - execute_query(test.repl->nodes[1], "STOP SLAVE 'extra-slave'; RESET SLAVE 'extra-slave';"); - check_status(test, {"Master", "Running"}, {"Slave", "Running"}); + // test.tprintf("Stopping multi-source replication on slave should remove the Slave of External Server status"); + // execute_query(test.repl->nodes[1], "STOP SLAVE 'extra-slave'; RESET SLAVE 'extra-slave';"); + // check_status(test, {"Master", "Running"}, {"Slave", "Running"}); + // sleep(60); - // Doing the same on the master should have no effect - execute_query(test.repl->nodes[0], "STOP ALL SLAVES; RESET SLAVE ALL;"); - check_status(test, {"Master", "Running"}, {"Slave", "Running"}); + // test.tprintf("Doing the same on the master should have no effect"); + // execute_query(test.repl->nodes[0], "STOP ALL SLAVES; RESET SLAVE ALL;"); + // check_status(test, {"Master", "Running"}, {"Slave", "Running"}); - // Cleanup + test.tprintf("Cleanup"); test.repl->execute_query_all_nodes( "STOP ALL SLAVES; RESET SLAVE ALL;"); test.repl->fix_replication(); return test.global_result; From 8ac5c3d377c5a7b53dd186c1b3849faa3f879277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 29 Dec 2017 11:03:02 +0200 Subject: [PATCH 4/8] MXS-1585: Make the test more precise The test now more precisely exercises the code where the crash happened. --- maxscale-system-test/mxs1585.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/maxscale-system-test/mxs1585.cpp b/maxscale-system-test/mxs1585.cpp index 67769b50f..de800a171 100644 --- a/maxscale-system-test/mxs1585.cpp +++ b/maxscale-system-test/mxs1585.cpp @@ -51,24 +51,14 @@ int main(int argc, char** argv) pthread_create(&a, NULL, query_thr, &test); } - for (int i = 0; i < 15; i++) + for (int i = 0; i < 5; i++) { for (int x = 1; x <= 4; x++) { test.ssh_maxscale(true, "maxadmin set server server%d maintenance", x); sleep(1); test.ssh_maxscale(true, "maxadmin clear server server%d maintenance", x); - sleep(2); - - test.ssh_maxscale(true, "maxadmin remove server server%d \"RW Split Router\" \"Galera Monitor\"", x); sleep(1); - test.ssh_maxscale(true, "maxadmin add server server%d \"RW Split Router\" \"Galera Monitor\"", x); - sleep(2); - - test.galera->block_node(x - 1); - sleep(5); - test.galera->unblock_node(x - 1); - sleep(5); } } From 7d4fcf9e89f9e2ac85b98dadbd5098ff119ba217 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 29 Dec 2017 12:28:35 +0200 Subject: [PATCH 5/8] Update MaxScale 2.1 version number 2.1.13 --- VERSION21.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION21.cmake b/VERSION21.cmake index e1964f9f7..bba5e1b04 100644 --- a/VERSION21.cmake +++ b/VERSION21.cmake @@ -5,7 +5,7 @@ set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version") set(MAXSCALE_VERSION_MINOR "1" CACHE STRING "Minor version") -set(MAXSCALE_VERSION_PATCH "12" CACHE STRING "Patch version") +set(MAXSCALE_VERSION_PATCH "13" CACHE STRING "Patch version") # This should only be incremented if a package is rebuilt set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number") From bac3b95f0e26850f28829dca3d8dedb2488ab5b4 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 29 Dec 2017 12:32:33 +0200 Subject: [PATCH 6/8] Add 2.1.13 Release Notes, update ChangeLog and Upgrading --- Documentation/Changelog.md | 1 + .../MaxScale-2.1.13-Release-Notes.md | 51 +++++++++++++++++++ .../Upgrading/Upgrading-To-MaxScale-2.1.md | 1 + 3 files changed, 53 insertions(+) create mode 100644 Documentation/Release-Notes/MaxScale-2.1.13-Release-Notes.md diff --git a/Documentation/Changelog.md b/Documentation/Changelog.md index 225128ae3..50fff046b 100644 --- a/Documentation/Changelog.md +++ b/Documentation/Changelog.md @@ -21,6 +21,7 @@ * MaxScale now supports IPv6 For more details, please refer to: +* [MariaDB MaxScale 2.1.13 Release Notes](Release-Notes/MaxScale-2.1.13-Release-Notes.md) * [MariaDB MaxScale 2.1.12 Release Notes](Release-Notes/MaxScale-2.1.12-Release-Notes.md) * [MariaDB MaxScale 2.1.11 Release Notes](Release-Notes/MaxScale-2.1.11-Release-Notes.md) * [MariaDB MaxScale 2.1.10 Release Notes](Release-Notes/MaxScale-2.1.10-Release-Notes.md) diff --git a/Documentation/Release-Notes/MaxScale-2.1.13-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.1.13-Release-Notes.md new file mode 100644 index 000000000..6888bb079 --- /dev/null +++ b/Documentation/Release-Notes/MaxScale-2.1.13-Release-Notes.md @@ -0,0 +1,51 @@ +# MariaDB MaxScale 2.1.13 Release Notes + +Release 2.1.13 is a GA release. + +This document describes the changes in release 2.1.13, when compared +to release [2.1.12](MaxScale-2.1.12-Release-Notes.md). + +If you are upgrading from release 2.0, please also read the following +release notes: + +* [2.1.12](./MaxScale-2.1.12-Release-Notes.md) +* [2.1.11](./MaxScale-2.1.11-Release-Notes.md) +* [2.1.10](./MaxScale-2.1.10-Release-Notes.md) +* [2.1.9](./MaxScale-2.1.9-Release-Notes.md) +* [2.1.8](./MaxScale-2.1.8-Release-Notes.md) +* [2.1.7](./MaxScale-2.1.7-Release-Notes.md) +* [2.1.6](./MaxScale-2.1.6-Release-Notes.md) +* [2.1.5](./MaxScale-2.1.5-Release-Notes.md) +* [2.1.4](./MaxScale-2.1.4-Release-Notes.md) +* [2.1.3](./MaxScale-2.1.3-Release-Notes.md) +* [2.1.2](./MaxScale-2.1.2-Release-Notes.md) +* [2.1.1](./MaxScale-2.1.1-Release-Notes.md) +* [2.1.0](./MaxScale-2.1.0-Release-Notes.md) + +For any problems you encounter, please consider submitting a bug report at +[Jira](https://jira.mariadb.org). + +## Bug fixes + +[Here is a list of bugs fixed in MaxScale 2.1.13.](https://jira.mariadb.org/issues/?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20status%20%3D%20Closed%20AND%20fixVersion%20%3D%202.1.13) + +* [MXS-1585](https://jira.mariadb.org/browse/MXS-1585) Crash in MaxScale 2.1.12 +* [MXS-1582](https://jira.mariadb.org/browse/MXS-1582) Maxscale leaving socket behind after shutdown +* [MXS-1581](https://jira.mariadb.org/browse/MXS-1581) CREATE TABLE AS not supported +* [MXS-1580](https://jira.mariadb.org/browse/MXS-1580) Invalid handling of BIT values +* [MXS-1527](https://jira.mariadb.org/browse/MXS-1527) SELECT with session var is not supported + +## Packaging + +RPM and Debian packages are provided for the Linux distributions supported by +MariaDB Enterprise. + +Packages can be downloaded [here](https://mariadb.com/resources/downloads). + +## Source Code + +The source code of MaxScale is tagged at GitHub with a tag, which is identical +with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale +is maxscale-X.Y.Z. + +The source code is available [here](https://github.com/mariadb-corporation/MaxScale). diff --git a/Documentation/Upgrading/Upgrading-To-MaxScale-2.1.md b/Documentation/Upgrading/Upgrading-To-MaxScale-2.1.md index 5c1955a8b..625fc5e7d 100644 --- a/Documentation/Upgrading/Upgrading-To-MaxScale-2.1.md +++ b/Documentation/Upgrading/Upgrading-To-MaxScale-2.1.md @@ -7,6 +7,7 @@ For more information about MariaDB MaxScale 2.1, please refer to the [ChangeLog](../Changelog.md). For a complete list of changes in MaxScale 2.1, refer to the +* [MaxScale 2.1.13 Release Notes](../Release-Notes/MaxScale-2.1.13-Release-Notes.md) * [MaxScale 2.1.12 Release Notes](../Release-Notes/MaxScale-2.1.12-Release-Notes.md) * [MaxScale 2.1.11 Release Notes](../Release-Notes/MaxScale-2.1.11-Release-Notes.md) * [MaxScale 2.1.10 Release Notes](../Release-Notes/MaxScale-2.1.10-Release-Notes.md) From 6645281aeb66a863f7632bf61a2a92c66fbd4c10 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Fri, 29 Dec 2017 12:12:20 +0200 Subject: [PATCH 7/8] add killing mysqld process after snapshot revert --- maxscale-system-test/mariadb_nodes.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/maxscale-system-test/mariadb_nodes.cpp b/maxscale-system-test/mariadb_nodes.cpp index 9ee264d14..90c75aca2 100644 --- a/maxscale-system-test/mariadb_nodes.cpp +++ b/maxscale-system-test/mariadb_nodes.cpp @@ -916,6 +916,7 @@ bool Mariadb_nodes::revert_nodes_snapshot() { rval = false; } + ssh_node_f(i, true, "pkill -9 mysqld"); } return rval; } From aed66e28f6a3fcca5a9c506af190fd3aad6e7b57 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Tue, 2 Jan 2018 08:30:36 +0200 Subject: [PATCH 8/8] remove unnecessary template copying from upgrade_test.sh --- BUILD/mdbci/upgrade_test.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/BUILD/mdbci/upgrade_test.sh b/BUILD/mdbci/upgrade_test.sh index c446a0de9..9ac3efe1f 100755 --- a/BUILD/mdbci/upgrade_test.sh +++ b/BUILD/mdbci/upgrade_test.sh @@ -17,14 +17,10 @@ provider=`${mdbci_dir}/mdbci show provider $box --silent 2> /dev/null` name=$box-${JOB_NAME}-${BUILD_NUMBER}_upgradetest name=`echo $name | sed "s|/|-|g"` - -cp ${script_dir}/install.json.template ${MDBCI_VM_PATH}/$name.json - - eval "cat < /dev/null > $MDBCI_VM_PATH/${name}.json - while [ -f ~/vagrant_lock ] do sleep 5