diff --git a/Documentation/REST-API/Resources-Service.md b/Documentation/REST-API/Resources-Service.md index 38f22e8f3..62f6dfabf 100644 --- a/Documentation/REST-API/Resources-Service.md +++ b/Documentation/REST-API/Resources-Service.md @@ -375,41 +375,7 @@ GET /v1/services/:name/listeners } ``` -### Get service listeners - -Get the listeners of a service. The _:name_ in the URI must be a valid service -name with all whitespace replaced with hyphens. - -``` -GET /v1/services/:name/listeners -``` - -#### Response - -`Status: 200 OK` - -```javascript -{ - "links": { - "self": "http://localhost:8989/v1/services/Read-Connection-Router/listeners" - }, - "data": [ - { - "attributes": { - "parameters": { - "port": 4008, - "protocol": "MariaDBClient", - "authenticator": "MySQLAuth" - } - }, - "id": "Read-Connection-Listener", - "type": "listeners" - } - ] -} -``` - -### Get a sigle service listener +### Get a single service listener Get the listeners of a service. The _:name_ in the URI must be a valid service name and _:listener_ must be a valid listener name, both with all whitespace diff --git a/VERSION21.cmake b/VERSION21.cmake index 0df03b735..581050975 100644 --- a/VERSION21.cmake +++ b/VERSION21.cmake @@ -5,7 +5,7 @@ set(MAXSCALE_VERSION_MAJOR "2" CACHE STRING "Major version") set(MAXSCALE_VERSION_MINOR "1" CACHE STRING "Minor version") -set(MAXSCALE_VERSION_PATCH "17" CACHE STRING "Patch version") +set(MAXSCALE_VERSION_PATCH "18" CACHE STRING "Patch version") # This should only be incremented if a package is rebuilt set(MAXSCALE_BUILD_NUMBER 1 CACHE STRING "Release number") diff --git a/cmake/init_scripts.cmake b/cmake/init_scripts.cmake index 23ab7b8e5..83f8dd138 100644 --- a/cmake/init_scripts.cmake +++ b/cmake/init_scripts.cmake @@ -10,7 +10,7 @@ elseif(EXISTS ${SLES_FNC}) elseif(EXISTS ${DEB_FNC}) set(USE_DEB TRUE CACHE BOOL "If init.d script uses /lib/lsb/init-functions instead of /etc/rc.d/init.d/functions.") else() - message(FATAL_ERROR "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, please confirm that your system files are OK.") + message(STATUS "Cannot find required init-functions in /lib/lsb/ or /etc/rc.d/init.d/, will not install init scripts.") endif() if(USE_DEB) @@ -18,7 +18,10 @@ if(USE_DEB) elseif(USE_RPM) configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) elseif(USE_SLES) - configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) + configure_file(${CMAKE_SOURCE_DIR}/etc/sles11/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) +else() + # Use a dummy file that tells the user that init scripts aren't supported on this platform + configure_file(${CMAKE_SOURCE_DIR}/etc/fallback/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY) endif() configure_file(${CMAKE_SOURCE_DIR}/etc/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY) diff --git a/etc/fallback/maxscale.in b/etc/fallback/maxscale.in new file mode 100755 index 000000000..2b368861e --- /dev/null +++ b/etc/fallback/maxscale.in @@ -0,0 +1,4 @@ +#!/bin/sh + +echo "Init scripts are not supported on this platform, use either systemd or launch MaxScale manually" +exit 1 diff --git a/maxscale-system-test/mxs1743_rconn_bitmask.cpp b/maxscale-system-test/mxs1743_rconn_bitmask.cpp index 4543e37cd..237237b50 100644 --- a/maxscale-system-test/mxs1743_rconn_bitmask.cpp +++ b/maxscale-system-test/mxs1743_rconn_bitmask.cpp @@ -10,28 +10,31 @@ int main(int argc, char** argv) { TestConnections test(argc, argv); + auto do_test = [&]() + { + test.set_timeout(20); + test.maxscales->connect(); + test.try_query(test.maxscales->conn_master[0], "SELECT 1"); + test.maxscales->disconnect(); + test.stop_timeout(); + }; + test.tprintf("Testing with both master and slave up"); - test.maxscales->connect(); - test.try_query(test.maxscales->conn_master[0], "SELECT 1"); - test.maxscales->disconnect(); + do_test(); test.tprintf("Testing with only the master"); test.repl->block_node(0); - sleep(5); - test.maxscales->connect(); - test.try_query(test.maxscales->conn_master[0], "SELECT 1"); - test.maxscales->disconnect(); + test.maxscales->wait_for_monitor(); + do_test(); test.repl->unblock_node(0); - sleep(5); + test.maxscales->wait_for_monitor(); test.tprintf("Testing with only the slave"); test.repl->block_node(1); - sleep(5); - test.maxscales->connect(); - test.try_query(test.maxscales->conn_master[0], "SELECT 1"); - test.maxscales->disconnect(); + test.maxscales->wait_for_monitor(); + do_test(); test.repl->unblock_node(1); - sleep(5); + test.maxscales->wait_for_monitor(); test.tprintf("Checking that both the master and slave are used"); std::vector connections; @@ -45,10 +48,12 @@ int main(int argc, char** argv) for (int i = 0; i < 20; i++) { // Open a connection and make sure it works + test.set_timeout(20); MYSQL* conn = open_conn(test.maxscales->readconn_master_port[0], test.maxscales->IP[0], "mxs1743", "mxs1743", false); test.try_query(conn, "SELECT 1"); connections.push_back(conn); + test.stop_timeout(); } // Give the connections a few seconds to establish diff --git a/server/modules/monitor/auroramon/auroramon.cc b/server/modules/monitor/auroramon/auroramon.cc index b4bf1e6c8..ed053de5e 100644 --- a/server/modules/monitor/auroramon/auroramon.cc +++ b/server/modules/monitor/auroramon/auroramon.cc @@ -73,7 +73,7 @@ void AuroraMonitor::update_server_status(MXS_MONITORED_SERVER* monitored_server) int status = SERVER_SLAVE; /** The master will return a row with two identical non-NULL fields */ - if (row[0] && row[1] && strcmp(row[0], row[1]) == 0) + if (row && row[0] && row[1] && strcmp(row[0], row[1]) == 0) { status = SERVER_MASTER; }