From 8a1a4c91e444e42c871a631350a530f45adc6ff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 27 Jan 2017 05:21:30 +0200 Subject: [PATCH] Enable `disable_sescmd_history` by default The combination of the default values of `disable_sescmd_history=false` and `max_slave_connections=100%` does not make sense as it is not possible to find a replacement slave in case an active one fails. --- .../Release-Notes/MaxScale-2.1.0-Release-Notes.md | 7 +++++++ Documentation/Routers/ReadWriteSplit.md | 13 ++++++++++++- .../modules/routing/readwritesplit/readwritesplit.c | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) 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 88e38c41c..2676e7b1e 100644 --- a/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.1.0-Release-Notes.md @@ -22,6 +22,13 @@ Please see the [Configuration Guide](../Getting-Started/Configuration-Guide.md#configuration) for details. +### Readwritesplit `disable_sescmd_history` option + +The default value for `disable_sescmd_history` is now true. This new default +value will prevent the excessive memory use of long-lived connections. In +addition to this, it was not optimal to enable this option while the default +value for `max_slave_connections` was 100%, effectively making it useless. + ### Module configurations MaxScale 2.1 introduces a new directory for module configurations. This new diff --git a/Documentation/Routers/ReadWriteSplit.md b/Documentation/Routers/ReadWriteSplit.md index ebd862428..75bbe0120 100644 --- a/Documentation/Routers/ReadWriteSplit.md +++ b/Documentation/Routers/ReadWriteSplit.md @@ -110,7 +110,18 @@ When a limitation is set, it effectively creates a cap on the session's memory c ### `disable_sescmd_history` -**`disable_sescmd_history`** disables the session command history. This way no history is stored and if a slave server fails, the router will not try to replace the failed slave. Disabling session command history will allow connection pooling without causing a constant growth in the memory consumption. The session command history is enabled by default. +This option disables the session command history. This way no history is stored +and if a slave server fails, the router will not try to replace the failed +slave. Disabling session command history will allow long-lived connections +without causing a constant growth in the memory consumption. + +This option is only intended to be enabled if the value of +`max_slave_connections` is lowered below the default value. This will allow a +failed slave to be replaced with a standby slave server. + +In versions 2.0 and older, the session command history is enabled by +default. Starting with version 2.1, the session command history is disabled by +default. ``` # Disable the session command history diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index f5642c185..1a2374dc9 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -191,7 +191,7 @@ MXS_MODULE *MXS_CREATE_MODULE() {"max_slave_replication_lag", MXS_MODULE_PARAM_INT, "-1"}, {"max_slave_connections", MXS_MODULE_PARAM_STRING, MAX_SLAVE_COUNT}, {"retry_failed_reads", MXS_MODULE_PARAM_BOOL, "true"}, - {"disable_sescmd_history", MXS_MODULE_PARAM_BOOL, "false"}, + {"disable_sescmd_history", MXS_MODULE_PARAM_BOOL, "true"}, {"max_sescmd_history", MXS_MODULE_PARAM_COUNT, "0"}, {"strict_multi_stmt", MXS_MODULE_PARAM_BOOL, "true"}, {"master_accept_reads", MXS_MODULE_PARAM_BOOL, "false"},