svn commit: r444983 - in head/databases/galera: . files

Vasil Dimov vd at FreeBSD.org
Mon Jul 3 19:24:26 UTC 2017


Author: vd
Date: Mon Jul  3 19:24:25 2017
New Revision: 444983
URL: https://svnweb.freebsd.org/changeset/ports/444983

Log:
  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.

Added:
  head/databases/galera/files/patch-gcomm__src__asio_tcp.cpp   (contents, props changed)
Deleted:
  head/databases/galera/files/patch-SConstruct
  head/databases/galera/files/patch-galerautils__src__gu_asio.hpp
Modified:
  head/databases/galera/Makefile
  head/databases/galera/distinfo

Modified: head/databases/galera/Makefile
==============================================================================
--- head/databases/galera/Makefile	Mon Jul  3 19:19:00 2017	(r444982)
+++ head/databases/galera/Makefile	Mon Jul  3 19:24:25 2017	(r444983)
@@ -2,8 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	galera
-PORTVERSION?=	25.3.20
-PORTREVISION?=	2
+PORTVERSION?=	25.3.21
 CATEGORIES=	databases
 
 MAINTAINER=	devel at galeracluster.com
@@ -58,9 +57,12 @@ BPOSTATIC_DESC=	Use static boost_program_options
 
 .include <bsd.port.pre.mk>
 
-# 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_progra
 .endif
 
 .if ${PORT_OPTIONS:MDEBUG}
-MAKE_ARGS+=	debug=3
+MAKE_ARGS+=	debug=0
 .endif
 
 do-install:

Modified: head/databases/galera/distinfo
==============================================================================
--- head/databases/galera/distinfo	Mon Jul  3 19:19:00 2017	(r444982)
+++ head/databases/galera/distinfo	Mon Jul  3 19:24:25 2017	(r444983)
@@ -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

Added: head/databases/galera/files/patch-gcomm__src__asio_tcp.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/galera/files/patch-gcomm__src__asio_tcp.cpp	Mon Jul  3 19:24:25 2017	(r444983)
@@ -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<AsioProtonet> 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<asio::const_buffer, 2> 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<asio::const_buffer, 2> 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)


More information about the svn-ports-all mailing list