From 940e6e7742c608400234dd7864c429fa925d447d Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 3 Jul 2017 19:24:25 +0000 Subject: databases/galera: Upgrade from 25.3.20 to 25.3.21 Also fixup the debug build - the setting provided as debug=N translates to cc -ON. So, for debug build it should be debug=0. --- databases/galera/Makefile | 14 +-- databases/galera/distinfo | 6 +- databases/galera/files/patch-SConstruct | 68 ------------ .../files/patch-galerautils__src__gu_asio.hpp | 22 ---- .../galera/files/patch-gcomm__src__asio_tcp.cpp | 115 +++++++++++++++++++++ 5 files changed, 126 insertions(+), 99 deletions(-) delete mode 100644 databases/galera/files/patch-SConstruct delete mode 100644 databases/galera/files/patch-galerautils__src__gu_asio.hpp create mode 100644 databases/galera/files/patch-gcomm__src__asio_tcp.cpp diff --git a/databases/galera/Makefile b/databases/galera/Makefile index bb6c4dcb3f4f..68824a74d385 100644 --- a/databases/galera/Makefile +++ b/databases/galera/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= galera -PORTVERSION?= 25.3.20 -PORTREVISION?= 2 +PORTVERSION?= 25.3.21 CATEGORIES= databases MAINTAINER= devel@galeracluster.com @@ -58,9 +57,12 @@ BPOSTATIC_DESC= Use static boost_program_options .include -# COMPILER_TYPE could be empty on older FreeBSD versions. -.if "${COMPILER_TYPE}" == gcc || ${OSVERSION} < 1000000 -USE_GCC= 4.8+ +# Clang is available on FreeBSD 9.x but the default +# compiler (e.g. /usr/bin/cc) is GCC. Force the usage of Clang. +.if ${OSVERSION} < 1000024 +CC= clang +CXX= clang++ +CPP= clang-cpp .endif .if ${PORT_OPTIONS:MBOOSTPOOL} @@ -72,7 +74,7 @@ MAKE_ARGS+= bpostatic=${LOCALBASE}/lib/libboost_program_options.a .endif .if ${PORT_OPTIONS:MDEBUG} -MAKE_ARGS+= debug=3 +MAKE_ARGS+= debug=0 .endif do-install: diff --git a/databases/galera/distinfo b/databases/galera/distinfo index 8edf74bc3607..06ada66bc168 100644 --- a/databases/galera/distinfo +++ b/databases/galera/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1495385457 -SHA256 (codership-galera-25.3.20-release_25.3.20_GH0.tar.gz) = bcfe8cc188b19a9dec2c4c07d09c53ea8b2d4dd0479d412d82528583f6c91310 -SIZE (codership-galera-25.3.20-release_25.3.20_GH0.tar.gz) = 3271813 +TIMESTAMP = 1499109333 +SHA256 (codership-galera-25.3.21-release_25.3.21_GH0.tar.gz) = dc0d8e9bcbd16de98c3ee558f7e7e2cf4596670a2e2e38a03d3e45bf5c9ebd5e +SIZE (codership-galera-25.3.21-release_25.3.21_GH0.tar.gz) = 3276033 diff --git a/databases/galera/files/patch-SConstruct b/databases/galera/files/patch-SConstruct deleted file mode 100644 index 56631051f81e..000000000000 --- a/databases/galera/files/patch-SConstruct +++ /dev/null @@ -1,68 +0,0 @@ ---- SConstruct.orig 2017-01-25 07:55:06 UTC -+++ SConstruct -@@ -28,6 +28,7 @@ - import os - import platform - import string -+import subprocess - - sysname = os.uname()[0].lower() - machine = platform.machine() -@@ -182,10 +183,10 @@ env.Replace(RPATH = [os.getenv('RPAT - # enabled on all platforms. - env.Append(CCFLAGS = ' -pthread') - --# Freebsd ports are installed under /usr/local -+# FreeBSD ports are usually installed under /usr/local - if sysname == 'freebsd' or sysname == 'sunos': -- env.Append(LIBPATH = ['/usr/local/lib']) -- env.Append(CPPFLAGS = ' -I/usr/local/include ') -+ env.Append(LIBPATH = ['/usr/local/lib']) -+ env.Append(CPPPATH = ['/usr/local/include']) - if sysname == 'sunos': - env.Replace(SHLINKFLAGS = '-shared ') - -@@ -418,8 +419,10 @@ else: - print "Falling back to bundled asio" - - if not system_asio: -- # Fall back to embedded asio -- conf.env.Append(CPPPATH = [ '#/asio' ]) -+ # Make sure that -Iasio goes before other paths (e.g. -I/usr/local/include) -+ # that may contain a system wide installed asio. We should use the bundled -+ # asio if "scons system_asio=0" is specified. Thus use Prepend(). -+ conf.env.Prepend(CPPPATH = [ '#/asio' ]) - if conf.CheckCXXHeader('asio.hpp'): - conf.env.Append(CPPFLAGS = ' -DHAVE_ASIO_HPP') - else: -@@ -442,17 +445,26 @@ if ssl == 1: - Exit(1) - - --# these will be used only with our softaware -+# get compiler name/version, CXX may be set to "c++" which may be clang or gcc -+try: -+ compiler_version = subprocess.check_output([conf.env['CXX'], '--version'], -+ stderr=subprocess.STDOUT) -+except: -+ # in case "$CXX --version" returns an error, e.g. "unknown option" -+ compiler_version = 'unknown' -+ -+# these will be used only with our software - if strict_build_flags == 1: - conf.env.Append(CCFLAGS = ' -Werror -pedantic') -- if 'clang' not in conf.env['CXX']: -- conf.env.Prepend(CXXFLAGS = '-Weffc++ -Wold-style-cast ') -- else: -+ if 'clang' in compiler_version: - conf.env.Append(CCFLAGS = ' -Wno-self-assign') - conf.env.Append(CCFLAGS = ' -Wno-gnu-zero-variadic-macro-arguments') - conf.env.Append(CXXFLAGS = ' -Wno-variadic-macros') -+ # CXX may be something like "ccache clang++" - if 'ccache' in conf.env['CXX']: - conf.env.Append(CCFLAGS = ' -Qunused-arguments') -+ else: -+ conf.env.Prepend(CXXFLAGS = '-Weffc++ -Wold-style-cast ') - - env = conf.Finish() - diff --git a/databases/galera/files/patch-galerautils__src__gu_asio.hpp b/databases/galera/files/patch-galerautils__src__gu_asio.hpp deleted file mode 100644 index 85bcdd5c58d9..000000000000 --- a/databases/galera/files/patch-galerautils__src__gu_asio.hpp +++ /dev/null @@ -1,22 +0,0 @@ ---- galerautils/src/gu_asio.hpp.orig 2017-01-25 07:55:06 UTC -+++ galerautils/src/gu_asio.hpp -@@ -32,6 +32,19 @@ - #endif // __GNUG__ - #endif // ! HAVE_SYSTEM_ASIO - -+#ifdef ASIO_HPP -+#error asio.hpp is already included before gu_asio.hpp, can't customize asio.hpp -+#endif // ASIO_HPP -+ -+#include "asio/version.hpp" -+ -+// ASIO does not interact well with kqueue before ASIO 1.10.5, see -+// https://readlist.com/lists/freebsd.org/freebsd-current/23/119264.html -+// http://think-async.com/Asio/asio-1.10.6/doc/asio/history.html#asio.history.asio_1_10_5 -+#if ASIO_VERSION < 101005 -+# define ASIO_DISABLE_KQUEUE -+#endif // ASIO_VERSION < 101005 -+ - #include "asio.hpp" - #include "asio/ssl.hpp" - diff --git a/databases/galera/files/patch-gcomm__src__asio_tcp.cpp b/databases/galera/files/patch-gcomm__src__asio_tcp.cpp new file mode 100644 index 000000000000..2f641dd9972f --- /dev/null +++ b/databases/galera/files/patch-gcomm__src__asio_tcp.cpp @@ -0,0 +1,115 @@ +--- gcomm/src/asio_tcp.cpp.orig 2017-01-25 07:55:06 UTC ++++ gcomm/src/asio_tcp.cpp +@@ -231,10 +231,18 @@ void gcomm::AsioTcpSocket::close() + } + } + ++// Enable to introduce random errors for write handler ++// #define GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR + + void gcomm::AsioTcpSocket::write_handler(const asio::error_code& ec, + size_t bytes_transferred) + { ++#ifdef GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ static const long empty_rate(10000); ++ static const long bytes_transferred_less_than_rate(10000); ++ static const long bytes_transferred_not_zero_rate(10000); ++#endif // GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ + Critical crit(net_); + + if (state() != S_CONNECTED && state() != S_CLOSING) +@@ -252,34 +260,70 @@ void gcomm::AsioTcpSocket::write_handler + + if (!ec) + { +- gcomm_assert(send_q_.empty() == false); +- gcomm_assert(send_q_.front().len() >= bytes_transferred); +- +- while (send_q_.empty() == false && +- bytes_transferred >= send_q_.front().len()) ++ if (send_q_.empty() == true ++#ifdef GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ || ::rand() % empty_rate == 0 ++#endif // GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ ) + { +- const Datagram& dg(send_q_.front()); +- bytes_transferred -= dg.len(); +- send_q_.pop_front(); ++ log_warn << "write_handler() called with empty send_q_. " ++ << "Transport may not be reliable, closing the socket"; ++ FAILED_HANDLER(asio::error_code(EPROTO, ++ asio::error::system_category)); + } +- gcomm_assert(bytes_transferred == 0); +- +- if (send_q_.empty() == false) ++ else if (send_q_.front().len() < bytes_transferred ++#ifdef GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ || ::rand() % bytes_transferred_less_than_rate == 0 ++#endif // GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ ) + { +- const Datagram& dg(send_q_.front()); +- boost::array cbs; +- cbs[0] = asio::const_buffer(dg.header() +- + dg.header_offset(), +- dg.header_len()); +- cbs[1] = asio::const_buffer(&dg.payload()[0], +- dg.payload().size()); +- write_one(cbs); ++ log_warn << "write_handler() bytes_transferred " ++ << bytes_transferred ++ << " less than sent " ++ << send_q_.front().len() ++ << ". Transport may not be reliable, closing the socket"; ++ FAILED_HANDLER(asio::error_code(EPROTO, ++ asio::error::system_category)); + } +- else if (state_ == S_CLOSING) ++ else + { +- log_debug << "deferred close of " << id(); +- close_socket(); +- state_ = S_CLOSED; ++ while (send_q_.empty() == false && ++ bytes_transferred >= send_q_.front().len()) ++ { ++ const Datagram& dg(send_q_.front()); ++ bytes_transferred -= dg.len(); ++ send_q_.pop_front(); ++ } ++ if (bytes_transferred != 0 ++#ifdef GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ || ::rand() % bytes_transferred_not_zero_rate == 0 ++#endif // GCOMM_ASIO_TCP_SIMULATE_WRITE_HANDLER_ERROR ++ ) ++ { ++ log_warn << "write_handler() bytes_transferred " ++ << bytes_transferred ++ << " after processing the send_q_. " ++ << "Transport may not be reliable, closing the socket"; ++ FAILED_HANDLER(asio::error_code(EPROTO, ++ asio::error::system_category)); ++ } ++ else if (send_q_.empty() == false) ++ { ++ const Datagram& dg(send_q_.front()); ++ boost::array cbs; ++ cbs[0] = asio::const_buffer(dg.header() ++ + dg.header_offset(), ++ dg.header_len()); ++ cbs[1] = asio::const_buffer(&dg.payload()[0], ++ dg.payload().size()); ++ write_one(cbs); ++ } ++ else if (state_ == S_CLOSING) ++ { ++ log_debug << "deferred close of " << id(); ++ close_socket(); ++ state_ = S_CLOSED; ++ } + } + } + else if (state_ == S_CLOSING) -- cgit v1.2.3