From b619fb0707486acdab67c290a005ce43bbe3acd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 5 Mar 2018 18:57:29 +0200 Subject: [PATCH 1/5] MXS-1699: Log progress messages at startup When MaxScale is starting, the loading of the listeners can take a while if there are a large number of services and users to load. To signal this to the user, progress messages should be logged after every service is started. --- server/core/service.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/core/service.c b/server/core/service.c index 8fb3a2dc5..1e0e04e3d 100644 --- a/server/core/service.c +++ b/server/core/service.c @@ -629,10 +629,20 @@ int service_launch_all() config_enable_feedback_task(); + int num_svc = 0; + for (ptr = allServices; ptr; ptr = ptr->next) + { + num_svc++; + } + + MXS_NOTICE("Starting a total of %d services...", num_svc); + + int curr_svc = 1; ptr = allServices; while (ptr && !ptr->svc_do_shutdown) { n += (i = serviceInitialize(ptr)); + MXS_NOTICE("Service '%s' started (%d/%d)", ptr->name, curr_svc++, num_svc); if (i == 0) { From 82839abc38017d6f6560aff60dbcceeb66526e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 5 Mar 2018 19:04:24 +0200 Subject: [PATCH 2/5] Increase timeouts and add maxadmin output to mxs1476 Increasing the timeout should remove any issues with server lag and printing the maxadmin output should help diagnose the problem if it still fails. --- maxscale-system-test/mxs1476.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/maxscale-system-test/mxs1476.cpp b/maxscale-system-test/mxs1476.cpp index f7347bdf9..dc37654be 100644 --- a/maxscale-system-test/mxs1476.cpp +++ b/maxscale-system-test/mxs1476.cpp @@ -6,6 +6,13 @@ #include "testconnections.h" +void list_servers(TestConnections& test) +{ + char *output = test.ssh_maxscale_output(true, "maxadmin list servers"); + test.tprintf("%s", output); + free(output); +} + void do_test(TestConnections& test, int master, int slave) { test.connect_maxscale(); @@ -15,24 +22,28 @@ void do_test(TestConnections& test, int master, int slave) test.tprintf("Stop a slave node and perform an insert"); test.galera->block_node(slave); - sleep(5); + sleep(10); + list_servers(test); test.try_query(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)"); test.tprintf("Start the slave node and perform another insert"); test.galera->unblock_node(slave); - sleep(5); + sleep(10); + list_servers(test); test.try_query(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)"); test.close_maxscale_connections(); test.tprintf("Stop the master node and perform an insert"); test.galera->block_node(master); - sleep(5); + sleep(10); + list_servers(test); test.connect_maxscale(); test.try_query(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)"); test.tprintf("Start the master node and perform another insert (expecting failure)"); test.galera->unblock_node(master); - sleep(5); + sleep(10); + list_servers(test); test.add_result(execute_query_silent(test.conn_rwsplit, "INSERT INTO test.t1 VALUES (1)") == 0, "Query should fail"); test.close_maxscale_connections(); From 2fa8c91297828cd210cacc19db5a17fff3912f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 6 Mar 2018 11:34:36 +0200 Subject: [PATCH 3/5] Update Travis build script The actual build scripts for MaxScale are now used to prepare the build environment. This should make the Travis CI build easier to maintain. --- .travis/build_maxscale.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis/build_maxscale.sh b/.travis/build_maxscale.sh index 916b8d37c..153ccb6e3 100644 --- a/.travis/build_maxscale.sh +++ b/.travis/build_maxscale.sh @@ -9,14 +9,17 @@ echo TRAVIS_BUILD_DIR: ${TRAVIS_BUILD_DIR} +# Configure the build environment +./BUILD/install_build_deps.sh + mkdir build cd build -cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=Y -DBUILD_AVRO=N +cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=Y make -make test -sudo make install +make test || exit 1 +sudo make install sudo ./postinst maxscale --version From 49864b64c0a2b060af1226bf16f7742f123dfd6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 6 Mar 2018 11:47:19 +0200 Subject: [PATCH 4/5] Make install scripts less verbose We don't need to know the contents of the tarballs on each build. --- BUILD/install_build_deps.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BUILD/install_build_deps.sh b/BUILD/install_build_deps.sh index 6ab74f973..942459dbc 100755 --- a/BUILD/install_build_deps.sh +++ b/BUILD/install_build_deps.sh @@ -58,18 +58,18 @@ else fi # cmake -wget http://max-tst-01.mariadb.com/ci-repository/cmake-3.7.1-Linux-x86_64.tar.gz --no-check-certificate +wget -q http://max-tst-01.mariadb.com/ci-repository/cmake-3.7.1-Linux-x86_64.tar.gz --no-check-certificate if [ $? != 0 ] ; then echo "CMake can not be downloaded from Maxscale build server, trying from cmake.org" - wget https://cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.tar.gz --no-check-certificate + wget -q https://cmake.org/files/v3.7/cmake-3.7.1-Linux-x86_64.tar.gz --no-check-certificate fi -sudo tar xzvf cmake-3.7.1-Linux-x86_64.tar.gz -C /usr/ --strip-components=1 +sudo tar xzf cmake-3.7.1-Linux-x86_64.tar.gz -C /usr/ --strip-components=1 cmake_version=`cmake --version | grep "cmake version" | awk '{ print $3 }'` if [ "$cmake_version" \< "3.7.1" ] ; then echo "cmake does not work! Trying to build from source" - wget https://cmake.org/files/v3.7/cmake-3.7.1.tar.gz --no-check-certificate - tar xzvf cmake-3.7.1.tar.gz + wget -q https://cmake.org/files/v3.7/cmake-3.7.1.tar.gz --no-check-certificate + tar xzf cmake-3.7.1.tar.gz cd cmake-3.7.1 ./bootstrap @@ -98,7 +98,7 @@ cd ../../ # TCL mkdir tcl cd tcl -wget --no-check-certificate http://prdownloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz +wget -q --no-check-certificate http://prdownloads.sourceforge.net/tcl/tcl8.6.5-src.tar.gz if [ $? != 0 ] then @@ -106,7 +106,7 @@ then exit 1 fi -tar xzvf tcl8.6.5-src.tar.gz +tar xzf tcl8.6.5-src.tar.gz cd tcl8.6.5/unix ./configure sudo make install @@ -131,7 +131,7 @@ sudo make install cd ../../ # Avro C API -wget -r -l1 -nH --cut-dirs=2 --no-parent -A.tar.gz --no-directories http://mirror.netinch.com/pub/apache/avro/stable/c +wget -q -r -l1 -nH --cut-dirs=2 --no-parent -A.tar.gz --no-directories http://mirror.netinch.com/pub/apache/avro/stable/c if [ $? != 0 ] then echo "Error getting avro-c" From 0a4bb6fe7aab065847b5a263d84e13cbd273fa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 6 Mar 2018 12:53:37 +0200 Subject: [PATCH 5/5] MXS-1697: Install pkg-config for Debian systems The build scripts did not install the pkg-config package that the Avro-C API depends on. --- BUILD/install_build_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD/install_build_deps.sh b/BUILD/install_build_deps.sh index 942459dbc..73a4eccd4 100755 --- a/BUILD/install_build_deps.sh +++ b/BUILD/install_build_deps.sh @@ -15,7 +15,7 @@ then sudo apt-get install -y --force-yes dpkg-dev git gcc g++ ncurses-dev bison \ build-essential libssl-dev libaio-dev perl make libtool libcurl4-openssl-dev \ libpcre3-dev flex tcl libeditline-dev uuid-dev liblzma-dev libsqlite3-dev \ - sqlite3 liblua5.1 liblua5.1-dev wget zlib1g-dev + sqlite3 liblua5.1 liblua5.1-dev wget zlib1g-dev pkg-config else ## RPM-based distro