From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jun 25 13:30:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B583D1065678 for ; Thu, 25 Jun 2009 13:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 924BD8FC1F for ; Thu, 25 Jun 2009 13:30:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n5PDU2nv074958 for ; Thu, 25 Jun 2009 13:30:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n5PDU2RU074957; Thu, 25 Jun 2009 13:30:02 GMT (envelope-from gnats) Resent-Date: Thu, 25 Jun 2009 13:30:02 GMT Resent-Message-Id: <200906251330.n5PDU2RU074957@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alexey V.Degtyarev" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 985C4106566C for ; Thu, 25 Jun 2009 13:22:36 +0000 (UTC) (envelope-from root@undeliverable.renatasystems.org) Received: from hs-9.renatasystems.org (hs-9.renatasystems.org [83.222.5.149]) by mx1.freebsd.org (Postfix) with SMTP id B120E8FC08 for ; Thu, 25 Jun 2009 13:22:35 +0000 (UTC) (envelope-from root@undeliverable.renatasystems.org) Received: (qmail 66382 invoked by uid 0); 25 Jun 2009 17:22:33 +0400 Message-Id: <20090625132233.66381.qmail@hs-9.renatasystems.org> Date: 25 Jun 2009 17:22:33 +0400 From: "Alexey V.Degtyarev" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/136028: databases/mysql-proxy - allow multiple backend addresses with mysql-proxy startup script X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "Alexey V.Degtyarev" List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2009 13:30:03 -0000 >Number: 136028 >Category: ports >Synopsis: databases/mysql-proxy - allow multiple backend addresses with mysql-proxy startup script >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jun 25 13:30:01 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Alexey V. Degtyarev >Release: FreeBSD 7.1-RELEASE amd64 >Organization: >Environment: System: FreeBSD renatasystems.org 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1 08:58:24 UTC 2009 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Current mysql-proxy.sh startup script does not allow use of multiple MySQL backends due to lack of $mysql_proxy_backend_addresses variable processing. According to documentation[1] of --proxy-backend-addresses option, it is possible to specify multiple backend servers by supplying multiple options. But mysql-proxy.sh just assigns the value of $mysql_proxy_backend_addresses variable to this option. The patch allows to use multiple MySQL backend servers by specifying multiple --proxy-backend-addresses options for each host:port pair in $mysql_proxy_backend_addresses variable to mysql-proxy command arguments line. Example of usage: rc.conf: mysql_proxy_enable="yes" mysql_proxy_backend_addresses="10.10.155.201:3306 10.10.155.202:3306" root@127.0.0.1[(none)]$ select * from proxy_config; +----------------------------+--------------------+ | option | value | +----------------------------+--------------------+ | admin.address | 127.0.0.1:3306 | | proxy.address | 10.10.155.203:3306 | | proxy.lua_script | NULL | | proxy.backend_addresses[0] | 10.10.155.201:3306 | <==== | proxy.backend_addresses[1] | 10.10.155.202:3306 | <==== | proxy.fix_bug_25371 | 0 | | proxy.profiling | 1 | +----------------------------+--------------------+ 7 rows in set (0.00 sec) [1] http://dev.mysql.com/doc/refman/5.0/en/mysql-proxy-cmdline.html >How-To-Repeat: Just try to use more than one MySQL backend addresses. >Fix: --- mysql-proxy.patch begins here --- diff -u -r mysql-proxy.orig/files/mysql-proxy.sh.in mysql-proxy/files/mysql-proxy.sh.in --- mysql-proxy.orig/files/mysql-proxy.sh.in 2008-03-27 05:05:18.000000000 +0300 +++ mysql-proxy/files/mysql-proxy.sh.in 2009-06-25 16:57:32.000000000 +0400 @@ -40,9 +40,14 @@ : ${mysql_proxy_backend_addresses="127.0.0.1:3306"} : ${mysql_proxy_pid_file="/var/run/mysql-proxy.pid"} +proxy_backend_addresses="" +for addr in ${mysql_proxy_backend_addresses}; do + proxy_backend_addresses="${proxy_backend_addresses} --proxy-backend-addresses=${addr}" +done + pidfile="${mysql_proxy_pid_file}" command=%%PREFIX%%/sbin/mysql-proxy -command_args="--admin-address=${mysql_proxy_admin_address} --proxy-address=${mysql_proxy_address} --proxy-backend-addresses=${mysql_proxy_backend_addresses} ${mysql_proxy_args} --daemon --pid-file=${mysql_proxy_pid_file}" +command_args="--admin-address=${mysql_proxy_admin_address} --proxy-address=${mysql_proxy_address} ${proxy_backend_addresses} ${mysql_proxy_args} --daemon --pid-file=${mysql_proxy_pid_file}" procname=%%PREFIX%%/sbin/mysql-proxy run_rc_command "$1" --- mysql-proxy.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: