From 62a268a48cd671a94d7f355fcd7af48412caca03 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 11 Jan 2016 17:34:36 +0200 Subject: [PATCH 01/14] Moved description of `weightby` to the correct section. The description was in router options instead of optional parameters. --- Routers/ReadWriteSplit.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Routers/ReadWriteSplit.md b/Routers/ReadWriteSplit.md index 11ace959a..83076955d 100644 --- a/Routers/ReadWriteSplit.md +++ b/Routers/ReadWriteSplit.md @@ -77,6 +77,14 @@ When value all is used, queries reading session variables can be routed to any a In above-mentioned case the user-defined variable would only be updated in the master where query would be routed due to `INSERT` statement. +### `weightby` + +This parameter defines the name of the value which is used to calculate the +weights of the servers. The value should be the name of a parameter in the +server definitions and it should exist in all the servers used by this router. +For more information, see the description of the `weightby` parameter in +the [Configuration Guide](../Getting-Started/Configuration-Guide.md). + ## Router options **`router_options`** may include multiple **readwritesplit**-specific options. All the options are parameter-value pairs. All parameters listed in this section must be configured as a value in `router_options`. @@ -135,14 +143,6 @@ disable_sescmd_history=true master_accept_reads=true ``` -### `weightby` - -This parameter defines the name of the value which is used to calculate the -weights of the servers. The value should be the name of a parameter in the -server definitions and it should exist in all the servers used by this router. -For more information, see the description of the `weightby` parameter in -the [Configuration Guide](../Getting-Started/Configuration-Guide.md). - ## Routing hints The readwritesplit router supports routing hints. For a detailed guide on hint syntax and functionality, please read [this](../Reference/Hint-Syntax.md) document. From 98ba84f78d8c274217751a268b64daf1bcc94c7a Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 19 Jan 2016 13:51:28 +0200 Subject: [PATCH 02/14] Remove beta status. Remove all references to beta. This is now 1.3.0. --- Release-Notes/MaxScale-1.3.0-Release-Notes.md | 122 +++++++++--------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/Release-Notes/MaxScale-1.3.0-Release-Notes.md b/Release-Notes/MaxScale-1.3.0-Release-Notes.md index f4e7426db..9a8a45f05 100644 --- a/Release-Notes/MaxScale-1.3.0-Release-Notes.md +++ b/Release-Notes/MaxScale-1.3.0-Release-Notes.md @@ -3,11 +3,7 @@ This document describes the changes in release 1.3, when compared to release 1.2.1. -## 1.3.0 Beta - -**NOTE** This is a beta release. We think it is better than 1.2.1, -but there may still be rough edges. Keep that in mind when trying it -out. +## 1.3.0 For any problems you encounter, please consider submitting a bug report at [Jira](https://mariadb.atlassian.net). @@ -149,85 +145,91 @@ details, please read the [Monitor Common](../Monitors/Monitor-Common.md) documen ## Bug fixes -Here is a list of bugs fixed since the release of MaxScale 1.2.1. +[Here is a list of bugs fixed since the release of MaxScale 1.2.1.](https://mariadb.atlassian.net/browse/MXS-550?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20in%20(Fixed%2C%20Done)%20AND%20fixVersion%20%3D%201.3.0) - * [MXS-414](https://mariadb.atlassian.net/browse/MXS-414): Maxscale crashed every day! - * [MXS-415](https://mariadb.atlassian.net/browse/MXS-415): MaxScale 1.2.1 crashed with Signal 6 and 11 - * [MXS-351](https://mariadb.atlassian.net/browse/MXS-351): Router error handling can cause crash by leaving dangling DCB pointer - * [MXS-428](https://mariadb.atlassian.net/browse/MXS-428): Maxscale crashes at startup. - * [MXS-376](https://mariadb.atlassian.net/browse/MXS-376): MaxScale terminates with SIGABRT. - * [MXS-269](https://mariadb.atlassian.net/browse/MXS-269): Crash in MySQL backend protocol - * [MXS-500](https://mariadb.atlassian.net/browse/MXS-500): Tee filter hangs when statement aren't duplicated. - * [MXS-447](https://mariadb.atlassian.net/browse/MXS-447): Monitors are started before they have been fully configured - * [MXS-417](https://mariadb.atlassian.net/browse/MXS-417): Single character wildcard doesn't work in MaxScale - * [MXS-409](https://mariadb.atlassian.net/browse/MXS-409): prepare should not hit all servers - * [MXS-405](https://mariadb.atlassian.net/browse/MXS-405): Maxscale bin router crash - * [MXS-412](https://mariadb.atlassian.net/browse/MXS-412): show dbusers segmentation fault - * [MXS-289](https://mariadb.atlassian.net/browse/MXS-289): Corrupted memory or empty value are in Master_host field of SHOW SLAVE STATUS when master connection is broken - * [MXS-283](https://mariadb.atlassian.net/browse/MXS-283): SSL connections leak memory - * [MXS-54](https://mariadb.atlassian.net/browse/MXS-54): Write failed auth attempt to trace log - * [MXS-501](https://mariadb.atlassian.net/browse/MXS-501): Use hangs when Tee filter uses matching + * [MXS-508](https://mariadb.atlassian.net/browse/MXS-508): regex filter ignores username + * [MXS-505](https://mariadb.atlassian.net/browse/MXS-505): if Maxscale fails to start it goes to infinite "try-to-start and fail" loop + * [MXS-501](https://mariadb.atlassian.net/browse/MXS-501): USE hangs when Tee filter uses matching + * [MXS-500](https://mariadb.atlassian.net/browse/MXS-500): Tee filter hangs when statements aren't duplicated. * [MXS-499](https://mariadb.atlassian.net/browse/MXS-499): Init script error on Debian Wheezy - * [MXS-323](https://mariadb.atlassian.net/browse/MXS-323): mysql_client readwritesplit handleError seems using wrong dcb and cause wrong behavior * [MXS-494](https://mariadb.atlassian.net/browse/MXS-494): Weight calculation favors servers without connections * [MXS-493](https://mariadb.atlassian.net/browse/MXS-493): SIGFPE when weightby parameter is 0 and using LEAST_GLOBAL_CONNECTIONS * [MXS-492](https://mariadb.atlassian.net/browse/MXS-492): Segfault if server is missing weighting parameter - * [MXS-360](https://mariadb.atlassian.net/browse/MXS-360): Persistent connections: maxadmin reports 0 all the time even if connections are created - * [MXS-429](https://mariadb.atlassian.net/browse/MXS-429): Binlog Router crashes due to segmentation fault with no meaningful error if no listener is configured - * [MXS-416](https://mariadb.atlassian.net/browse/MXS-416): Orphan sessions appear after many network errors - * [MXS-472](https://mariadb.atlassian.net/browse/MXS-472): Monitors update status in multiple steps - * [MXS-361](https://mariadb.atlassian.net/browse/MXS-361): crash on backend restart if persistent connections are in use - * [MXS-403](https://mariadb.atlassian.net/browse/MXS-403): Monitor callback to DCBs evades thread control causing crashes - * [MXS-392](https://mariadb.atlassian.net/browse/MXS-392): Update to "Rabbit MQ setup and MaxScale Integration" document * [MXS-491](https://mariadb.atlassian.net/browse/MXS-491): MaxScale can time out systemd if startup of services takes too long - * [MXS-329](https://mariadb.atlassian.net/browse/MXS-329): The session pointer in a DCB can be null unexpectedly - * [MXS-479](https://mariadb.atlassian.net/browse/MXS-479): localtime must not be used in the multi-threaded program. * [MXS-480](https://mariadb.atlassian.net/browse/MXS-480): Readwritesplit defaults cause connection pileup + * [MXS-479](https://mariadb.atlassian.net/browse/MXS-479): localtime must not be used in the multi-threaded program. + * [MXS-472](https://mariadb.atlassian.net/browse/MXS-472): Monitors update status in multiple steps * [MXS-464](https://mariadb.atlassian.net/browse/MXS-464): Upgrade 1.2.0 to 1.2.1 blocking start of `maxscale` service - * [MXS-365](https://mariadb.atlassian.net/browse/MXS-365): Load data local infile connection abort when loading certain files + * [MXS-450](https://mariadb.atlassian.net/browse/MXS-450): Syslog default prefix is MaxScale not maxscale + * [MXS-447](https://mariadb.atlassian.net/browse/MXS-447): Monitors are started before they have been fully configured + * [MXS-436](https://mariadb.atlassian.net/browse/MXS-436): Invalid threads argument is ignored and MaxScale starts with one thread * [MXS-431](https://mariadb.atlassian.net/browse/MXS-431): Backend authentication fails with schemarouter - * [MXS-394](https://mariadb.atlassian.net/browse/MXS-394): Faults in regex_replace function of regexfilter.c - * [MXS-379](https://mariadb.atlassian.net/browse/MXS-379): Incorrect handing of a GWBUF may cause SIGABRT. - * [MXS-321](https://mariadb.atlassian.net/browse/MXS-321): Incorrect number of connections in maxadmin list view + * [MXS-429](https://mariadb.atlassian.net/browse/MXS-429): Binlog Router crashes due to segmentation fault with no meaningful error if no listener is configured + * [MXS-428](https://mariadb.atlassian.net/browse/MXS-428): Maxscale crashes at startup. + * [MXS-427](https://mariadb.atlassian.net/browse/MXS-427): Logging a large string causes a segmentation fault + * [MXS-417](https://mariadb.atlassian.net/browse/MXS-417): Single character wildcard doesn't work in MaxScale + * [MXS-416](https://mariadb.atlassian.net/browse/MXS-416): Orphan sessions appear after many network errors + * [MXS-415](https://mariadb.atlassian.net/browse/MXS-415): MaxScale 1.2.1 crashed with Signal 6 and 11 + * [MXS-414](https://mariadb.atlassian.net/browse/MXS-414): Maxscale crashed every day! * [MXS-413](https://mariadb.atlassian.net/browse/MXS-413): MaxAdmin hangs with show session + * [MXS-412](https://mariadb.atlassian.net/browse/MXS-412): show dbusers segmentation fault + * [MXS-409](https://mariadb.atlassian.net/browse/MXS-409): prepare should not hit all servers * [MXS-408](https://mariadb.atlassian.net/browse/MXS-408): Connections to backend databases do not clear promptly - * [MXS-385](https://mariadb.atlassian.net/browse/MXS-385): disable_sescmd_history can cause false data to be read. + * [MXS-407](https://mariadb.atlassian.net/browse/MXS-407): Maxscale binlogrouter binlog names are unncessarily length-limited + * [MXS-405](https://mariadb.atlassian.net/browse/MXS-405): Maxscale bin router crash + * [MXS-403](https://mariadb.atlassian.net/browse/MXS-403): Monitor callback to DCBs evades thread control causing crashes + * [MXS-394](https://mariadb.atlassian.net/browse/MXS-394): Faults in regex_replace function of regexfilter.c + * [MXS-392](https://mariadb.atlassian.net/browse/MXS-392): Update to "Rabbit MQ setup and MaxScale Integration" document * [MXS-386](https://mariadb.atlassian.net/browse/MXS-386): max_sescmd_history should not close connections + * [MXS-385](https://mariadb.atlassian.net/browse/MXS-385): disable_sescmd_history can cause false data to be read. + * [MXS-379](https://mariadb.atlassian.net/browse/MXS-379): Incorrect handing of a GWBUF may cause SIGABRT. + * [MXS-376](https://mariadb.atlassian.net/browse/MXS-376): MaxScale terminates with SIGABRT. * [MXS-373](https://mariadb.atlassian.net/browse/MXS-373): If config file is non-existent, maxscale crashes. * [MXS-366](https://mariadb.atlassian.net/browse/MXS-366): Multi-source slave servers are not detected. - * [MXS-271](https://mariadb.atlassian.net/browse/MXS-271): Schemarouter and unknown databases + * [MXS-365](https://mariadb.atlassian.net/browse/MXS-365): Load data local infile connection abort when loading certain files + * [MXS-363](https://mariadb.atlassian.net/browse/MXS-363): rpm building seems to do something wrong with maxscale libraries + * [MXS-361](https://mariadb.atlassian.net/browse/MXS-361): crash on backend restart if persistent connections are in use + * [MXS-360](https://mariadb.atlassian.net/browse/MXS-360): Persistent connections: maxadmin reports 0 all the time even if connections are created + * [MXS-358](https://mariadb.atlassian.net/browse/MXS-358): Crash, Error in `/usr/bin/maxscale': free(): invalid next size (fast) + * [MXS-352](https://mariadb.atlassian.net/browse/MXS-352): With no backend connection, services aren't started + * [MXS-351](https://mariadb.atlassian.net/browse/MXS-351): Router error handling can cause crash by leaving dangling DCB pointer + * [MXS-345](https://mariadb.atlassian.net/browse/MXS-345): maxscale.conf in /etc/init.d prevents puppet from starting maxscale + * [MXS-342](https://mariadb.atlassian.net/browse/MXS-342): When ini_parse fails to parse config file, no log messages are printed. + * [MXS-333](https://mariadb.atlassian.net/browse/MXS-333): use_sql_variables_in=master doesn't work + * [MXS-329](https://mariadb.atlassian.net/browse/MXS-329): The session pointer in a DCB can be null unexpectedly + * [MXS-323](https://mariadb.atlassian.net/browse/MXS-323): mysql_client readwritesplit handleError seems using wrong dcb and cause wrong behavior + * [MXS-321](https://mariadb.atlassian.net/browse/MXS-321): Incorrect number of connections in maxadmin list view + * [MXS-310](https://mariadb.atlassian.net/browse/MXS-310): MaxScale 1.2 does not completely cleanly change to the maxscale user + * [MXS-297](https://mariadb.atlassian.net/browse/MXS-297): postinstall on debian copies wrong file in /etc/init.d + * [MXS-293](https://mariadb.atlassian.net/browse/MXS-293): Bug in init script, and maxscale --user=maxscale does run as root + * [MXS-291](https://mariadb.atlassian.net/browse/MXS-291): Random number generation has flaws + * [MXS-289](https://mariadb.atlassian.net/browse/MXS-289): Corrupted memory or empty value are in Master_host field of SHOW SLAVE STATUS when master connection is broken * [MXS-286](https://mariadb.atlassian.net/browse/MXS-286): Fix the content and format of MaxScale-HA-with-Corosync-Pacemaker document + * [MXS-283](https://mariadb.atlassian.net/browse/MXS-283): SSL connections leak memory + * [MXS-282](https://mariadb.atlassian.net/browse/MXS-282): Add example to "Routing Hints" document + * [MXS-281](https://mariadb.atlassian.net/browse/MXS-281): SELECT INTO OUTFILE query goes several times to one slave + * [MXS-280](https://mariadb.atlassian.net/browse/MXS-280): SELECT INTO OUTFILE query succeeds even if backed fails + * [MXS-276](https://mariadb.atlassian.net/browse/MXS-276): Memory leak of buffer in connection router readQuery * [MXS-274](https://mariadb.atlassian.net/browse/MXS-274): Memory Leak + * [MXS-271](https://mariadb.atlassian.net/browse/MXS-271): Schemarouter and unknown databases + * [MXS-269](https://mariadb.atlassian.net/browse/MXS-269): Crash in MySQL backend protocol + * [MXS-260](https://mariadb.atlassian.net/browse/MXS-260): Multiple MaxScale processes + * [MXS-258](https://mariadb.atlassian.net/browse/MXS-258): ERR_error_string could overflow in future * [MXS-254](https://mariadb.atlassian.net/browse/MXS-254): Failure to read configuration file results in no error log messages * [MXS-251](https://mariadb.atlassian.net/browse/MXS-251): Non-thread safe strerror - * [MXS-291](https://mariadb.atlassian.net/browse/MXS-291): Random number generation has flaws - * [MXS-342](https://mariadb.atlassian.net/browse/MXS-342): When ini_parse fails to parse config file, no log messages are printed. - * [MXS-345](https://mariadb.atlassian.net/browse/MXS-345): maxscale.conf in /etc/init.d prevents puppet from starting maxscale - * [MXS-333](https://mariadb.atlassian.net/browse/MXS-333): use_sql_variables_in=master doesn't work - * [MXS-260](https://mariadb.atlassian.net/browse/MXS-260): Multiple MaxScale processes - * [MXS-184](https://mariadb.atlassian.net/browse/MXS-184): init script issues in CentOS 7 - * [MXS-280](https://mariadb.atlassian.net/browse/MXS-280): SELECT INTO OUTFILE query succeeds even if backed fails - * [MXS-202](https://mariadb.atlassian.net/browse/MXS-202): User password not handled correctly - * [MXS-282](https://mariadb.atlassian.net/browse/MXS-282): Add example to "Routing Hints" document * [MXS-220](https://mariadb.atlassian.net/browse/MXS-220): LAST_INSERT_ID() query is redirect to slave if function call is in where clause - * [MXS-196](https://mariadb.atlassian.net/browse/MXS-196): DCB state is changed prior to polling operation - * [MXS-281](https://mariadb.atlassian.net/browse/MXS-281): SELECT INTO OUTFILE query goes several times to one slave + * [MXS-210](https://mariadb.atlassian.net/browse/MXS-210): Check MaxScale user privileges + * [MXS-202](https://mariadb.atlassian.net/browse/MXS-202): User password not handled correctly * [MXS-197](https://mariadb.atlassian.net/browse/MXS-197): Incorrect sequence of operations with DCB + * [MXS-196](https://mariadb.atlassian.net/browse/MXS-196): DCB state is changed prior to polling operation * [MXS-195](https://mariadb.atlassian.net/browse/MXS-195): maxscaled.c ineffective DCB disposal - * [MXS-363](https://mariadb.atlassian.net/browse/MXS-363): rpm building seems to do something wrong with maxscale libraries + * [MXS-184](https://mariadb.atlassian.net/browse/MXS-184): init script issues in CentOS 7 + * [MXS-183](https://mariadb.atlassian.net/browse/MXS-183): MaxScale crash after 'reload config' + * [MXS-111](https://mariadb.atlassian.net/browse/MXS-111): maxscale binlog events shown in show services seems to be double-counted for the master connection + * [MXS-54](https://mariadb.atlassian.net/browse/MXS-54): Write failed auth attempt to trace log * [MXS-35](https://mariadb.atlassian.net/browse/MXS-35): bugzillaId-451: maxscale main() exit code is always 0 after it daemonizes * [MXS-29](https://mariadb.atlassian.net/browse/MXS-29): bugzillaId-589: detect if MAXSCALE_SCHEMA.HEARTBEAT table is not replicated - * [MXS-436](https://mariadb.atlassian.net/browse/MXS-436): Invalid threads argument is ignored and MaxScale starts with one thread - * [MXS-427](https://mariadb.atlassian.net/browse/MXS-427): Logging a large string causes a segmentation fault - * [MXS-352](https://mariadb.atlassian.net/browse/MXS-352): With no backend connection, services aren't started - * [MXS-293](https://mariadb.atlassian.net/browse/MXS-293): Bug in init script, and maxscale --user=maxscale does run as root - * [MXS-210](https://mariadb.atlassian.net/browse/MXS-210): Check MaxScale user privileges - * [MXS-111](https://mariadb.atlassian.net/browse/MXS-111): maxscale binlog events shown in show services seems to be double-counted for the master connection * [MXS-3](https://mariadb.atlassian.net/browse/MXS-3): Remove code for atomic_add in skygw_utils.cc - * [MXS-258](https://mariadb.atlassian.net/browse/MXS-258): ERR_error_string could overflow in future - * [MXS-310](https://mariadb.atlassian.net/browse/MXS-310): MaxScale 1.2 does not completely cleanly change to the maxscale user - * [MXS-450](https://mariadb.atlassian.net/browse/MXS-450): Syslog default prefix is MaxScale not maxscale - * [MXS-297](https://mariadb.atlassian.net/browse/MXS-297): postinstall on debian copies wrong file in /etc/init.d ## Known Issues and Limitations From 011636cfcf3b20726eb09d1a74948dc2e6e82dcb Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 15 Jan 2016 16:38:15 +0200 Subject: [PATCH 03/14] Disabled `connection_timeout` because it's unsafe to use The current implementation of the session timeout functionality is not safe to use. Added a warning to the documentation and disabled the code. If the user tries to use it, a warning is logged. --- Getting-Started/Configuration-Guide.md | 2 ++ Release-Notes/MaxScale-1.3.0-Release-Notes.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Getting-Started/Configuration-Guide.md b/Getting-Started/Configuration-Guide.md index b8d836477..0eaccf800 100644 --- a/Getting-Started/Configuration-Guide.md +++ b/Getting-Started/Configuration-Guide.md @@ -467,6 +467,8 @@ MaxScale normally suppresses warning messages about failed authentication. Enabl #### `connection_timeout` +**NOTE**: This parameter is not safe to use in version 1.3.0. Please do not use it. + The connection_timeout parameter is used to disconnect sessions to MaxScale that have been idle for too long. The session timeouts are disabled by default. To enable them, define the timeout in seconds in the service's configuration section. Example: diff --git a/Release-Notes/MaxScale-1.3.0-Release-Notes.md b/Release-Notes/MaxScale-1.3.0-Release-Notes.md index 9a8a45f05..a19e76638 100644 --- a/Release-Notes/MaxScale-1.3.0-Release-Notes.md +++ b/Release-Notes/MaxScale-1.3.0-Release-Notes.md @@ -236,6 +236,8 @@ details, please read the [Monitor Common](../Monitors/Monitor-Common.md) documen There are a number bugs and known limitations within this version of MaxScale, the most serious of this are listed below. +* The `connection_timeout` service parameter is not safe to use in version 1.3.0. + * MaxScale can not manage authentication that uses wildcard matching in hostnames in the mysql.user table of the backend database. The only wildcards that can be used are in IP address entries. * When users have different passwords based on the host from which they connect MaxScale is unable to determine which password it should use to connect to the backend database. This results in failed connections and unusable usernames in MaxScale. From b386138fe4c0dbd37083488b02a5de4401bb5bda Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Tue, 19 Jan 2016 18:36:01 +0200 Subject: [PATCH 04/14] Updated help messages and manpage The manpage was out of date and was missing a BUGS section. The `--help` output of MaxScale wrongly stated that the default is to log to shared memory as did the documentation. --- Tutorials/Administration-Tutorial.md | 4 ++-- maxscale.1 | 29 +++++++++++++++++++++------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Tutorials/Administration-Tutorial.md b/Tutorials/Administration-Tutorial.md index bb05eb68d..1a9351775 100644 --- a/Tutorials/Administration-Tutorial.md +++ b/Tutorials/Administration-Tutorial.md @@ -33,7 +33,7 @@ Switch|Long Option|Description ------|-----------|----------- `-d`|`--nodaemon`|enable running in terminal process (default:disabled) `-f FILE`|`--config=FILE`|relative or absolute pathname of MaxScale configuration file (default:/etc/maxscale.cnf) -`-l[file shm]`|`--log=[file shm]`|log to file or shared memory (default: shm) +`-l[file shm]`|`--log=[file shm]`|log to file or shared memory (default: file) `-L PATH`|`--logdir=PATH`|path to log file directory (default: /var/log/maxscale) `-D PATH`|`--datadir=PATH`|path to data directory, stored embedded mysql tables (default: /var/cache/maxscale) `-C PATH`|`--configdir=PATH`|path to configuration file directory (default: /etc/) @@ -42,7 +42,7 @@ Switch|Long Option|Description `P PATH`|`--piddir=PATH`|PID file directory `-U USER`|`--user=USER`|run MaxScale as another user. The user ID and group ID of this user are used to run MaxScale. `-s [yes no]`|`--syslog=[yes no]`|log messages to syslog (default:yes) -`-S [yes no]`|`--maxscalelog=[yes no]`|log messages to MaxScale log (default: yes) +`-S [yes no]`|`--maxlog=[yes no]`|log messages to MaxScale log (default: yes) `-G [0 1]`|`--log_augmentation=[0 1]`|augment messages with the name of the function where the message was logged (default: 0). Primarily for development purposes. `-v`|`--version`|print version info and exit `-V`|`--version-full`|print version info and the commit ID the binary was built from diff --git a/maxscale.1 b/maxscale.1 index d24b3b47e..c835ad265 100644 --- a/maxscale.1 +++ b/maxscale.1 @@ -24,7 +24,7 @@ Run MaxScale in the terminal process Relative or absolute pathname of MaxScale configuration file to load. .TP .BR -l "[\fIfile|shm\fB], --log=[\fIfile|shm\fB]" -Log trace and debug logs to file or shared memory. The debug and trace logs are disabled by default and if enabled, will log to shared memory. +Log to file or shared memory. The default is to log to file. .TP .BR -L " \fIPATH\fB, --logdir=\fIPATH\fB" Path to log file directory. @@ -50,7 +50,7 @@ Run MaxScale as another user. The user ID and group ID of this user are used to .BR -s " [\fIyes\fB|\fIno\fB], --syslog=[\fIyes\fB|\fIno\fB]" Log messages to syslog. .TP -.BR -S " [\fIyes\fB|\fIno\fB], \fB--maxscalelog=[\fIyes\fB|\fIno\fB]" +.BR -S " [\fIyes\fB|\fIno\fB], \fB--maxlog=[\fIyes\fB|\fIno\fB]" Log messages to MaxScale's own log files. .TP .BR "-v, --version" @@ -61,12 +61,27 @@ Print full version information including the Git commit the binary was built fro .TP .BR "-?, --help" Show the help information for MaxScale and exit. - .SH EXAMPLES Tutorials on GitHub: -.UR https://github.com/mariadb-corporation/MaxScale/blob/master/Documentation/Documentation-Contents.md#tutorials -.UE + +.RS +.I https://github.com/mariadb-corporation/MaxScale/blob/master/Documentation/Documentation-Contents.md#tutorials +.RE .SH SEE ALSO +The MaxScale documentation on the MariaDB Knowledge Base: + +.RS +.I https://mariadb.com/kb/en/mariadb-enterprise/mariadb-maxscale/ +.RE + The MaxScale documentation on GitHub: -.UR https://github.com/mariadb-corporation/MaxScale/blob/master/Documentation/Documentation-Contents.md -.UE + +.RS +.I https://github.com/mariadb-corporation/MaxScale/blob/master/Documentation/Documentation-Contents.md +.RE +.SH BUGS +You can see a list of known bugs and report new bugs at: + +.RS +.I https://mariadb.atlassian.net/browse/MXS +.RE From 28c9892db004cb1714582487c8644d1c77c1255b Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 29 Jan 2016 10:59:25 +0200 Subject: [PATCH 05/14] Moved HA tutorials to the Tutorials folder The Corosync/Pacemaker and Lsyncd tutorials were in the reference folder even though they are tutorials. --- Documentation-Contents.md | 9 ++++++--- .../MaxScale-HA-with-Corosync-Pacemaker.md | 4 ++-- {Reference => Tutorials}/MaxScale-HA-with-lsyncd.md | 0 3 files changed, 8 insertions(+), 5 deletions(-) rename {Reference => Tutorials}/MaxScale-HA-with-Corosync-Pacemaker.md (98%) rename {Reference => Tutorials}/MaxScale-HA-with-lsyncd.md (100%) diff --git a/Documentation-Contents.md b/Documentation-Contents.md index 5e4105f69..666589988 100644 --- a/Documentation-Contents.md +++ b/Documentation-Contents.md @@ -27,8 +27,6 @@ ## Reference - [MaxAdmin](Reference/MaxAdmin.md) - - [MaxScale HA with Corosync-Pacemaker](Reference/MaxScale-HA-with-Corosync-Pacemaker.md) - - [MaxScale HA with Lsyncd](Reference/MaxScale-HA-with-lsyncd.md) - [How Errors are Handled in MaxScale](Reference/How-errors-are-handled-in-MaxScale.md) - [Debug and Diagnostic Support](Reference/Debug-And-Diagnostic-Support.md) - [Routing Hints](Reference/Hint-Syntax.md) @@ -48,9 +46,14 @@ These tutorials are for specific use cases and module combinations. - [Replication Proxy with the Binlog Router Tutorial](Tutorials/Replication-Proxy-Binlog-Router-Tutorial.md) - [RabbitMQ Setup and MaxScale Integration Tutorial](Tutorials/RabbitMQ-Setup-And-MaxScale-Integration.md) - [RabbitMQ and Tee Filter Data Archiving Tutorial](Tutorials/RabbitMQ-And-Tee-Archiving.md) - - [Nagios Plugins for MaxScale Tutorial](Tutorials/Nagios-Plugins.md) - [Simple Schema Sharding Tutorial](Tutorials/Simple-Sharding-Tutorial.md) +Here are tutorials on monitoring and managing MaxScale in cluster envoronments. + + - [Nagios Plugins for MaxScale Tutorial](Tutorials/Nagios-Plugins.md) + - [MaxScale HA with Corosync-Pacemaker](Tutorials/MaxScale-HA-with-Corosync-Pacemaker.md) + - [MaxScale HA with Lsyncd](Tutorials/MaxScale-HA-with-lsyncd.md) + ## Routers The routing module is the core of a MaxScale service. The router documentation diff --git a/Reference/MaxScale-HA-with-Corosync-Pacemaker.md b/Tutorials/MaxScale-HA-with-Corosync-Pacemaker.md similarity index 98% rename from Reference/MaxScale-HA-with-Corosync-Pacemaker.md rename to Tutorials/MaxScale-HA-with-Corosync-Pacemaker.md index 873af6b68..75ffe34dd 100644 --- a/Reference/MaxScale-HA-with-Corosync-Pacemaker.md +++ b/Tutorials/MaxScale-HA-with-Corosync-Pacemaker.md @@ -79,7 +79,7 @@ On one of the nodes, say node2 run the corosync-keygen utility and follow ``` [root@node2 ~]# corosync-keygen -Corosync Cluster Engine Authentication key generator. Gathering 1024 bits for key from /dev/random. Press keys on your keyboard to generate entropy. +Corosync Cluster Engine Authentication key generator. Gathering 1024 bits for key from /dev/random. Press keys on your keyboard to generate entropy. After completion the key will be found in /etc/corosync/authkey. ``` @@ -141,7 +141,7 @@ name: pacemaker } ``` -**Please note **in this example: +**Please note** in this example: - unicast UDP is used diff --git a/Reference/MaxScale-HA-with-lsyncd.md b/Tutorials/MaxScale-HA-with-lsyncd.md similarity index 100% rename from Reference/MaxScale-HA-with-lsyncd.md rename to Tutorials/MaxScale-HA-with-lsyncd.md From fb7de2860d7c51af3593b861e9f9da85d768af8b Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 1 Feb 2016 10:24:35 +0200 Subject: [PATCH 06/14] Update 1.3.0 release note. --- Release-Notes/MaxScale-1.3.0-Release-Notes.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Release-Notes/MaxScale-1.3.0-Release-Notes.md b/Release-Notes/MaxScale-1.3.0-Release-Notes.md index a19e76638..dcbe0c66a 100644 --- a/Release-Notes/MaxScale-1.3.0-Release-Notes.md +++ b/Release-Notes/MaxScale-1.3.0-Release-Notes.md @@ -147,6 +147,9 @@ details, please read the [Monitor Common](../Monitors/Monitor-Common.md) documen [Here is a list of bugs fixed since the release of MaxScale 1.2.1.](https://mariadb.atlassian.net/browse/MXS-550?jql=project%20%3D%20MXS%20AND%20issuetype%20%3D%20Bug%20AND%20resolution%20in%20(Fixed%2C%20Done)%20AND%20fixVersion%20%3D%201.3.0) + * [MXS-559](https://mariadb.atlassian.net/browse/MXS-559): Crash due to debug assertion in readwritesplit + * [MXS-551](https://mariadb.atlassian.net/browse/MXS-551): Maxscale BETA 1.3.0 running as root + * [MXS-548](https://mariadb.atlassian.net/browse/MXS-548): Maxscale 1.2.1 crash on Ubuntu 4.04.3 x86_64 * [MXS-508](https://mariadb.atlassian.net/browse/MXS-508): regex filter ignores username * [MXS-505](https://mariadb.atlassian.net/browse/MXS-505): if Maxscale fails to start it goes to infinite "try-to-start and fail" loop * [MXS-501](https://mariadb.atlassian.net/browse/MXS-501): USE hangs when Tee filter uses matching @@ -250,6 +253,10 @@ the most serious of this are listed below. * The SSL support is known to be unstable. +* Importing a large dump via readwritesplit may fail. + + Workaround is to bypass MaxScale when importing or to use the readconn router. + ## Packaging RPM and Debian packages are provided for the Linux distributions supported From 86cb2094fa589502569ac5ccecfafca946c16614 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Mon, 1 Feb 2016 10:52:52 +0200 Subject: [PATCH 07/14] Update authentication limitations. --- Getting-Started/Configuration-Guide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Getting-Started/Configuration-Guide.md b/Getting-Started/Configuration-Guide.md index 0eaccf800..9ae2fcf29 100644 --- a/Getting-Started/Configuration-Guide.md +++ b/Getting-Started/Configuration-Guide.md @@ -773,6 +773,8 @@ and short notations 192.%.% 192.168.% +Note that currently wildcards are only supported in conjunction with IP-addresses, not with domain names. + ## Error Reporting MaxScale is designed to be executed as a service, therefore all error reports, including configuration errors, are written to the MaxScale error log file. By default, MaxScale will log to a file in `/var/log/maxscale`, the only exception to this is if the log directory is not writable, in which case a message is sent to the standard error descriptor. From 3da251f78178070562818de92a3d7ccb5f3c63e2 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 29 Jan 2016 18:04:54 +0200 Subject: [PATCH 08/14] Added user configurable actions to dbfwfilter The dbfwfilter can now either allow, block or ignore queries that match the configured rules. --- Filters/Database-Firewall-Filter.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Filters/Database-Firewall-Filter.md b/Filters/Database-Firewall-Filter.md index 58eac1b6c..acaf01ca0 100644 --- a/Filters/Database-Firewall-Filter.md +++ b/Filters/Database-Firewall-Filter.md @@ -28,7 +28,13 @@ The database firewall filter supports a single option, `ignorecase`. This will s ### Filter Parameters -The database firewall filter has one mandatory parameter that defines the location of the rule file. This is the `rules` parameter and it expects an absolute path to the rule file. +#### `rules` + +The database firewall filter has one mandatory parameter that defines the location of the rule file. It expects an absolute path to the rule file. + +#### `action` + +This parameter is optional and determines what action is taken when a query matches a rule. The value can be either `allow`, which allows all matching queries to proceed but blocks those that don't match, or `block`, which blocks all matching queries, or `ignore` which allows all queries to proceed. ## Rule syntax From de6338e7d635c9f19f04ac8b10fea58b84c0683a Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 29 Jan 2016 21:48:29 +0200 Subject: [PATCH 09/14] Added logging of matching and non-matching queries to dbfwfilter When configured to log matching queries, the dbfwfilter will log all queries that match a rule. The rule name, user name and the query itself are logged. It is also possible to match all queries that do not match a rule. Only the user name and query is logged in this mode. --- Filters/Database-Firewall-Filter.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Filters/Database-Firewall-Filter.md b/Filters/Database-Firewall-Filter.md index acaf01ca0..3e17e4943 100644 --- a/Filters/Database-Firewall-Filter.md +++ b/Filters/Database-Firewall-Filter.md @@ -36,6 +36,18 @@ The database firewall filter has one mandatory parameter that defines the locati This parameter is optional and determines what action is taken when a query matches a rule. The value can be either `allow`, which allows all matching queries to proceed but blocks those that don't match, or `block`, which blocks all matching queries, or `ignore` which allows all queries to proceed. +#### `log_match` + +Log all queries that match a rule. For the `any` matching mode, the name of +the rule that matched is logged and for other matching modes, the name of +the last matching rule is logged. In addition to the rule name the matched +user and the query itself is logged. The log messages are logged at the notice level. + +#### `log_no_match` + +Log all queries that do not match a rule. The matched user and the query is +logged. The log messages are logged at the notice level. + ## Rule syntax The rules are defined by using the following syntax: From 062373d8da524bc72a32c6418063ed8b956a8d26 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Fri, 12 Feb 2016 21:19:38 +0200 Subject: [PATCH 10/14] Added missing schemarouter parameter documentation The `ignore_databases` and `ignore_databases_regex` were missing from the schemarouter documentation. --- Routers/SchemaRouter.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Routers/SchemaRouter.md b/Routers/SchemaRouter.md index 02d6f8e50..3909b454d 100644 --- a/Routers/SchemaRouter.md +++ b/Routers/SchemaRouter.md @@ -50,6 +50,9 @@ The schemarouter supports the following router options: |disable_sescmd_history|true, false|Disable the session command history. This will prevent growing memory consumption of a long-running session and allows pooled connections to MaxScale to be used. The drawback of this is the fact that if a server goes down, the session state will not be consistent anymore.| |refresh_databases|true, false|Enable database map refreshing mid-session. These are triggered by a failure to change the database i.e. `USE ...``queries.| |refresh_interval|float|The minimum interval between database map refreshes in seconds.| +|ignore_databases|string|List of databases to ignore when checking for duplicate databases.| +|ignore_databases_regex|string|Regular expression that is matched against database names when checking for duplicate databases.| + ## Limitations The schemarouter router currently has some limitations due to the nature of the sharding implementation and the way the session variables are detected and routed. Here is a list of the current limitations. From 7c0eae7c065941922c5a76711adc0ffc705ea1c3 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 15 Feb 2016 11:12:54 +0200 Subject: [PATCH 11/14] Added configurable executable file directory This allows MaxScale to launch processes from the directory where the `maxscale` executable is located. --- Getting-Started/Configuration-Guide.md | 8 ++++++++ Tutorials/Administration-Tutorial.md | 21 +-------------------- maxscale.1 | 3 +++ 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Getting-Started/Configuration-Guide.md b/Getting-Started/Configuration-Guide.md index be84ef5f0..946c52208 100644 --- a/Getting-Started/Configuration-Guide.md +++ b/Getting-Started/Configuration-Guide.md @@ -281,6 +281,14 @@ Configure the directory for the PID file for MaxScale. This file contains the Pr piddir=/tmp/maxscale_cache/ ``` +#### `execdir` + +Configure the directory where the executable files reside. All internal processes which are launched will use this directory to look for executable files. + +``` +execdir=/usr/local/bin/ +``` + #### `language` Set the folder where the errmsg.sys file is located in. MaxScale will look for the errmsg.sys file installed with MaxScale from this folder. diff --git a/Tutorials/Administration-Tutorial.md b/Tutorials/Administration-Tutorial.md index 1a9351775..3ac9fb3d9 100644 --- a/Tutorials/Administration-Tutorial.md +++ b/Tutorials/Administration-Tutorial.md @@ -27,26 +27,7 @@ or ``` It is also possible to start MaxScale by executing the maxscale command itself. Running the executable /usr/bin/maxscale will result in MaxScale running as a daemon process, unattached to the terminal in which it was started and using configuration files that it finds in the /etc directory. -Options may be passed to the MaxScale binary that alter this default behavior, this options are documented in the table below. - -Switch|Long Option|Description -------|-----------|----------- -`-d`|`--nodaemon`|enable running in terminal process (default:disabled) -`-f FILE`|`--config=FILE`|relative or absolute pathname of MaxScale configuration file (default:/etc/maxscale.cnf) -`-l[file shm]`|`--log=[file shm]`|log to file or shared memory (default: file) -`-L PATH`|`--logdir=PATH`|path to log file directory (default: /var/log/maxscale) -`-D PATH`|`--datadir=PATH`|path to data directory, stored embedded mysql tables (default: /var/cache/maxscale) -`-C PATH`|`--configdir=PATH`|path to configuration file directory (default: /etc/) -`-B PATH`|`--libdir=PATH`|path to module directory (default: /usr/lib64/maxscale) -`-A PATH`|`--cachedir=PATH`|path to cache directory (default: /var/cache/maxscale) -`P PATH`|`--piddir=PATH`|PID file directory -`-U USER`|`--user=USER`|run MaxScale as another user. The user ID and group ID of this user are used to run MaxScale. -`-s [yes no]`|`--syslog=[yes no]`|log messages to syslog (default:yes) -`-S [yes no]`|`--maxlog=[yes no]`|log messages to MaxScale log (default: yes) -`-G [0 1]`|`--log_augmentation=[0 1]`|augment messages with the name of the function where the message was logged (default: 0). Primarily for development purposes. -`-v`|`--version`|print version info and exit -`-V`|`--version-full`|print version info and the commit ID the binary was built from -`-?`|`--help`|show this help +Options may be passed to the MaxScale binary that alter this default behavior. For a full list of all parameters, refer to the MaxScale help output by executing `maxscale --help`. Additional command line arguments can be passed to MaxScale with a configuration file placed at `/etc/sysconfig/maxscale` on RPM installations and `/etc/default/maxscale` file on DEB installations. Set the arguments in a variable called `MAXSCALE_OPTIONS` and remember to surround the arguments with quotes. The file should only contain environment variable declarations. diff --git a/maxscale.1 b/maxscale.1 index c835ad265..0f5aec9b6 100644 --- a/maxscale.1 +++ b/maxscale.1 @@ -44,6 +44,9 @@ Path to cache directory. This is where MaxScale stores cached authentication dat .BR -P " \fIPATH\fB, --piddir=\fIPATH\fB" Location of MaxScale's PID file. .TP +.BR -E " \fIPATH\fB, --execdir=\fIPATH\fB" +Location of the executable files. When internal processes are launched from within MaxScale the binaries are assumed to be in this directory. If you have a custom location for binary executable files you need to add this parameter. +.TP .BR -U " \fIUSER\fB, --user=\fIUSER\fB" Run MaxScale as another user. The user ID and group ID of this user are used to run MaxScale. .TP From af297dedb83cb9ebd9dca610d31f4147fa4efb3f Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Tue, 23 Feb 2016 10:17:22 +0200 Subject: [PATCH 12/14] Updated documentation about Bison and Flex dependency The dbfwfilter now requires Bison and Flex to be built --- Getting-Started/Building-MaxScale-from-Source-Code.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Getting-Started/Building-MaxScale-from-Source-Code.md b/Getting-Started/Building-MaxScale-from-Source-Code.md index 99baf3004..75870071e 100644 --- a/Getting-Started/Building-MaxScale-from-Source-Code.md +++ b/Getting-Started/Building-MaxScale-from-Source-Code.md @@ -12,6 +12,8 @@ You will need a number of tools and libraries in order to achieve this. * libedit 2.11 or later (used by the MaxAdmin tool) +* Bison and Flex + # Obtaining MariaDB packages MaxScale requires the server and the development packages for the MariaDB server. Either the 10.0 or the 5.5 version of the MariaDB server can be used. You can obtain these by following the instructions on the MariaDB.org site: [https://downloads.mariadb.org/](https://downloads.mariadb.org/) @@ -27,7 +29,7 @@ The full list of dependencies for the most common distributions is provided in t You will need to install all of the following packages for all versions of RHEL and CentOS. ``` -gcc gcc-c++ ncurses-devel bison glibc-devel cmake libgcc perl make libtool \ +gcc gcc-c++ ncurses-devel bison flex glibc-devel cmake libgcc perl make libtool \ openssl-devel libaio libaio-devel librabbitmq-devel libcurl-devel pcre-devel ``` @@ -61,7 +63,7 @@ MariaDB-devel MariaDB-server These packages are required on all versions of Ubuntu and Debian. ``` - build-essential libssl-dev libaio-dev ncurses-dev bison \ + build-essential libssl-dev libaio-dev ncurses-dev bison flex \ cmake perl libtool librabbitmq-dev libcurl-dev libpcre3-dev ``` From 3eb0b9814fb9c02efd010fcf9f128a6ba50d3b86 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 22 Feb 2016 15:48:30 +0200 Subject: [PATCH 13/14] MXS-580: Added more options for filters The tee, qlafilter, namedserverfilter and topfilter now support the same filter options: case, ignorecase and extended. The extended filter option enables the Extended Regular Expression syntax for the filters which is used when matching queries. --- Filters/Named-Server-Filter.md | 14 +++++++++- Filters/Query-Log-All-Filter.md | 46 +++++++++++++++++++-------------- Filters/Tee-Filter.md | 14 +++++++++- Filters/Top-N-Filter.md | 14 +++++++++- 4 files changed, 66 insertions(+), 22 deletions(-) diff --git a/Filters/Named-Server-Filter.md b/Filters/Named-Server-Filter.md index 62aa77ef8..b1cb53b13 100644 --- a/Filters/Named-Server-Filter.md +++ b/Filters/Named-Server-Filter.md @@ -26,7 +26,19 @@ filters=NamedServerFilter ## Filter Options -The named server filter accepts the options ignorecase or case. These define if the pattern text should take the case of the string it is matching against into consideration or not. +The named server filter accepts the following options. + +|Option |Description | +|----------|--------------------------------------------| +|ignorecase|Use case-insensitive matching | +|case |Use case-sensitive matching | +|extended |Use extended regular expression syntax (ERE)| + +To use multiple filter options, list them in a comma-separated list. + +``` +options=case,extended +``` ## Filter Parameters diff --git a/Filters/Query-Log-All-Filter.md b/Filters/Query-Log-All-Filter.md index a18466895..892f4ad4e 100644 --- a/Filters/Query-Log-All-Filter.md +++ b/Filters/Query-Log-All-Filter.md @@ -2,11 +2,11 @@ ## Overview -The Query Log All (QLA) filter is a filter module for MaxScale that is able to log all query content on a per client session basis. Logs are written in a csv format file that lists the time submitted and the SQL statement text. +The Query Log All (QLA) filter is a filter module for MaxScale that is able to log all query content on a per client session basis. Logs are written in a csv format file that lists the time submitted and the SQL statement text. ## Configuration -The configuration block for the QLA filter requires the minimal filter options in it's section within the maxscale.cnf file, stored in /etc/maxscale.cnf. +The configuration block for the QLA filter requires the minimal filter options in it's section within the maxscale.cnf file, stored in /etc/maxscale.cnf. ``` [MyLogFilter] type=filter @@ -23,53 +23,61 @@ filters=MyLogFilter ## Filter Options -The QLA filter accepts one option value, this is the name that is used for the log files that are written. The file that is created appends the session number to the name given in the options entry. For example: +The QLA filter accepts the following options. + +|Option |Description | +|----------|--------------------------------------------| +|ignorecase|Use case-insensitive matching | +|case |Use case-sensitive matching | +|extended |Use extended regular expression syntax (ERE)| + +To use multiple filter options, list them in a comma-separated list. ``` -options=/tmp/QueryLog +options=case,extended ``` -would create log files /tmp/QueryLog.1 etc. - -Note, this is included for backward compatibility with the version of the QLA filter that was provided in the initial filters implementation preview in 0.7 of MaxScale. The filebase parameter can now be used and will take precedence over the filter option. +**Note**: older the version of the QLA filter in 0.7 of MaxScale used the `options` +to define the location of the log files. This functionality is not supported +anymore and the `filebase` parameter should be used instead. ## Filter Parameters -The QLA filter accepts a number of optional parameters, these were introduced in the 1.0 release of MaxScale. +The QLA filter accepts a number of optional parameters, these were introduced in the 1.0 release of MaxScale. ### Filebase -The basename of the output file created for each session. A session index is added to the filename for each file written. +The basename of the output file created for each session. A session index is added to the filename for each file written. ``` filebase=/tmp/SqlQueryLog ``` -The filebase may also be set as the filter, the mechanism to set the filebase via the filter option is superseded by the parameter. If both are set the parameter setting will be used and the filter option ignored. +The filebase may also be set as the filter, the mechanism to set the filebase via the filter option is superseded by the parameter. If both are set the parameter setting will be used and the filter option ignored. ### Match -An optional parameter that can be used to limit the queries that will be logged by the QLA filter. The parameter value is a regular expression that is used to match against the SQL text. Only SQL statements that matches the text passed as the value of this parameter will be logged. +An optional parameter that can be used to limit the queries that will be logged by the QLA filter. The parameter value is a regular expression that is used to match against the SQL text. Only SQL statements that matches the text passed as the value of this parameter will be logged. ``` match=select.*from.*customer.*where ``` -All regular expressions are evaluated with the option to ignore the case of the text, therefore a match option of select will match both select, SELECT and any form of the word with upper or lowercase characters. +All regular expressions are evaluated with the option to ignore the case of the text, therefore a match option of select will match both select, SELECT and any form of the word with upper or lowercase characters. ### Exclude -An optional parameter that can be used to limit the queries that will be logged by the QLA filter. The parameter value is a regular expression that is used to match against the SQL text. SQL statements that match the text passed as the value of this parameter will be excluded from the log output. +An optional parameter that can be used to limit the queries that will be logged by the QLA filter. The parameter value is a regular expression that is used to match against the SQL text. SQL statements that match the text passed as the value of this parameter will be excluded from the log output. ``` exclude=where ``` -All regular expressions are evaluated with the option to ignore the case of the text, therefore an exclude option of select will exclude statements that contain both select, SELECT or any form of the word with upper or lowercase characters. +All regular expressions are evaluated with the option to ignore the case of the text, therefore an exclude option of select will exclude statements that contain both select, SELECT or any form of the word with upper or lowercase characters. ### Source -The optional source parameter defines an address that is used to match against the address from which the client connection to MaxScale originates. Only sessions that originate from this address will be logged. +The optional source parameter defines an address that is used to match against the address from which the client connection to MaxScale originates. Only sessions that originate from this address will be logged. ``` source=127.0.0.1 @@ -77,7 +85,7 @@ source=127.0.0.1 ### User -The optional user parameter defines a user name that is used to match against the user from which the client connection to MaxScale originates. Only sessions that are connected using this username are logged. +The optional user parameter defines a user name that is used to match against the user from which the client connection to MaxScale originates. Only sessions that are connected using this username are logged. ``` user=john @@ -87,13 +95,13 @@ user=john ### Example 1 - Query without primary key -Imagine you have observed an issue with a particular table and you want to determine if there are queries that are accessing that table but not using the primary key of the table. Let's assume the table name is PRODUCTS and the primary key is called PRODUCT_ID. Add a filter with the following definition: +Imagine you have observed an issue with a particular table and you want to determine if there are queries that are accessing that table but not using the primary key of the table. Let's assume the table name is PRODUCTS and the primary key is called PRODUCT_ID. Add a filter with the following definition: ``` [ProductsSelectLogger] type=filter module=qlafilter -match=SELECT.*from.*PRODUCTS .* +match=SELECT.*from.*PRODUCTS .* exclude=WHERE.*PRODUCT_ID.* filebase=/var/logs/qla/SelectProducts @@ -106,7 +114,7 @@ passwd=mypasswd filters=ProductsSelectLogger ``` -The result of then putting this filter into the service used by the application would be a log file of all select queries that mentioned the table but did not mention the PRODUCT_ID primary key in the predicates for the query. +The result of then putting this filter into the service used by the application would be a log file of all select queries that mentioned the table but did not mention the PRODUCT_ID primary key in the predicates for the query. Executing `SELECT * FROM PRODUCTS` would log the following into `/var/logs/qla/SelectProducts`: ``` 07:12:56.324 7/01/2016, SELECT * FROM PRODUCTS diff --git a/Filters/Tee-Filter.md b/Filters/Tee-Filter.md index f8cbc9ef8..b32c3c24c 100644 --- a/Filters/Tee-Filter.md +++ b/Filters/Tee-Filter.md @@ -25,7 +25,19 @@ filters=DataMartFilter ## Filter Options -The tee filter does not support any filter options. +The tee filter accepts the following options. + +|Option |Description | +|----------|--------------------------------------------| +|ignorecase|Use case-insensitive matching | +|case |Use case-sensitive matching | +|extended |Use extended regular expression syntax (ERE)| + +To use multiple filter options, list them in a comma-separated list. + +``` +options=case,extended +``` ## Filter Parameters diff --git a/Filters/Top-N-Filter.md b/Filters/Top-N-Filter.md index c1db46055..5920d9c6d 100644 --- a/Filters/Top-N-Filter.md +++ b/Filters/Top-N-Filter.md @@ -24,7 +24,19 @@ filters=MyLogFilter ## Filter Options -The top filter does not support any filter options currently. +The top filter accepts the following options. + +|Option |Description | +|----------|--------------------------------------------| +|ignorecase|Use case-insensitive matching | +|case |Use case-sensitive matching | +|extended |Use extended regular expression syntax (ERE)| + +To use multiple filter options, list them in a comma-separated list. + +``` +options=case,extended +``` ## Filter Parameters From 92f8aa9965e254c1ec7b91db4cf2fb6292f904ca Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Tue, 23 Feb 2016 21:35:45 +0200 Subject: [PATCH 14/14] Cleaned up qlafilter, topfilter and namedserverfilter instance creation The change fixes a crash when no filebase parameter is given for the filter. The instance creation functions of these filters had spossible memory leaks in case errors in the configuration occurred. In addition to these, they would be successfully created even if unexpected parameters were given. --- Filters/Query-Log-All-Filter.md | 4 ++-- Filters/Top-N-Filter.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Filters/Query-Log-All-Filter.md b/Filters/Query-Log-All-Filter.md index 892f4ad4e..ec9d5639b 100644 --- a/Filters/Query-Log-All-Filter.md +++ b/Filters/Query-Log-All-Filter.md @@ -43,11 +43,11 @@ anymore and the `filebase` parameter should be used instead. ## Filter Parameters -The QLA filter accepts a number of optional parameters, these were introduced in the 1.0 release of MaxScale. +The QLA filter has one mandatory parameter, `filebase`, and a number of optional parameters. These were introduced in the 1.0 release of MaxScale. ### Filebase -The basename of the output file created for each session. A session index is added to the filename for each file written. +The basename of the output file created for each session. A session index is added to the filename for each file written. This is a mandatory parameter. ``` filebase=/tmp/SqlQueryLog diff --git a/Filters/Top-N-Filter.md b/Filters/Top-N-Filter.md index 5920d9c6d..978f23aba 100644 --- a/Filters/Top-N-Filter.md +++ b/Filters/Top-N-Filter.md @@ -40,11 +40,11 @@ options=case,extended ## Filter Parameters -The top filter accepts a number of optional parameters. +The top filter has one mandatory parameter, `filebase`, and a number of optional parameters. ### Filebase -The basename of the output file created for each session. A session index is added to the filename for each file written. +The basename of the output file created for each session. A session index is added to the filename for each file written. This is a mandatory parameter. ``` filebase=/tmp/SqlQueryLog