From d05a5336112f520378d1d2b21da73f4ef650289c Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 14 Feb 2017 12:01:14 +0200 Subject: [PATCH] Deprecate session specific log priorities They are not particularly useful, they surely are not used and impose a small cost for every event extracted from the poll sets. This commit only removes the maxadmin commands, subsequent commits will remove the actual code. --- .../MaxScale-2.2.0-Release-Notes.md | 59 ++++++++++++ server/modules/routing/debugcli/debugcmd.c | 90 ++----------------- 2 files changed, 65 insertions(+), 84 deletions(-) create mode 100644 Documentation/Release-Notes/MaxScale-2.2.0-Release-Notes.md diff --git a/Documentation/Release-Notes/MaxScale-2.2.0-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.2.0-Release-Notes.md new file mode 100644 index 000000000..cd0d09498 --- /dev/null +++ b/Documentation/Release-Notes/MaxScale-2.2.0-Release-Notes.md @@ -0,0 +1,59 @@ +# MariaDB MaxScale 2.2.0 Release Notes + +Release 2.2.0 is a Beta release. + +This document describes the changes in release 2.2.0, when compared to +release 2.1.X. + +For any problems you encounter, please consider submitting a bug +report at [Jira](https://jira.mariadb.org). + +## Changed Features + +### Blah + +## Dropped Features + +### MaxAdmin + +The following deprecated commands have been removed: + +* `enable log [debug|trace|message]` +* `disable log [debug|trace|message]` +* `enable sessionlog [debug|trace|message]` +* `disable sessionlog [debug|trace|message]` + +The following commands have been deprecated: + +* `enable sessionlog-priority [debug|info|notice|warning]` +* `disable sessionlog-priority [debug|info|notice|warning]` + +The commands can be issued, but have no effect. + +## New Features + +### Blah + +## Bug fixes + +[Here is a list of bugs fixed since the release of MaxScale 2.1.X.]() + +## 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 the Linux distributions supported +by MariaDB Enterprise. + +Packages can be downloaded [here](https://mariadb.com/resources/downloads). + +## Source Code + +The source code of MaxScale is tagged at GitHub with a tag, which is identical +with the version of MaxScale. For instance, the tag of version X.Y.Z of MaxScale +is X.Y.Z. Further, *master* always refers to the latest released non-beta version. + +The source code is available [here](https://github.com/mariadb-corporation/MaxScale). diff --git a/server/modules/routing/debugcli/debugcmd.c b/server/modules/routing/debugcli/debugcmd.c index 4a93bb415..100dc1dbd 100644 --- a/server/modules/routing/debugcli/debugcmd.c +++ b/server/modules/routing/debugcli/debugcmd.c @@ -653,9 +653,9 @@ struct subcommand enableoptions[] = "sessionlog-priority", 2, 2, enable_sess_log_priority, - "Enable a logging priority for a session", + "[Deprecated] Enable a logging priority for a session", "Usage: enable sessionlog-priority [err | warning | notice | info | debug] " - "message | debug] \t E.g. enable sessionlog-priority info 123.", + "\t E.g. enable sessionlog-priority info 123.", {ARG_TYPE_STRING, ARG_TYPE_STRING, 0} }, { @@ -724,9 +724,9 @@ struct subcommand disableoptions[] = "sessionlog-priority", 2, 2, disable_sess_log_priority, - "Disable a logging priority for a particular session", + "[Deprecated] Disable a logging priority for a particular session", "Usage: disable sessionlog-priority [err | warning | notice | info | debug] " - "message | debug] \t E.g. enable sessionlog-priority info 123", + "\t E.g. enable sessionlog-priority info 123", {ARG_TYPE_STRING, ARG_TYPE_STRING, 0} }, { @@ -2057,30 +2057,6 @@ struct log_action_entry const char* replacement; }; -bool seslog_cb(DCB *dcb, void *data) -{ - bool rval = true; - struct log_action_entry *entry = ((void**)data)[0]; - size_t *id = ((void**)data)[1]; - bool enable = (bool)((void**)data)[2]; - MXS_SESSION *session = dcb->session; - - if (session->ses_id == *id) - { - if (enable) - { - session_enable_log_priority(session, entry->priority); - } - else - { - session_disable_log_priority(session, entry->priority); - } - rval = false; - } - - return rval; -} - struct log_priority_entry { const char* name; @@ -2118,30 +2094,6 @@ static int string_to_priority(const char* name) return result ? result->priority : -1; } -bool sesprio_cb(DCB *dcb, void *data) -{ - bool rval = true; - int *priority = ((void**)data)[0]; - size_t *id = ((void**)data)[1]; - bool enable = (bool)((void**)data)[2]; - MXS_SESSION *session = dcb->session; - - if (session->ses_id == *id) - { - if (enable) - { - session_enable_log_priority(session, *priority); - } - else - { - session_disable_log_priority(session, *priority); - } - rval = false; - } - - return rval; -} - /** * Enables a log priority for a single session * @param session The session in question @@ -2150,22 +2102,7 @@ bool sesprio_cb(DCB *dcb, void *data) */ static void enable_sess_log_priority(DCB *dcb, char *arg1, char *arg2) { - int priority = string_to_priority(arg1); - - if (priority != -1) - { - size_t id = (size_t) strtol(arg2, NULL, 10); - void *data[] = {&priority, &id, (void*)true}; - - if (dcb_foreach(sesprio_cb, data)) - { - dcb_printf(dcb, "Session not found: %s.\n", arg2); - } - } - else - { - dcb_printf(dcb, "'%s' is not a supported log priority.\n", arg1); - } + MXS_WARNING("'enable sessionlog-priority' is deprecated."); } /** @@ -2176,22 +2113,7 @@ static void enable_sess_log_priority(DCB *dcb, char *arg1, char *arg2) */ static void disable_sess_log_priority(DCB *dcb, char *arg1, char *arg2) { - int priority = string_to_priority(arg1); - - if (priority != -1) - { - size_t id = (size_t) strtol(arg2, NULL, 10); - void *data[] = {&priority, &id, (void*)false}; - - if (dcb_foreach(seslog_cb, data)) - { - dcb_printf(dcb, "Session not found: %s.\n", arg2); - } - } - else - { - dcb_printf(dcb, "'%s' is not a supported log priority.\n", arg1); - } + MXS_WARNING("'disable sessionlog-priority' is deprecated."); } /**