Merge branch '2.2' into develop

This commit is contained in:
Johan Wikman 2018-05-21 10:06:20 +03:00
commit 2e8c19f6be
4 changed files with 36 additions and 6 deletions

View File

@ -1,4 +1,4 @@
# MariaDB MaxScale 2.2.6 Release Notes -- 2018-05
# MariaDB MaxScale 2.2.6 Release Notes -- 2018-05-21
Release 2.2.6 is a GA release.
@ -8,9 +8,18 @@ release 2.2.5.
For any problems you encounter, please consider submitting a bug
report at [Jira](https://jira.mariadb.org).
## New Features
* It is now possible to configure the MariaDB Monitor to turn
on the read_only flag of a server it deems is a slave.
## Bug fixes
* [MXS-1874](https://jira.mariadb.org/browse/MXS-1874) SET STATEMENT ... FOR is wrongly classified
* [MXS-1873](https://jira.mariadb.org/browse/MXS-1873) Errors with large session commands
* [MXS-1866](https://jira.mariadb.org/browse/MXS-1866) Prepared statements do not work
* [MXS-1861](https://jira.mariadb.org/browse/MXS-1861) masking filter logs warnings with multistatements
* [MXS-1852](https://jira.mariadb.org/browse/MXS-1852) mysql_client_test test_bug17309863 failed
* [MXS-1847](https://jira.mariadb.org/browse/MXS-1847) Race condition in server_get_parameter
* [MXS-1846](https://jira.mariadb.org/browse/MXS-1846) Wrong packet number in KILL command error
* [MXS-1843](https://jira.mariadb.org/browse/MXS-1843) Sporadic test_logthrottling failures on Ubuntu

View File

@ -154,6 +154,30 @@ reported by the server itself.
`LEAST_BEHIND_MASTER` does not take server weights into account when choosing a
server.
#### Server Weights and `slave_selection_criteria`
The following formula is used to calculate a score for a server when the
`weightby` parameter is defined.
```
score = x / w
```
`x` is the absolute value of the chosen metric (queries, connections) and
`w` is the weight of the server. The value of `w` is the relative weight
of the server in relation to all the servers configured for the
service. The server with the highest score that fulfills all other
criteria is chosen as the target server.
Read the [configuration guide](../Getting-Started/Configuration-Guide.md#weightby)
for a more detailed example on how the weights are calculated.
For `LEAST_CURRENT_OPERATIONS`, the metric is number of active queries on
the candidate server, for `LEAST_GLOBAL_CONNECTIONS` and
`LEAST_ROUTER_CONNECTIONS` it is the number of open connections and for
`LEAST_BEHIND_MASTER` it is the number of seconds a server is behind the
master.
#### Interaction Between `slave_selection_criteria` and `max_slave_connections`
Depending on the value of `max_slave_connections`, the slave selection criteria

View File

@ -15,7 +15,6 @@ endfunction()
# test set, the function should be called as follows:
# add_test_executable(simple_test.cpp simple_test simple_config LABELS some_label)
function(add_test_executable source name template)
file(APPEND templates "${name} ${template}\n")
add_template(${name} ${template})
add_executable(${name} ${source})
target_link_libraries(${name} testcore)
@ -31,7 +30,6 @@ endfunction()
# Same as add_test_executable, but do not add executable into tests list
function(add_test_executable_notest source name template)
file(APPEND templates "${name} ${template}\n")
add_template(${name} ${template})
add_executable(${name} ${source})
target_link_libraries(${name} testcore)
@ -39,7 +37,6 @@ endfunction()
# Add a test which uses another test as the executable
function(add_test_derived name executable template)
file(APPEND templates "${name} ${template}\n")
add_template(${name} ${template})
add_test(NAME ${name} COMMAND ${CMAKE_BINARY_DIR}/${executable} ${name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
@ -55,7 +52,6 @@ endfunction()
# The naming of the templates follow the same principles as add_test_executable.
# also suitable for symlinks
function(add_test_script name script template labels)
file(APPEND templates "${name} ${template}\n")
add_template(${name} ${template})
add_test(NAME ${name} COMMAND ${CMAKE_SOURCE_DIR}/${script} ${name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

View File

@ -58,7 +58,8 @@ static bool get_hostname(DCB *dcb, char *client_hostname, size_t size);
static char* get_new_users_query(const char *server_version, bool include_root)
{
const char* password = strstr(server_version, "5.7.") ? MYSQL57_PASSWORD : MYSQL_PASSWORD;
const char* password = strstr(server_version, "5.7.") || strstr(server_version, "8.0.")
? MYSQL57_PASSWORD : MYSQL_PASSWORD;
const char *with_root = include_root ? "" : " AND u.user NOT IN ('root')";
size_t n_bytes = snprintf(NULL, 0, NEW_LOAD_DBUSERS_QUERY, password, with_root, password, with_root);