From 3d02343a40cec0b1e91644024301f4b6bbd464e7 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 1 Feb 2017 15:07:53 +0200 Subject: [PATCH 01/18] Update date in release notes --- Documentation/Release-Notes/MaxScale-2.0.4-Release-Notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/Release-Notes/MaxScale-2.0.4-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.0.4-Release-Notes.md index 684836f64..784db5670 100644 --- a/Documentation/Release-Notes/MaxScale-2.0.4-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.0.4-Release-Notes.md @@ -1,4 +1,4 @@ -# MariaDB MaxScale 2.0.4 Release Notes +# MariaDB MaxScale 2.0.4 Release Notes -- 2017-02-01 Release 2.0.4 is a GA release. From eb5e284a90931db590a8406bc45d44ee969c6c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 1 Feb 2017 17:47:28 +0200 Subject: [PATCH 02/18] Rephrase the schemarouter limitations The text was not very clear as to whether the prepared statements were actually supported. --- Documentation/About/Limitations.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Documentation/About/Limitations.md b/Documentation/About/Limitations.md index 3931b391f..860b3d81d 100644 --- a/Documentation/About/Limitations.md +++ b/Documentation/About/Limitations.md @@ -231,9 +231,8 @@ and routed. Here is a list of the current limitations. * The preparation of a prepared statement is routed to all servers. The execution of a prepared statement is routed to the first available server or - to the server pointed by a routing hint attached to the query. As text - protocol prepared statements are relatively rare, prepared statements can't be - considered as supported in schemarouter + to the server pointed by a routing hint attached to the query. In practice + this means that prepared statements aren't supported by the schemarouter. ## Avrorouter limitations (avrorouter) From 6ee257dc5f184b855e3e557a54e818fa174e9aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 3 Feb 2017 08:14:20 +0200 Subject: [PATCH 03/18] Only log an error if the binlog file exists The avrorouter logged an error every time it tried to open a file even if the file doesn't exist. --- server/modules/routing/avro/avro_file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/avro/avro_file.c b/server/modules/routing/avro/avro_file.c index a16f05665..c1d65b1b0 100644 --- a/server/modules/routing/avro/avro_file.c +++ b/server/modules/routing/avro/avro_file.c @@ -67,7 +67,12 @@ bool avro_open_binlog(const char *binlogdir, const char *file, int *dest) if ((fd = open(path, O_RDONLY)) == -1) { - MXS_ERROR("Failed to open binlog file %s.", path); + if (errno != ENOENT) + { + char err[STRERROR_BUFLEN]; + MXS_ERROR("Failed to open binlog file %s: %d, %s", path, errno, + strerror_r(errno, err, sizeof(err))); + } return false; } From 9f88ee3eec844b39be2ec9d965758af512a127a0 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Fri, 3 Feb 2017 14:50:25 +0200 Subject: [PATCH 04/18] Errors must not be cached For instance, if bob is returned an error because he does not have the required grants, then if the error were cached, alice would receive bob's error reply even if she has the required grants. --- server/modules/filter/cache/cachefiltersession.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/modules/filter/cache/cachefiltersession.cc b/server/modules/filter/cache/cachefiltersession.cc index 650131dbf..69f99d77e 100644 --- a/server/modules/filter/cache/cachefiltersession.cc +++ b/server/modules/filter/cache/cachefiltersession.cc @@ -404,9 +404,8 @@ int CacheFilterSession::handle_expecting_response() switch ((int)MYSQL_GET_COMMAND(header)) { case MYSQL_REPLY_OK: - case MYSQL_REPLY_ERR: store_result(); - + case MYSQL_REPLY_ERR: rv = send_upstream(); m_state = CACHE_IGNORING_RESPONSE; break; From 869e6ac9501c4ee887195ab4adda755a10f41223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 3 Feb 2017 18:02:36 +0200 Subject: [PATCH 05/18] Remove useless maxadmin commands The commands did nothing. --- server/core/dcb.c | 10 ---------- server/core/poll.c | 11 ----------- server/core/session.c | 10 ---------- server/modules/routing/debugcli/debugcmd.c | 18 ------------------ 4 files changed, 49 deletions(-) diff --git a/server/core/dcb.c b/server/core/dcb.c index 91705a8f4..5a6de4a8e 100644 --- a/server/core/dcb.c +++ b/server/core/dcb.c @@ -1915,16 +1915,6 @@ dprintOneDCB(DCB *pdcb, DCB *dcb) } } -/* - * @brief Print DCB list statistics - * - * @param pdcb DCB to print results to - */ -void -dprintDCBList(DCB *pdcb) -{ -} - /** * Diagnostic to print all DCB allocated in the system * diff --git a/server/core/poll.c b/server/core/poll.c index 2ffe8f96f..1088b2993 100644 --- a/server/core/poll.c +++ b/server/core/poll.c @@ -1522,17 +1522,6 @@ void poll_fake_hangup_event(DCB *dcb) poll_add_event_to_dcb(dcb, NULL, ev); } -/** - * Print the event queue contents - * - * @param pdcb The DCB to print the event queue to - */ -void -dShowEventQ(DCB *pdcb) -{ -} - - /** * Print the event queue statistics * diff --git a/server/core/session.c b/server/core/session.c index 230e643bb..4db17b9bd 100644 --- a/server/core/session.c +++ b/server/core/session.c @@ -460,16 +460,6 @@ printAllSessions() dcb_foreach(printAllSessions_cb, NULL); } -/* - * @brief Print session list statistics - * - * @param pdcb DCB to print results to - */ -void -dprintSessionList(DCB *pdcb) -{ -} - /** Callback for dprintAllSessions */ bool dprintAllSessions_cb(DCB *dcb, void *data) { diff --git a/server/modules/routing/debugcli/debugcmd.c b/server/modules/routing/debugcli/debugcmd.c index 3bae1fb39..ae564af5f 100644 --- a/server/modules/routing/debugcli/debugcmd.c +++ b/server/modules/routing/debugcli/debugcmd.c @@ -134,12 +134,6 @@ struct subcommand showoptions[] = {0, 0, 0} }, #endif - { - "dcblist", 0, 0, dprintDCBList, - "Show DCB statistics", - "Show statistics for the list of all DCBs(descriptor control blocks)", - {0} - }, { "dcbs", 0, 0, dprintAllDCBs, "Show all DCBs", @@ -159,12 +153,6 @@ struct subcommand showoptions[] = "Show the epoll polling system statistics", {0, 0, 0} }, - { - "eventq", 0, 0, dShowEventQ, - "Show event queue", - "Show the queue of events waiting to be processed", - {0, 0, 0} - }, { "eventstats", 0, 0, dShowEventStats, "Show event queue statistics", @@ -255,12 +243,6 @@ struct subcommand showoptions[] = "Show a single session in MaxScale, e.g. show session 5", {ARG_TYPE_SESSION, 0, 0} }, - { - "sessionlist", 0, 0, dprintSessionList, - "Show session list statistics", - "Show statistics for the list of all sessions", - {0, 0, 0} - }, { "sessions", 0, 0, dprintAllSessions, "Show all sessions", From 7c5e326dd5d06776585fc48790c58470e11d341c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 3 Feb 2017 18:10:19 +0200 Subject: [PATCH 06/18] Remove listing of persisted DCBs As the DCBs are "owned" by threads and are handled without locks, no cross-thread access to those DCBs should be done. Due to this, the show persistent command for maxadmin has to be changed to show only the size of the pool. --- server/core/server.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/server/core/server.c b/server/core/server.c index 1341113e4..d49e6acbd 100644 --- a/server/core/server.c +++ b/server/core/server.c @@ -597,7 +597,7 @@ spin_reporter(void *dcb, char *desc, int value) } /** - * Diagnostic to print all DCBs in persistent pool for a server + * Diagnostic to print number of DCBs in persistent pool for a server * * @param pdcb DCB to print results to * @param server SERVER for which DCBs are to be printed @@ -605,22 +605,7 @@ spin_reporter(void *dcb, char *desc, int value) void dprintPersistentDCBs(DCB *pdcb, const SERVER *server) { - DCB *dcb; - int nthr = config_threadcount(); - - for (int i = 0; i < nthr; i++) - { -#if SPINLOCK_PROFILE - dcb_printf(pdcb, "DCB List Spinlock Statistics:\n"); - spinlock_stats(&server->persistlock, spin_reporter, pdcb); -#endif - dcb = server->persistent[i]; - while (dcb) - { - dprintOneDCB(pdcb, dcb); - dcb = dcb->nextpersistent; - } - } + dcb_printf(pdcb, "Number of persistent DCBs: %d\n", server->stats.n_persistent); } /** From c0f5124f6f1a16d93ec63a127d8222116a294496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 6 Feb 2017 16:35:40 +0200 Subject: [PATCH 07/18] Fix field name parsing in avrorouter The backtick was copied to the field name and converted to an underscore when the name was transformed into a valid Avro identifier. This caused one extra character to appear in the field name in the Avro schema files. --- server/modules/routing/avro/avro_schema.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/modules/routing/avro/avro_schema.c b/server/modules/routing/avro/avro_schema.c index dd5c1e9fc..9595e83b7 100644 --- a/server/modules/routing/avro/avro_schema.c +++ b/server/modules/routing/avro/avro_schema.c @@ -481,7 +481,15 @@ static const char *extract_field_name(const char* ptr, char* dest, size_t size) if (ptr > start) { /** Valid identifier */ - snprintf(dest, size, "%.*s", (int)(ptr - start), start); + size_t bytes = ptr - start; + + if (bt) + { + bytes--; + } + + memcpy(dest, start, bytes); + dest[bytes] = '\0'; make_valid_avro_identifier(dest); ptr = next_field_definition(ptr); From e3bed424ea881d4254602561de32b6e431723bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 6 Feb 2017 23:03:57 +0200 Subject: [PATCH 08/18] MXS-1123: Fix connection_timeout causing constant disconnections In a configuration with multiple services, one with connection_timeout and others without it, the connections to non-connection_timeout services would get immediately closed due to integer overflow. --- server/core/session.c | 4 +++- server/include/service.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/core/session.c b/server/core/session.c index be290256d..e6b98c975 100644 --- a/server/core/session.c +++ b/server/core/session.c @@ -1025,7 +1025,9 @@ void process_idle_sessions() while (all_session) { if (all_session->ses_is_in_use && - all_session->service && all_session->client_dcb && all_session->client_dcb->state == DCB_STATE_POLLING && + all_session->service && all_session->client_dcb && + all_session->client_dcb->state == DCB_STATE_POLLING && + all_session->service->conn_idle_timeout && hkheartbeat - all_session->client_dcb->last_read > all_session->service->conn_idle_timeout * 10) { dcb_close(all_session->client_dcb); diff --git a/server/include/service.h b/server/include/service.h index 144de3a29..c7e9c22d1 100644 --- a/server/include/service.h +++ b/server/include/service.h @@ -100,7 +100,7 @@ typedef struct server_ref_t #define SERVICE_MAX_RETRY_INTERVAL 3600 /*< The maximum interval between service start retries */ /** Value of service timeout if timeout checks are disabled */ -#define SERVICE_NO_SESSION_TIMEOUT LONG_MAX +#define SERVICE_NO_SESSION_TIMEOUT 0 /** * Parameters that are automatically detected but can also be configured by the @@ -149,7 +149,7 @@ typedef struct service SERVICE_REFRESH_RATE rate_limit; /**< The refresh rate limit for users table */ FILTER_DEF **filters; /**< Ordered list of filters */ int n_filters; /**< Number of filters */ - long conn_idle_timeout; /**< Session timeout in seconds */ + uint64_t conn_idle_timeout; /**< Session timeout in seconds */ char *weightby; struct service *next; /**< The next service in the linked list */ bool retry_start; /*< If starting of the service should be retried later */ From 2bceb1128d99eb549831b682c8b97601e54244db Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 7 Feb 2017 08:50:37 +0200 Subject: [PATCH 09/18] Update ChangeLog and Release Notes --- Documentation/Changelog.md | 14 +++++++ .../MaxScale-2.1.0-Release-Notes.md | 41 ++++++++++++++----- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Documentation/Changelog.md b/Documentation/Changelog.md index a1452dc96..497a03104 100644 --- a/Documentation/Changelog.md +++ b/Documentation/Changelog.md @@ -1,5 +1,19 @@ #Changelog +## MariaDB MaxScale 2.1 +* Hierarchical configuration files are now supported. +* Logging is now performed in a way compatible with logrotate(8) +* Persistent connections are reset upon resuse. +* Galera monitor now consistently chooses the same node as master +* The configuration can now be altered dynamically and the changes are persisted. +* There is now a monitor for Amazon Aurora clusters +* MySQL Monitor now has a multi-master mode. +* MySQL Monitor now has a failover mode. +* New filters, _cache, _ccrfilter_, _masking_, and _maxrows_ are introduced. + +For more details, please refer to: +* [MariaDB MaxScale 2.1.0 Release Notes](Release-Notes/MaxScale-2.1.0-Release-Notes.md) + ## MariaDB MaxScale 2.0 * MariaDB MaxScale is licensed under MariaDB BSL. * SSL can be used in the communication between MariaDB MaxScale and the backend servers. diff --git a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md index 9f7683a2f..9d0abaf3a 100644 --- a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md @@ -3,7 +3,7 @@ Release 2.1.0 is a Beta release. This document describes the changes in release 2.1.0, when compared to -release 2.0.X. +release 2.0.4. For any problems you encounter, please consider submitting a bug report at [Jira](https://jira.mariadb.org). @@ -71,8 +71,8 @@ MaxScale to rotate the the log file. This behaviour is now compatible with logrotate(8). Further, if MaxScale is configured to use shared memory for the log file, -the file is created into the directory "/dev/shm/maxscale". Earlier the -log file was created into the directory "/dev/shm/maxscale.PID", where PID +the file is created into the directory `/dev/shm/maxscale`. Earlier the +log file was created into the directory `/dev/shm/maxscale.PID`, where PID was the pid of the MaxScale process. In addition, there is now a mechanism that prevents the flooding of the log, in @@ -132,13 +132,6 @@ For more details, read the [Galeramon documentation](../Monitors/Galera-Monitor. MaxAdmin now defaults to Emacs editing mode instead of VIM. To activate with VIM-mode start MaxAdmin with option -i. -### Support for text wildcards in hostnames - -Wildcards in text-form hostnames in the mysql.user-table of the backend -database are now supported. For matching, the client IP-address must be -converted to text-form, which requires a reverse DNS lookup. Please see -[Limitations](../About/Limitations.md) for more information. - ## New Features ### Dynamic configuration @@ -283,8 +276,34 @@ documentation. ## Bug fixes -[Here is a list of bugs fixed since the release of MaxScale 2.0.X.](https://jira.mariadb.org/browse/MXS-739?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20in%20(Fixed%2C%20Done)%20AND%20fixVersion%20%3D%202.0.0) +[Here is a list of bugs fixed since the release of MaxScale 2.0.4.](https://jira.mariadb.org/browse/MXS-951?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20in%20(Fixed%2C%20Done)%20AND%20fixVersion%20%3D%202.1.0%20AND%20fixVersion%20!%3D%202.0.1%20AND%20fixVersion%20!%3D%202.0.2%20AND%20fixVersion%20!%3D%202.0.3%20AND%20fixVersion%20!%3D%202.0.4) +* [MXS-1025](https://jira.mariadb.org/browse/MXS-1025) qc_sqlite always reports " Statement was parsed, but not classified" +* [MXS-977](https://jira.mariadb.org/browse/MXS-977) MaxAdmin show monitor output missing formatting +* [MXS-951](https://jira.mariadb.org/browse/MXS-951) Using utf8mb4 on galera hosts stops maxscale connections +* [MXS-889](https://jira.mariadb.org/browse/MXS-889) "Ungrade Test" Jenkins job fails with CeentOS/RHEL 5 and SLES11 +* [MXS-887](https://jira.mariadb.org/browse/MXS-887) create_env Jenkin job fails +* [MXS-873](https://jira.mariadb.org/browse/MXS-873) Changing server status via maxadmin is not atomic +* [MXS-832](https://jira.mariadb.org/browse/MXS-832) Problem with Regex filter as readconnroute doesn't wait for complete packets +* [MXS-831](https://jira.mariadb.org/browse/MXS-831) new_master event not triggered by galeramon +* [MXS-828](https://jira.mariadb.org/browse/MXS-828) Remove "Syslog logging is disabled." to stdout when starting without syslog +* [MXS-825](https://jira.mariadb.org/browse/MXS-825) --execdir option does not work +* [MXS-805](https://jira.mariadb.org/browse/MXS-805) Server weights don't work with LEAST_BEHIND_MASTER +* [MXS-804](https://jira.mariadb.org/browse/MXS-804) Grants for user@IP/Netmask doesn't work +* [MXS-799](https://jira.mariadb.org/browse/MXS-799) fatal signal 11 when socket could not be opened +* [MXS-769](https://jira.mariadb.org/browse/MXS-769) Malloc return value must be checked. +* [MXS-711](https://jira.mariadb.org/browse/MXS-711) All service ports use the same user data +* [MXS-650](https://jira.mariadb.org/browse/MXS-650) Connection attempt w/o SSL to SSL service gives confusing error +* [MXS-626](https://jira.mariadb.org/browse/MXS-626) Don't log anything to maxlog until it is known whether that is wanted. +* [MXS-590](https://jira.mariadb.org/browse/MXS-590) MaxScale doesn't log an error when .secrets file is not owned by current user +* [MXS-586](https://jira.mariadb.org/browse/MXS-586) Tee filter hangs when using range +* [MXS-576](https://jira.mariadb.org/browse/MXS-576) Maxscale does not generate warning/error if incorrect values is set for persistpoolmax +* [MXS-397](https://jira.mariadb.org/browse/MXS-397) Unsafe handling of dcb_readqueue +* [MXS-390](https://jira.mariadb.org/browse/MXS-390) Lack of checks of dynamic memory allocation +* [MXS-350](https://jira.mariadb.org/browse/MXS-350) Return value of realloc must not be assigned to provided pointer. +* [MXS-348](https://jira.mariadb.org/browse/MXS-348) Incorrect use of strncat +* [MXS-253](https://jira.mariadb.org/browse/MXS-253) Use of strncpy is dangerous +* [MXS-126](https://jira.mariadb.org/browse/MXS-126) debug assert in TEE filter test ## Known Issues and Limitations From 906a42d9a8c007034fd000cd50915525fb845bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 6 Feb 2017 10:28:14 +0200 Subject: [PATCH 10/18] Use dcb_foreach inside dcb.c All DCB listing code should use dcb_foreach to list them. --- server/core/dcb.c | 81 +++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/server/core/dcb.c b/server/core/dcb.c index 5a6de4a8e..871538d06 100644 --- a/server/core/dcb.c +++ b/server/core/dcb.c @@ -1915,28 +1915,31 @@ dprintOneDCB(DCB *pdcb, DCB *dcb) } } +static bool dprint_all_dcbs_cb(DCB *dcb, void *data) +{ + DCB *pdcb = (DCB*)data; + dprintOneDCB(pdcb, dcb); + return true; +} + /** * Diagnostic to print all DCB allocated in the system * * @param pdcb DCB to print results to */ -void -dprintAllDCBs(DCB *pdcb) +void dprintAllDCBs(DCB *pdcb) { + dcb_foreach(dprint_all_dcbs_cb, pdcb); +} - int nthr = config_threadcount(); - - for (int i = 0; i < nthr; i++) - { - spinlock_acquire(&all_dcbs_lock[i]); - - for (DCB *dcb = all_dcbs[i]; dcb; dcb = dcb->thread.next) - { - dprintOneDCB(pdcb, dcb); - } - - spinlock_release(&all_dcbs_lock[i]); - } +static bool dlist_dcbs_cb(DCB *dcb, void *data) +{ + DCB *pdcb = (DCB*)data; + dcb_printf(pdcb, " %-16p | %-26s | %-18s | %s\n", + dcb, gw_dcb_state2string(dcb->state), + ((dcb->session && dcb->session->service) ? dcb->session->service->name : ""), + (dcb->remote ? dcb->remote : "")); + return true; } /** @@ -1952,24 +1955,24 @@ dListDCBs(DCB *pdcb) dcb_printf(pdcb, " %-16s | %-26s | %-18s | %s\n", "DCB", "State", "Service", "Remote"); dcb_printf(pdcb, "------------------+----------------------------+--------------------+----------\n"); + dcb_foreach(dlist_dcbs_cb, pdcb); + dcb_printf(pdcb, "------------------+----------------------------+--------------------+----------\n\n"); +} - int nthr = config_threadcount(); +static bool dlist_clients_cb(DCB *dcb, void *data) +{ + DCB *pdcb = (DCB*)data; - for (int i = 0; i < nthr; i++) + if (dcb->dcb_role == DCB_ROLE_CLIENT_HANDLER) { - spinlock_acquire(&all_dcbs_lock[i]); - for (DCB *dcb = all_dcbs[i]; dcb; dcb = dcb->thread.next) - { - dcb_printf(pdcb, " %-16p | %-26s | %-18s | %s\n", - dcb, gw_dcb_state2string(dcb->state), - ((dcb->session && dcb->session->service) ? dcb->session->service->name : ""), - (dcb->remote ? dcb->remote : "")); - } - - spinlock_release(&all_dcbs_lock[i]); + dcb_printf(pdcb, " %-15s | %16p | %-20s | %10p\n", + (dcb->remote ? dcb->remote : ""), + dcb, (dcb->session->service ? + dcb->session->service->name : ""), + dcb->session); } - dcb_printf(pdcb, "------------------+----------------------------+--------------------+----------\n\n"); + return true; } /** @@ -1985,27 +1988,7 @@ dListClients(DCB *pdcb) dcb_printf(pdcb, " %-15s | %-16s | %-20s | %s\n", "Client", "DCB", "Service", "Session"); dcb_printf(pdcb, "-----------------+------------------+----------------------+------------\n"); - - int nthr = config_threadcount(); - - for (int i = 0; i < nthr; i++) - { - spinlock_acquire(&all_dcbs_lock[i]); - for (DCB *dcb = all_dcbs[i]; dcb; dcb = dcb->thread.next) - { - if (dcb->dcb_role == DCB_ROLE_CLIENT_HANDLER) - { - dcb_printf(pdcb, " %-15s | %16p | %-20s | %10p\n", - (dcb->remote ? dcb->remote : ""), - dcb, (dcb->session->service ? - dcb->session->service->name : ""), - dcb->session); - } - } - - spinlock_release(&all_dcbs_lock[i]); - } - + dcb_foreach(dlist_clients_cb, pdcb); dcb_printf(pdcb, "-----------------+------------------+----------------------+------------\n\n"); } From d61f0d0afd0aad581594922f090f50fa08b22d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 6 Feb 2017 14:50:56 +0200 Subject: [PATCH 11/18] Remove useless debug assertion The debug assertion assumes that the table definition is always in the binlogs. If a binlog row event without a table definition is read, debug versions would crash even though the situation is acceptable and expected. --- server/modules/routing/avrorouter/avro_rbr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/server/modules/routing/avrorouter/avro_rbr.c b/server/modules/routing/avrorouter/avro_rbr.c index e0aa5337c..f3d91d0dc 100644 --- a/server/modules/routing/avrorouter/avro_rbr.c +++ b/server/modules/routing/avrorouter/avro_rbr.c @@ -272,7 +272,6 @@ bool handle_row_event(AVRO_INSTANCE *router, REP_HEADER *hdr, uint8_t *ptr) /** There should always be a table map event prior to a row event. * TODO: Make the active_maps dynamic */ TABLE_MAP *map = router->active_maps[table_id % sizeof(router->active_maps)]; - ss_dassert(map); if (map) { From 71497751632a0a6bea6aa8149c348094a2fccead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 6 Feb 2017 16:17:34 +0200 Subject: [PATCH 12/18] Use correct enum values in avrorouter The file flushing enums weren't used. --- server/modules/routing/avrorouter/avro.c | 2 +- server/modules/routing/avrorouter/avro_file.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/avrorouter/avro.c b/server/modules/routing/avrorouter/avro.c index 55a8ac6ee..0104c8b58 100644 --- a/server/modules/routing/avrorouter/avro.c +++ b/server/modules/routing/avrorouter/avro.c @@ -1074,7 +1074,7 @@ void converter_func(void* data) /** We reached end of file, flush unwritten records to disk */ if (router->task_delay == 1) { - avro_flush_all_tables(router, true); + avro_flush_all_tables(router, AVROROUTER_FLUSH); avro_save_conversion_state(router); } diff --git a/server/modules/routing/avrorouter/avro_file.c b/server/modules/routing/avrorouter/avro_file.c index 570a81031..602f2c2cb 100644 --- a/server/modules/routing/avrorouter/avro_file.c +++ b/server/modules/routing/avrorouter/avro_file.c @@ -745,7 +745,7 @@ avro_binlog_end_t avro_read_all_events(AVRO_INSTANCE *router) router->trx_count >= router->trx_target) { update_used_tables(router); - avro_flush_all_tables(router, false); + avro_flush_all_tables(router, AVROROUTER_SYNC); avro_save_conversion_state(router); notify_all_clients(router); total_rows += router->row_count; From 147ffcce0261b1bc9125b3dec6204239bc4fbbee Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Tue, 7 Feb 2017 12:38:14 +0100 Subject: [PATCH 13/18] MaxScale-2.1.0-Release-Notes update MaxScale-2.1.0-Release-Notes update --- .../MaxScale-2.1.0-Release-Notes.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md index 9d0abaf3a..ce2851ead 100644 --- a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md @@ -132,6 +132,12 @@ For more details, read the [Galeramon documentation](../Monitors/Galera-Monitor. MaxAdmin now defaults to Emacs editing mode instead of VIM. To activate with VIM-mode start MaxAdmin with option -i. +### Named Server Filter +The source option can now handle wildcards such as: +192.168.%.% + +For more details, read the [Named Server Filter documentation](../Filters/Named-Server-Filter.md). + ## New Features ### Dynamic configuration @@ -274,6 +280,16 @@ to large sets of data with a single query. For more information, refer to the [Maxrows](../Filters/Maxrows.md) documentation. +### Galeramon Monitor new option +The `set_donor_nodes` option allows the setting of _global variable_ _wsrep_sst_donor_ with a list the preferred donor nodes (among slave ones). + +For more details, read the [Galeramon documentation](../Monitors/Galera-Monitor.md). + +### Binlog Server encrypted binlogs +The binlog server can optionally encrypt the events received from the master server: the setup requires MariaDB 10.1 master (with Encryption active) and the `mariadb10-compatibility=1` option set. + +For more details, read the [Binlogrouter documentation](../Routers/Binlogrouter.md). + ## Bug fixes [Here is a list of bugs fixed since the release of MaxScale 2.0.4.](https://jira.mariadb.org/browse/MXS-951?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20in%20(Fixed%2C%20Done)%20AND%20fixVersion%20%3D%202.1.0%20AND%20fixVersion%20!%3D%202.0.1%20AND%20fixVersion%20!%3D%202.0.2%20AND%20fixVersion%20!%3D%202.0.3%20AND%20fixVersion%20!%3D%202.0.4) From b0cf8c6e38e93690045e2730b2f4d4c2fb86481c Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 7 Feb 2017 11:17:22 +0200 Subject: [PATCH 14/18] Update ChangeLog --- Documentation/Changelog.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/Changelog.md b/Documentation/Changelog.md index 497a03104..3ea72cc1a 100644 --- a/Documentation/Changelog.md +++ b/Documentation/Changelog.md @@ -2,13 +2,16 @@ ## MariaDB MaxScale 2.1 * Hierarchical configuration files are now supported. -* Logging is now performed in a way compatible with logrotate(8) +* Logging is now performed in a way compatible with logrotate(8). * Persistent connections are reset upon resuse. -* Galera monitor now consistently chooses the same node as master +* Galera monitor now consistently chooses the same node as master. +* Galera Monitor can set the preferred donor nodes list. * The configuration can now be altered dynamically and the changes are persisted. -* There is now a monitor for Amazon Aurora clusters +* There is now a monitor for Amazon Aurora clusters. * MySQL Monitor now has a multi-master mode. * MySQL Monitor now has a failover mode. +* Named Server Filter now supports wildcards for source option. +* Binlog Server can now be configured to encrypt binlog files. * New filters, _cache, _ccrfilter_, _masking_, and _maxrows_ are introduced. For more details, please refer to: From 877551e4c136d4ace5cf82c34dd97d29e2c8742d Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Tue, 7 Feb 2017 12:38:14 +0100 Subject: [PATCH 15/18] MaxScale-2.1.0-Release-Notes update MaxScale-2.1.0-Release-Notes update --- .../MaxScale-2.1.0-Release-Notes.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md index 9d0abaf3a..ce2851ead 100644 --- a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md @@ -132,6 +132,12 @@ For more details, read the [Galeramon documentation](../Monitors/Galera-Monitor. MaxAdmin now defaults to Emacs editing mode instead of VIM. To activate with VIM-mode start MaxAdmin with option -i. +### Named Server Filter +The source option can now handle wildcards such as: +192.168.%.% + +For more details, read the [Named Server Filter documentation](../Filters/Named-Server-Filter.md). + ## New Features ### Dynamic configuration @@ -274,6 +280,16 @@ to large sets of data with a single query. For more information, refer to the [Maxrows](../Filters/Maxrows.md) documentation. +### Galeramon Monitor new option +The `set_donor_nodes` option allows the setting of _global variable_ _wsrep_sst_donor_ with a list the preferred donor nodes (among slave ones). + +For more details, read the [Galeramon documentation](../Monitors/Galera-Monitor.md). + +### Binlog Server encrypted binlogs +The binlog server can optionally encrypt the events received from the master server: the setup requires MariaDB 10.1 master (with Encryption active) and the `mariadb10-compatibility=1` option set. + +For more details, read the [Binlogrouter documentation](../Routers/Binlogrouter.md). + ## Bug fixes [Here is a list of bugs fixed since the release of MaxScale 2.0.4.](https://jira.mariadb.org/browse/MXS-951?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20in%20(Fixed%2C%20Done)%20AND%20fixVersion%20%3D%202.1.0%20AND%20fixVersion%20!%3D%202.0.1%20AND%20fixVersion%20!%3D%202.0.2%20AND%20fixVersion%20!%3D%202.0.3%20AND%20fixVersion%20!%3D%202.0.4) From 7035af30c351cbca6a48e9a1c35b321895499ade Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 7 Feb 2017 11:17:22 +0200 Subject: [PATCH 16/18] Update ChangeLog --- Documentation/Changelog.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/Changelog.md b/Documentation/Changelog.md index 497a03104..3ea72cc1a 100644 --- a/Documentation/Changelog.md +++ b/Documentation/Changelog.md @@ -2,13 +2,16 @@ ## MariaDB MaxScale 2.1 * Hierarchical configuration files are now supported. -* Logging is now performed in a way compatible with logrotate(8) +* Logging is now performed in a way compatible with logrotate(8). * Persistent connections are reset upon resuse. -* Galera monitor now consistently chooses the same node as master +* Galera monitor now consistently chooses the same node as master. +* Galera Monitor can set the preferred donor nodes list. * The configuration can now be altered dynamically and the changes are persisted. -* There is now a monitor for Amazon Aurora clusters +* There is now a monitor for Amazon Aurora clusters. * MySQL Monitor now has a multi-master mode. * MySQL Monitor now has a failover mode. +* Named Server Filter now supports wildcards for source option. +* Binlog Server can now be configured to encrypt binlog files. * New filters, _cache, _ccrfilter_, _masking_, and _maxrows_ are introduced. For more details, please refer to: From 4f7b2b545eca3fc6fe5ae67857d4225040781f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 8 Feb 2017 08:34:34 +0200 Subject: [PATCH 17/18] Remove documentation for `monitor` parameter The use of monitors in services isn't complete but this was not in the documentation. A more complete solution should be done at a later date and the current documentation should be removed. --- .../Getting-Started/Configuration-Guide.md | 36 ------------------- .../MaxScale-2.1.0-Release-Notes.md | 9 ----- 2 files changed, 45 deletions(-) diff --git a/Documentation/Getting-Started/Configuration-Guide.md b/Documentation/Getting-Started/Configuration-Guide.md index b965f4a1f..6970f9968 100644 --- a/Documentation/Getting-Started/Configuration-Guide.md +++ b/Documentation/Getting-Started/Configuration-Guide.md @@ -589,42 +589,6 @@ filters=counter | QLA The requests pass through the filters from left to right in the order defined in the configuration parameter. -#### `monitor` - -The monitor parameter tells the service which cluster of servers to use. The -value of the option is the name of a monitor object. This removes the redundant -definition of servers in both services and monitors. - -If both the `monitor` and `servers` parameters are defined, only the `monitor` -parameter will be used. - -Only one cluster can be defined for a service. Multi-cluster setups should use -the `servers` parameter to list the servers that the service should use. - -Here is an excerpt from an example configuration with a service that defines the -cluster parameter. - -``` -[db-cluster-1-monitor] -type=monitor -module=mysqlmon -servers=server1,server2,server3 -user=maxuser -passwd=maxpwd -monitor_interval=1000 - -[my-readwrite-service] -type=service -router=readwritesplit -monitor=db-cluster-1-monitor -user=maxuser -passwd=maxpwd -``` - -The _db-cluster-1-monitor_ cluster consists of three servers monitored by a -_mysqlmon_ monitor module. The _my-readwrite-service_ uses this monitor as the -source for servers. - #### `servers` The servers parameter in a service definition provides a comma separated list of diff --git a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md index ce2851ead..d45dee83d 100644 --- a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md @@ -188,15 +188,6 @@ allowing runtime tuning of parameters. - `destroy monitor`: Destroy a created monitor - `alter monitor`: Alter monitor parameters -### Monitors as server sources for services - -Services now accept a `monitor` parameter which can be used to point a service -to a cluster of servers that are monitored by a monitor. The value of the -`monitor` parameter should be the name of a monitor in the configuration name. - -For more details, refer to the [Configuration -Guide](../Getting-Started/Configuration-Guide.md#cluster) section on clusters. - ### Module commands Introduced in MaxScale 2.1, the module commands are special, module-specific From c82831cc100aee7ba3e3dbe1ea52869e19044243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 8 Feb 2017 09:29:26 +0200 Subject: [PATCH 18/18] Fix merge conflict An old define name caused the build to fail. --- server/modules/routing/avrorouter/avro_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/modules/routing/avrorouter/avro_file.c b/server/modules/routing/avrorouter/avro_file.c index e91bec5b4..4ab4aae93 100644 --- a/server/modules/routing/avrorouter/avro_file.c +++ b/server/modules/routing/avrorouter/avro_file.c @@ -70,7 +70,7 @@ bool avro_open_binlog(const char *binlogdir, const char *file, int *dest) { if (errno != ENOENT) { - char err[STRERROR_BUFLEN]; + char err[MXS_STRERROR_BUFLEN]; MXS_ERROR("Failed to open binlog file %s: %d, %s", path, errno, strerror_r(errno, err, sizeof(err))); }