From 84e456eee2335d9e14dc96bcf35e66135623652d Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Wed, 13 Mar 2019 12:53:12 +0200 Subject: [PATCH 01/11] ignore truncate() return in fwf_syntax test --- maxscale-system-test/fwf_syntax.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maxscale-system-test/fwf_syntax.cpp b/maxscale-system-test/fwf_syntax.cpp index b50c42d9f..13d2d7ee6 100644 --- a/maxscale-system-test/fwf_syntax.cpp +++ b/maxscale-system-test/fwf_syntax.cpp @@ -63,7 +63,7 @@ int main(int argc, char** argv) for (int i = 0; rules_failure[i]; i++) { /** Create rule file with syntax error */ - test.add_result(truncate(temp_rules, 0), "Failed to truncate"); + int __attribute__((unused)) rc = truncate(temp_rules, 0); create_rule(rules_failure[i], users_ok[0]); copy_rules(&test, (char*)temp_rules, (char*)test_dir); From e2ac52826a36180a8c1f09fba86d70ad2ed77108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 12 Mar 2019 07:24:19 +0200 Subject: [PATCH 02/11] MXS-2375: Provide aliases for [start|stop] maxscale The `start services` and `stop services` command aliases now map to the same command as `start maxscale` and `stop maxscale`. This should help alleviate the confusion that the command naming caused. --- maxctrl/lib/start.js | 4 ++-- maxctrl/lib/stop.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/maxctrl/lib/start.js b/maxctrl/lib/start.js index 4d684036f..c4cf0619f 100644 --- a/maxctrl/lib/start.js +++ b/maxctrl/lib/start.js @@ -33,10 +33,10 @@ exports.builder = function(yargs) { return doRequest(host, 'monitors/' + argv.name + '/start', null, {method: 'PUT'}) }) }) - .command('maxscale', 'Start MaxScale by starting all services', function(yargs) { + .command(['services', 'maxscale'], 'Start all services', function(yargs) { return yargs.epilog('This command will execute the `start service` command for ' + 'all services in MaxScale.') - .usage('Usage: start maxscale') + .usage('Usage: start [services|maxscale]') }, function(argv) { maxctrl(argv, function(host) { return doRequest(host, 'services/', function(res) { diff --git a/maxctrl/lib/stop.js b/maxctrl/lib/stop.js index e706c1781..7e1259c3b 100644 --- a/maxctrl/lib/stop.js +++ b/maxctrl/lib/stop.js @@ -37,10 +37,10 @@ exports.builder = function(yargs) { return doRequest(host, 'monitors/' + argv.name + '/stop', null, {method: 'PUT'}) }) }) - .command('maxscale', 'Stop MaxScale by stopping all services', function(yargs) { + .command(['services', 'maxscale'], 'Stop all services', function(yargs) { return yargs.epilog('This command will execute the `stop service` command for ' + 'all services in MaxScale.') - .usage('Usage: stop maxscale') + .usage('Usage: stop [services|maxscale]') }, function(argv) { maxctrl(argv, function(host) { return doRequest(host, 'services/', function(res) { From 0df7228e5eb8a4ce56e43bcbe57b9deebe29a081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Mar 2019 13:57:16 +0200 Subject: [PATCH 03/11] Add 2.2.20 release notes --- Documentation/Changelog.md | 1 + .../MaxScale-2.2.20-Release-Notes.md | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md diff --git a/Documentation/Changelog.md b/Documentation/Changelog.md index 31b1e0824..79912a30a 100644 --- a/Documentation/Changelog.md +++ b/Documentation/Changelog.md @@ -28,6 +28,7 @@ the master. There is also limited capability for rejoining nodes. For more details, please refer to: +* [MariaDB MaxScale 2.2.20 Release Notes](Release-Notes/MaxScale-2.2.20-Release-Notes.md) * [MariaDB MaxScale 2.2.19 Release Notes](Release-Notes/MaxScale-2.2.19-Release-Notes.md) * [MariaDB MaxScale 2.2.18 Release Notes](Release-Notes/MaxScale-2.2.18-Release-Notes.md) * [MariaDB MaxScale 2.2.17 Release Notes](Release-Notes/MaxScale-2.2.17-Release-Notes.md) diff --git a/Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md new file mode 100644 index 000000000..e758d37ad --- /dev/null +++ b/Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md @@ -0,0 +1,40 @@ +# MariaDB MaxScale 2.2.20 Release Notes + +Release 2.2.20 is a GA release. + +This document describes the changes in release 2.2.20, when compared to the +previous release in the same series. + +For any problems you encounter, please consider submitting a bug +report on [our Jira](https://jira.mariadb.org/projects/MXS). + +## Bug fixes + +* [MXS-2375](https://jira.mariadb.org/browse/MXS-2375) maxctrl stop maxscale is confusing +* [MXS-2368](https://jira.mariadb.org/browse/MXS-2368) maxctrl requires password on command line and cannot change user password +* [MXS-2335](https://jira.mariadb.org/browse/MXS-2335) lower_case_table_names doesn't work +* [MXS-2322](https://jira.mariadb.org/browse/MXS-2322) Null characters in passwords break maxctrl +* [MXS-2311](https://jira.mariadb.org/browse/MXS-2311) connection_keepalive and error : (4852) Unexpected internal state: received response 0x00 from server +* [MXS-2296](https://jira.mariadb.org/browse/MXS-2296) maxscale-system-test does not generate core dumps +* [MXS-2268](https://jira.mariadb.org/browse/MXS-2268) readwritesplitter is not routing queries properly in Maxscale 2.3.2 +* [MXS-2206](https://jira.mariadb.org/browse/MXS-2206) Cmake version check fails with version = 3.10.2 + +## Known Issues and Limitations + +There are some limitations and known issues within this version of MaxScale. +For more information, please refer to the [Limitations](../About/Limitations.md) document. + +## Packaging + +RPM and Debian packages are provided for supported the Linux distributions. + +Packages can be downloaded [here](https://mariadb.com/downloads/mariadb-tx/maxscale). + +## 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`. Further, the default branch is always the latest GA version +of MaxScale. + +The source code is available [here](https://github.com/mariadb-corporation/MaxScale). From e83555f12646e24427d8a5c6c5fe6d69b84ec4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Mar 2019 14:09:00 +0200 Subject: [PATCH 04/11] Update release documentation The update to VERSIONxx.cmake was not documented. --- maxscale-system-test/Documentation/RELEASE.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/maxscale-system-test/Documentation/RELEASE.md b/maxscale-system-test/Documentation/RELEASE.md index d25b7d333..a6ca25e3c 100644 --- a/maxscale-system-test/Documentation/RELEASE.md +++ b/maxscale-system-test/Documentation/RELEASE.md @@ -248,3 +248,16 @@ On behalf of the entire MaxScale team, YOUR NAME HERE ``` + +## 10. Update the version number for the next release + +Increment the `MAXSCALE_VERSION_PATCH` value in the `VERSIONxx.cmake` file +in the source root where `xx` is the major and minor release number. For +example, with 2.2 releases, update the `VERSION22.cmake` file. + +If the `MAXSCALE_BUILD_NUMBER` is not 1, set it to 1. This is only +incremented if the packages have to be rebuilt after a release has been +made. + +Make sure the `VERSION.cmake` points to the latest `VERSIONxx.cmake` file +so that updates in older releases won't affect newer releases. From b537176248af5897e383f42485d29f6a8212ebe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Mar 2019 15:44:02 +0200 Subject: [PATCH 05/11] Fix parsing of non-query packets Packets that do not contain SQL should not be parsed. --- server/modules/routing/readwritesplit/rwsplitsession.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/modules/routing/readwritesplit/rwsplitsession.cc b/server/modules/routing/readwritesplit/rwsplitsession.cc index c0627f75c..8cb24701b 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.cc +++ b/server/modules/routing/readwritesplit/rwsplitsession.cc @@ -241,14 +241,17 @@ bool RWSplitSession::route_stored_query() GWBUF* temp_storage = m_query_queue; m_query_queue = NULL; - // The query needs to be explicitly parsed as it was processed multiple times - qc_parse(query_queue, QC_COLLECT_ALL); - // TODO: Move the handling of queued queries to the client protocol // TODO: module where the command tracking is done automatically. uint8_t cmd = mxs_mysql_get_command(query_queue); mysql_protocol_set_current_command(m_client, (mxs_mysql_cmd_t)cmd); + if (cmd == MXS_COM_QUERY || cmd == MXS_COM_STMT_PREPARE) + { + // The query needs to be explicitly parsed as it was processed multiple times + qc_parse(query_queue, QC_COLLECT_ALL); + } + if (!routeQuery(query_queue)) { rval = false; From e5edb5c78f7c1c3ae30bb984b30f33903d7ae703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 13 Mar 2019 19:35:32 +0200 Subject: [PATCH 06/11] Fix reads into bad memory in readwritesplit The candidate selection code used default values that would cause reads past buffers. The code could also dereference the end iterator which causes undefined behavior. --- .../routing/readwritesplit/rwsplit_select_backends.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/readwritesplit/rwsplit_select_backends.cc b/server/modules/routing/readwritesplit/rwsplit_select_backends.cc index dd9591550..80d26e096 100644 --- a/server/modules/routing/readwritesplit/rwsplit_select_backends.cc +++ b/server/modules/routing/readwritesplit/rwsplit_select_backends.cc @@ -222,7 +222,7 @@ SRWBackendVector::iterator find_best_backend(SRWBackendVector& backends, bool masters_accepts_reads) { // Group backends by priority. The set of highest priority backends will then compete. - int best_priority {INT_MAX}; // low numbers are high priority + int best_priority {2}; // low numbers are high priority for (auto& psBackend : backends) { @@ -252,7 +252,12 @@ SRWBackendVector::iterator find_best_backend(SRWBackendVector& backends, } auto best = select(priority_map[best_priority]); - auto rval = std::find(backends.begin(), backends.end(), *best); + auto rval = backends.end(); + + if (best != priority_map[best_priority].end()) + { + rval = std::find(backends.begin(), backends.end(), *best); + } for (auto& a : priority_map) { From 09dc92973e7149174ffe9923f9fe0ce0e5bc28f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 14 Mar 2019 09:25:25 +0200 Subject: [PATCH 07/11] Discard connections as the last step Th discarding of connections in maintenance mode must be done after any results have been written to them. This prevents closing of the connection before the actual result is returned. --- .../routing/readwritesplit/rwsplitsession.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/server/modules/routing/readwritesplit/rwsplitsession.cc b/server/modules/routing/readwritesplit/rwsplitsession.cc index 8cb24701b..f9e171c21 100644 --- a/server/modules/routing/readwritesplit/rwsplitsession.cc +++ b/server/modules/routing/readwritesplit/rwsplitsession.cc @@ -740,15 +740,6 @@ void RWSplitSession::clientReply(GWBUF* writebuf, DCB* backend_dcb) m_can_replay_trx = true; } - if (m_expected_responses == 0) - { - /** - * Close stale connections to servers in maintenance. Done here to avoid closing the connections - * before all responses have been received. - */ - close_stale_connections(); - } - if (backend->in_use() && backend->has_session_commands()) { // Backend is still in use and has more session commands to execute @@ -775,6 +766,15 @@ void RWSplitSession::clientReply(GWBUF* writebuf, DCB* backend_dcb) /** Write reply to client DCB */ MXS_SESSION_ROUTE_REPLY(backend_dcb->session, writebuf); } + + if (m_expected_responses == 0) + { + /** + * Close stale connections to servers in maintenance. Done here to avoid closing the connections + * before all responses have been received. + */ + close_stale_connections(); + } } void check_and_log_backend_state(const SRWBackend& backend, DCB* problem_dcb) From f9853431eeb532c912a15432781e4f9f11f40543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 14 Mar 2019 12:22:25 +0200 Subject: [PATCH 08/11] Simplify maxrows test config The configuration now uses only one server to prevent replication lag from affecting the results. --- .../cnf/maxscale.cnf.template.maxrows | 44 +++++-------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.maxrows b/maxscale-system-test/cnf/maxscale.cnf.template.maxrows index 261315c2c..5935fe79b 100755 --- a/maxscale-system-test/cnf/maxscale.cnf.template.maxrows +++ b/maxscale-system-test/cnf/maxscale.cnf.template.maxrows @@ -1,12 +1,17 @@ [maxscale] threads=###threads### -log_warning=1 + +[server1] +type=server +address=###node_server_IP_1### +port=###node_server_port_1### +protocol=MySQLBackend [MySQL Monitor] type=monitor module=mysqlmon ###repl51### -servers= server1, server2,server3 ,server4 +servers=server1 user=maxskysql passwd= skysql monitor_interval=1000 @@ -14,8 +19,8 @@ detect_stale_master=false [RW Split Router] type=service -router= readwritesplit -servers=server1, server2, server3,server4 +router=readwritesplit +servers=server1 user=maxskysql passwd=skysql router_options=slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS @@ -26,7 +31,7 @@ filters=MaxRows type=service router=readconnroute router_options= slave -servers=server1,server2,server3,server4 +servers=server1 user=maxskysql passwd=skysql @@ -34,7 +39,7 @@ passwd=skysql type=service router=readconnroute router_options=master -servers=server1,server2,server3,server4 +servers=server1 user=maxskysql passwd=skysql @@ -43,7 +48,6 @@ type=listener service=RW Split Router protocol=MySQLClient port=4006 -#socket=/tmp/rwsplit.sock [Read Connection Listener Slave] type=listener @@ -65,7 +69,6 @@ router=cli type=listener service=CLI protocol=maxscaled -#address=localhost socket=default [MaxRows] @@ -74,28 +77,3 @@ module=maxrows max_resultset_rows=20 max_resultset_size=900000000 debug=3 - -[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 - From 29b8d12be3597a6bc41b56c8bbb7b03649ba87d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 14 Mar 2019 20:08:13 +0200 Subject: [PATCH 09/11] Always ignore EPIPE errors There's no reason to not ignore EPIPE errors in debug builds. --- server/core/dcb.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/server/core/dcb.cc b/server/core/dcb.cc index 52d9b248b..d618619d0 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -1873,14 +1873,7 @@ static int gw_write(DCB* dcb, GWBUF* writeq, bool* stop_writing) if (written < 0) { *stop_writing = true; -#if defined (SS_DEBUG) - if (saved_errno != EAGAIN - && saved_errno != EWOULDBLOCK) -#else - if (saved_errno != EAGAIN - && saved_errno != EWOULDBLOCK - && saved_errno != EPIPE) -#endif + if (saved_errno != EAGAIN && saved_errno != EWOULDBLOCK && saved_errno != EPIPE) { MXS_ERROR("Write to %s %s in state %s failed: %d, %s", DCB_STRTYPE(dcb), From 4400876b46d19224f195fa80190243a883c1e64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 15 Mar 2019 11:40:42 +0200 Subject: [PATCH 10/11] Update release date --- Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md index e758d37ad..9c0340924 100644 --- a/Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.2.20-Release-Notes.md @@ -1,4 +1,4 @@ -# MariaDB MaxScale 2.2.20 Release Notes +# MariaDB MaxScale 2.2.20 Release Notes -- 2019-03-15 Release 2.2.20 is a GA release. From 4697128b3c54da307cddede4a21519968470d11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 15 Mar 2019 11:42:41 +0200 Subject: [PATCH 11/11] Update 2.2 maintenance version --- VERSION22.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION22.cmake b/VERSION22.cmake index b218f991e..13684f7f5 100644 --- a/VERSION22.cmake +++ b/VERSION22.cmake @@ -5,7 +5,7 @@ set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version") set(MAXSCALE_VERSION_MINOR "2" CACHE STRING "Minor version") -set(MAXSCALE_VERSION_PATCH "20" CACHE STRING "Patch version") +set(MAXSCALE_VERSION_PATCH "21" CACHE STRING "Patch version") # This should only be incremented if a package is rebuilt set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number")