diff --git a/BUILD/install_build_deps.sh b/BUILD/install_build_deps.sh index 804504a44..6f5f9bbde 100755 --- a/BUILD/install_build_deps.sh +++ b/BUILD/install_build_deps.sh @@ -66,6 +66,9 @@ else sqlite sqlite-devel pkgconfig lua lua-devel rpm-build createrepo yum-utils \ gnutls-devel libgcrypt-devel pam-devel + # Attempt to install libasan, it'll only work on CentOS 7 + sudo yum install -y --nogpgcheck libasan + cat /etc/redhat-release | grep "release 5" if [ $? == 0 ] then diff --git a/BUILD/mdbci/build.sh b/BUILD/mdbci/build.sh index a18c16f92..cbeb7d992 100755 --- a/BUILD/mdbci/build.sh +++ b/BUILD/mdbci/build.sh @@ -52,6 +52,12 @@ if [ "${try_already_running}" == "yes" ]; then fi if [ "$already_running" != "ok" ]; then + # destroying existing box + if [ -d "$MDBCI_VM_PATH/${name}" ]; then + ${mdbci_dir}/mdbci destroy $name + fi + # Just in case some old lock file left + rm -rf ${snapshot_lock_file} eval "cat <> ~/vagrant_lock - # destroying existing box - if [ -d "$MDBCI_VM_PATH/${name}" ]; then - ${mdbci_dir}/mdbci destroy $name - fi - # starting VM for build echo "Generating build VM template" ${mdbci_dir}/mdbci --override --template $MDBCI_VM_PATH/$name.json generate $name @@ -104,14 +105,11 @@ if [ $? -eq 0 ] ; then # exit 1 fi - ${script_dir}/create_remote_repo.sh - ${script_dir}/copy_repos.sh - echo "Removing locks and destroying VM" -cd $MDBCI_VM_PATH/$name + if [ "$try_already_running" == "yes" ] ; then echo "Release lock for already running VM" rm $snapshot_lock_file diff --git a/maxscale-system-test/CMakeLists.txt b/maxscale-system-test/CMakeLists.txt index 3431df9bb..88b2dc71e 100644 --- a/maxscale-system-test/CMakeLists.txt +++ b/maxscale-system-test/CMakeLists.txt @@ -632,6 +632,10 @@ add_test_executable(mxs1678_relay_master.cpp mxs1678_relay_master replication LA # https://jira.mariadb.org/browse/MXS-1713 add_test_executable(mxs1713_lots_of_databases.cpp mxs1713_lots_of_databases mxs1713_lots_of_databases LABELS REPL_BACKEND) +# MXS-1731: Empty version_string is not detected +# https://jira.mariadb.org/browse/MXS-1731 +add_test_executable(mxs1731_old_persisted_config.cpp mxs1731_old_persisted_config replication LABELS REPL_BACKEND) + # 'namedserverfilter' test add_test_executable(namedserverfilter.cpp namedserverfilter namedserverfilter LABELS namedserverfilter LIGHT REPL_BACKEND) diff --git a/maxscale-system-test/mxs1731_old_persisted_config.cpp b/maxscale-system-test/mxs1731_old_persisted_config.cpp new file mode 100644 index 000000000..38846ce1e --- /dev/null +++ b/maxscale-system-test/mxs1731_old_persisted_config.cpp @@ -0,0 +1,47 @@ +/** + * MXS-1731: Empty version_string is not detected + * + * https://jira.mariadb.org/browse/MXS-1731 + */ + +#include "testconnections.h" +#include +#include + +using std::cout; +using std::endl; + +int main(int argc, char** argv) +{ + TestConnections test(argc, argv); + const char* filename = "/tmp/RW-Split-Router.cnf"; + + { + std::ofstream cnf(filename); + cnf << "[RW-Split-Router]" << endl + << "type=service" << endl + << "version_string=" << endl; + } + + test.maxscales->copy_to_node_legacy(filename, filename); + test.maxscales->ssh_node_f(0, true, + "mkdir -p /var/lib/maxscale/maxscale.cnf.d/;" + "chown maxscale:maxscale /var/lib/maxscale/maxscale.cnf.d/;" + "cp %s /var/lib/maxscale/maxscale.cnf.d/RW-Split-Router.cnf", filename); + + test.maxscales->restart(); + test.check_maxscale_alive(); + + int rc = test.maxscales->ssh_node_f(0, true, "grep 'version_string' /var/lib/maxscale/maxscale.cnf.d/RW-Split-Router.cnf"); + test.assert(rc == 0, "Generated configuration should have version_string defined and MaxScale should ignore it."); + + test.maxscales->ssh_node_f(0, true, "maxadmin alter service RW-Split-Router enable_root_user=false"); + + test.maxscales->restart(); + test.check_maxscale_alive(); + + rc = test.maxscales->ssh_node_f(0, true, "grep 'version_string' /var/lib/maxscale/maxscale.cnf.d/RW-Split-Router.cnf"); + test.assert(rc != 0, "Generated configuration should not have version_string defined."); + + return test.global_result; +} diff --git a/maxscale-system-test/nodes.h b/maxscale-system-test/nodes.h index 81e373ad8..c19ac5575 100644 --- a/maxscale-system-test/nodes.h +++ b/maxscale-system-test/nodes.h @@ -132,7 +132,7 @@ public: * @param i Node index * @return exit code of the system command or 1 in case of i > N */ - int copy_to_node_legacy(const char* src, const char* dest, int i); + int copy_to_node_legacy(const char* src, const char* dest, int i = 0); int copy_to_node(int i, const char* src, const char* dest); /** diff --git a/maxscale-system-test/pers_02.cpp b/maxscale-system-test/pers_02.cpp index d626c6019..5d6eef6c8 100644 --- a/maxscale-system-test/pers_02.cpp +++ b/maxscale-system-test/pers_02.cpp @@ -30,8 +30,11 @@ int main(int argc, char *argv[]) Test->repl->close_connections(); Test->repl->sync_slaves(); - Test->set_timeout(60); + // Increase connection limits and wait a few seconds for the server to catch up Test->repl->execute_query_all_nodes((char *) "set global max_connections = 2000;"); + sleep(10); + + Test->set_timeout(60); Test->add_result(Test->create_connections(0, 70 , true, true, true, true), "Connections creation error \n"); diff --git a/server/core/config.cc b/server/core/config.cc index 4bc683fe3..a65d34b56 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -492,8 +492,19 @@ static int ini_handler(void *userdata, const char *section, const char *name, co if (is_empty_string(value)) { - MXS_ERROR("Empty value given to parameter '%s'", name); - return 0; + if (is_persisted_config) + { + /** + * Found old-style persisted configuration. These will be automatically + * upgraded on the next modification so we can safely ignore it. + */ + return 1; + } + else + { + MXS_ERROR("Empty value given to parameter '%s'", name); + return 0; + } } if (config_get_global_options()->substitute_variables) diff --git a/server/core/listener.cc b/server/core/listener.cc index 3b0332ee7..3f658478a 100644 --- a/server/core/listener.cc +++ b/server/core/listener.cc @@ -319,6 +319,9 @@ listener_init_SSL(SSL_LISTENER *ssl_listener) /** Disable SSLv3 */ SSL_CTX_set_options(ssl_listener->ctx, SSL_OP_NO_SSLv3); + // Disable session cache + SSL_CTX_set_session_cache_mode(ssl_listener->ctx, SSL_SESS_CACHE_OFF); + /** Generate the 512-bit and 1024-bit RSA keys */ if (rsa_512 == NULL && (rsa_512 = create_rsa(512)) == NULL) {