From 99d1ecd472213d67b047090ce872e5e740ffaa69 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Thu, 28 Nov 2019 16:10:57 +0200 Subject: [PATCH 1/3] More reliable way to determine package manager type during the build Checking presence of 'apt', 'yum' or 'zypper' command is not very reliable way to determine package manager type. E.g. OpenSUSE 25 has 'apt' which is wrapper over 'zypper' or rpm tools can be installed on Ubuntu. More relible way is to check /etc/*-release file and if it is not availabe try to check presence of apt, yum or zypper --- BUILD/install_build_deps.sh | 97 +++++++++++++++++++++++++++---------- 1 file changed, 72 insertions(+), 25 deletions(-) diff --git a/BUILD/install_build_deps.sh b/BUILD/install_build_deps.sh index d1e6184ec..ba35111b3 100755 --- a/BUILD/install_build_deps.sh +++ b/BUILD/install_build_deps.sh @@ -8,9 +8,56 @@ tmpdir=$(mktemp -d) cd $tmpdir -command -v apt-get +distro_id=`cat /etc/*-release | grep "^ID_LIKE=" | sed "s/ID=//"` -if [ $? == 0 ] +unset packager_type + +if [[ ${distro_id} =~ "suse" ]] +then + packager_type="zypper" +fi + +if [[ ${distro_id} =~ "rhel" ]] +then + packager_type="yum" +fi + +if [[ ${distro_id} =~ "debian" ]] +then + packager_type="apt" +fi + +if [[ ${packager_type} == "" ]] +then + command -v apt-get + + if [ $? == 0 ] + then + packager_type="apt" + fi + + command -v yum + + if [ $? == 0 ] + then + packager_type="yum" + fi + + command -v zypper + + if [ $? == 0 ] + then + packager_type="zypper" + fi +fi + +if [[ ${packager_type} == "" ]] +then + echo "Can not determine package manager type, exiting" + exit 1 +fi + +if [[ ${packager_type} == "apt" ]] then # DEB-based distro install_libdir=/usr/lib @@ -48,29 +95,11 @@ then sudo apt-get install -y --force-yes libgcrypt11-dev fi fi -else - ## RPM-based distro - install_libdir=/usr/lib64 - command -v yum +fi - if [ $? != 0 ] - then - # We need zypper here - sudo zypper -n refresh - sudo zypper -n update - sudo zypper -n install gcc gcc-c++ ncurses-devel bison glibc-devel libgcc_s1 perl \ - make libtool libopenssl-devel libaio libaio-devel flex \ - pcre-devel git wget tcl tcl-devel libuuid-devel \ - xz-devel sqlite3 sqlite3-devel pkg-config lua lua-devel \ - gnutls-devel libgcrypt-devel pam-devel systemd-devel - sudo zypper -n install rpm-build - cat /etc/*-release | grep "SUSE Linux Enterprise Server 11" - - if [ $? != 0 ] - then - sudo zypper -n install libedit-devel - fi - else +if [[ ${packager_type} == "yum" ]] +then + install_libdir=/usr/lib64 # YUM! sudo yum clean all sudo yum update -y @@ -111,8 +140,26 @@ else sudo sed -i 's/--selinux-enabled/--selinux-enabled=false/' /etc/sysconfig/docker sudo systemctl start docker fi - fi +fi +if [[ ${packager_type} == "zypper" ]] +then + install_libdir=/usr/lib64 + # We need zypper here + sudo zypper -n refresh + sudo zypper -n update + sudo zypper -n install gcc gcc-c++ ncurses-devel bison glibc-devel libgcc_s1 perl \ + make libtool libopenssl-devel libaio libaio-devel flex \ + pcre-devel git wget tcl tcl-devel libuuid-devel \ + xz-devel sqlite3 sqlite3-devel pkg-config lua lua-devel \ + gnutls-devel libgcrypt-devel pam-devel systemd-devel + sudo zypper -n install rpm-build + cat /etc/*-release | grep "SUSE Linux Enterprise Server 11" + + if [ $? != 0 ] + then + sudo zypper -n install libedit-devel + fi fi # cmake From 1e57c2cb67ce21417423e310069feccf0e5e6d80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 2 Dec 2019 07:40:47 +0200 Subject: [PATCH 2/3] MXS-2643: Mention Galera in causal_reads documentation causal_reads does not work with servers that update their state via mechanisms other than the standard replication. In practice this is just another Galera limitation. --- Documentation/Routers/ReadWriteSplit.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/Routers/ReadWriteSplit.md b/Documentation/Routers/ReadWriteSplit.md index 8858ee4ef..c0469d02e 100644 --- a/Documentation/Routers/ReadWriteSplit.md +++ b/Documentation/Routers/ReadWriteSplit.md @@ -487,6 +487,14 @@ modifications done by the client itself. addition to this, the `session_track_system_variables` parameter must be set to `last_gtid`. +**Note:** This feature does not work with Galera or any other non-standard + replication mechanisms. As Galera does not update the `gtid_slave_pos` + variable when events are replicated via the Galera library, the + [`MASTER_GTID_WAIT`](https://mariadb.com/kb/en/library/master_gtid_wait/) + function used by MaxScale to synchronize reads will wait until the + timeout. With Galera this is not a serious issue as it, by nature, is a + mostly-synchronous replication mechanism. + A practical example can be given by the following set of SQL commands executed with `autocommit=1`. From 255071efcebe763ddb836ceb3784f19a2581d5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 2 Dec 2019 08:29:08 +0200 Subject: [PATCH 3/3] Add version to show servers output This was missing in maxctrl but it was present in maxadmin. --- maxctrl/lib/show.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maxctrl/lib/show.js b/maxctrl/lib/show.js index 33ac2a07a..aacce5d84 100644 --- a/maxctrl/lib/show.js +++ b/maxctrl/lib/show.js @@ -34,6 +34,11 @@ const server_fields = [ path: 'attributes.state', description: 'Server state' }, + { + name: 'Version', + path: 'attributes.version_string', + description: 'Server version' + }, { name: 'Last Event', path: 'attributes.last_event',