NetBSD Problem Report #58137

From www@netbsd.org  Wed Apr 10 21:19:25 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id AF3CF1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 10 Apr 2024 21:19:25 +0000 (UTC)
Message-Id: <20240410211924.57B5A1A923A@mollari.NetBSD.org>
Date: Wed, 10 Apr 2024 21:19:24 +0000 (UTC)
From: pmcphee@givex.com
Reply-To: pmcphee@givex.com
To: gnats-bugs@NetBSD.org
Subject: Patch to upgrade pgbouncer to the latest version, 1.22.1
X-Send-Pr-Version: www-1.0

>Number:         58137
>Category:       pkg
>Synopsis:       Patch to upgrade pgbouncer to the latest version, 1.22.1
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 10 21:20:01 +0000 2024
>Closed-Date:    Thu Apr 11 07:07:02 +0000 2024
>Last-Modified:  Thu Apr 11 07:07:02 +0000 2024
>Originator:     Patrick TJ McPhee
>Release:        pkgsrc-2024Q1
>Organization:
Givex Corporation
>Environment:
>Description:
Current version of pgbouncer in pkgsrc is 1.10.0 from 2019. This patch updates it to 1.22.1 from this year.

I've been upgrading my own systems with new releases periodically and I always mean to submit a patch once I've run them for a while, but I never get around to it. I've been running 1.22.0 in production for a few months now. I've done minimal testing with 1.22.1, but it appears to work correctly.

I've built and tested only on NetBSD 9.3 and NetBSD 10.0

I'll paste the patch in the "fix to the problem" box, and a lengthy summary of the change log in "how to repeat".
>How-To-Repeat:
The changelog is at https://www.pgbouncer.org/changelog.html, summarized in some detail
below:

2019-08-27 - PgBouncer 1.11.0 - "Instinct for Greatness"
- Add support for SCRAM authentication and other password handling improvements
- Option to disable stats logging and other logging improvements
- Bug fixes and test suite improvements

2019-10-17 - PgBouncer 1.12.0 - "It's about learning and getting better"
- Support SO_REUSEPORT socket option
- Add support for using a pgbouncer-specific resolv.conf
- Fixes related to statistics reporting and password management
- Removes support for libevent 1.x and adds requiremetn to use pkg-config

2020-04-27 - PgBouncer 1.13.0 - "My favourite game"
- option to set tcp timeout
- TLS protocols now default to "secure" (TLS 1.1 and earlier turned off by default)
- various bug fixes

2020-06-11 - PgBouncer 1.14.0 - "La ritrovata magia"
- Add SCRAM authentication pass-through.
- New, minimal, sample config file

2020-11-19 - PgBouncer 1.15.0 - “Ich hab noch einen Koffer in Berlin”
- Improve authentication failure reporting.
- Don't log anything if client disconnects immediately.
- SHOW CONFIG now also shows the default values of the settings.
- A few bug fixes

2021-08-09 - PgBouncer 1.16.0 - Fended off a jaguar"
- Support hot reloading of TLS settings
- Add support for abstract Unix-domain sockets
- Increased the maximum lengths of passwords and usernames (996, 128)
- Tighter error handling in config parsing
- Query cancel handling has been fixed
- Mixed use of md5 and scram via hba has been fixed
- "FIXME: query end, but query_start == 0" has been fixed
- Fix reloading of default_pool_size, min_pool_size, and res_pool_size.
- reserved "pgbouncer" as a database name
- various cleanups and test improvements

2021-11-11 - PgBouncer 1.16.1 - "Test of depth against quiet efficiency"
- Fix to a potential man-in-the-middle vulnerability (CVE-2021-3935)

2022-03-23 - PgBouncer 1.17.0 - "A line has been drawn"
- support for round-robin database connection
- some errors not reported to unauthenticated clients
- increased maximum password length again
- openssl 3 support fixed
- dropped support for python 2 in test suite
- various other bug fixes

2022-12-12 - PgBouncer 1.18.0 - "No real mystery"
- Add application_name to SHOW CLIENTS/SERVERS/SOCKETS output
- Add information about cancel requests to SHOW CLIENTS/SERVERS/POOLS output
- Bug fixes, including an overflow bug and a race condition in query cancellation handling

2023-05-04 - PgBouncer 1.19.0 - "The old-fashioned, human-generated kind"
- Add support for peering between PgBouncer processes.
- Add the SHOW STATE command
- A few new configuration options
- New testing framework
- Various bug fixes

2023-05-31 - PgBouncer 1.19.1 - Sunny Spring
- Fix a few fatal errors
- Add missing files from the new testing framework

2023-07-20 - PgBouncer 1.20.0 - "A funny name goes here"
- Online restart option is now considered deprecated
- Introduce the track_extra_parameters which allows tracking of more parameters in transaction pooling mode.
- Forward SQLSTATE in authentication phase.
- Change default server_tls_sslmode to prefer
- Add support for the options startup parameter.
- Various bug fixes

2023-08-09 - PgBouncer 1.20.1 - "Optional options"
- Fixed regression related to options startup parameter

2023-10-16 - PgBouncer 1.21.0 - "The one with prepared statements"
- Add support for protocol-level named prepared statements
- Improve security of OpenSSL settings
- Various bug fixes

2024-01-31 - PgBouncer 1.22.0 - "DEALLOCATE ALL"
- Adds support for DEALLOCATE ALL and DISCARD ALL
- Support configuring auth_query per database
- Make fail fast logic handle all scenarios where no working connections to the database exist anymore and none can be established
- Some bug fixes

2024-03-04 - PgBouncer 1.22.1 - "It's summer in Bangalore"
- Fix issues caused by some clients using COPY FROM STDIN queries.
- Add missing tests to release tarball

- Multiple documentation improvements

>Fix:
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/databases/pgbouncer/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile	24 Oct 2023 22:08:31 -0000	1.17
+++ Makefile	10 Apr 2024 19:55:26 -0000
@@ -1,8 +1,8 @@
 # $NetBSD: Makefile,v 1.17 2023/10/24 22:08:31 wiz Exp $
 #

-DISTNAME=	pgbouncer-1.10.0
-PKGREVISION=	2
+DISTNAME=	pgbouncer-1.22.1
+PKGREVISION=	
 CATEGORIES=	databases
 MASTER_SITES=	http://pgbouncer.github.io/downloads/files/${PKGVERSION_NOREV}/

@@ -12,7 +12,7 @@
 LICENSE=	original-bsd

 USE_LANGUAGES=	c
-USE_TOOLS+=	gmake
+USE_TOOLS+=	gmake pkg-config:run
 GNU_CONFIGURE=	yes

 .include "../../mk/bsd.prefs.mk"
Index: PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/databases/pgbouncer/PLIST,v
retrieving revision 1.5
diff -u -r1.5 PLIST
--- PLIST	14 Aug 2019 14:19:38 -0000	1.5
+++ PLIST	10 Apr 2024 19:55:26 -0000
@@ -4,5 +4,8 @@
 man/man5/pgbouncer.5
 share/doc/pgbouncer/NEWS.md
 share/doc/pgbouncer/README.md
+share/doc/pgbouncer/pgbouncer.service
+share/doc/pgbouncer/pgbouncer.socket
 share/examples/pgbouncer/pgbouncer.ini
+share/examples/pgbouncer/pgbouncer-minimal.ini
 share/examples/pgbouncer/userlist.txt
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/databases/pgbouncer/distinfo,v
retrieving revision 1.12
diff -u -r1.12 distinfo
--- distinfo	26 Oct 2021 10:09:43 -0000	1.12
+++ distinfo	10 Apr 2024 19:55:26 -0000
@@ -1,6 +1,13 @@
 $NetBSD: distinfo,v 1.12 2021/10/26 10:09:43 nia Exp $

-BLAKE2s (pgbouncer-1.10.0.tar.gz) = 157fa199308bd6fc2853be48733bdf08e8a029074db7976d55b169e81b5737a6
-SHA512 (pgbouncer-1.10.0.tar.gz) = 8ec9f102b57ca5f92fb689588ec090056ac29f21825400ec67bca413fe076ad50e0b491e65c4cfebc488cc245eb3c88c36db2ee0ba1cb737f35404be0983dd1d
-Size (pgbouncer-1.10.0.tar.gz) = 480571 bytes
-SHA1 (patch-Makefile) = 91a59289d4fcd4b8258ed191f2deeb1e24853106
+BLAKE2s(pgbouncer-1.22.1.tar.gz)= b88eb7d1499ee266a2e29c03968fd9824028524f1e5e7f6aa18d785420a24f3a
+RMD160 (pgbouncer-1.22.1.tar.gz) = 46233fed8d10c405ecb3deb432f0b20646770ced
+SHA1 (pgbouncer-1.22.1.tar.gz) = e2617e2472e07703129e8404d0cd4161d981847b
+SHA512 (pgbouncer-1.22.1.tar.gz) = ac63fe877f68745f1faab096ee9d9e185de9cab97d4fef121c2c551fa0e69ea22342dc8b5ce75cadff755314e5493a5440f0748b5ee9f524f71d871ec1861530
+Size (pgbouncer-1.22.1.tar.gz) = 677351 bytes
+
+BLAKE2s(patch-Makefile)= 567c1ec07079dc2455fed4d034c4a85f69617314c18baded6a1ece8752b88947
+RMD160 (patch-Makefile) = c5fc17ea2b69d38f606dde799350e762605061c1
+SHA1 (patch-Makefile) = c0380baa4254bc72943376d24aa179057bad6439
+SHA512 (patch-Makefile) = 33b1dc5ff5f6ce4fcc11a323ab64ae34328be54b06dd3ccd4155e03c1ad61b5656992e20c9a45f6e4865b28a8139ae2be273c64dc8144f8843d2513c4119a158
+Size (patch-Makefile) = 510 bytes
Index: patches/patch-Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/databases/pgbouncer/patches/patch-Makefile,v
retrieving revision 1.3
diff -u -r1.3 patch-Makefile
--- patches/patch-Makefile	14 Aug 2019 14:19:38 -0000	1.3
+++ patches/patch-Makefile	10 Apr 2024 19:55:26 -0000
@@ -1,16 +1,20 @@
-$NetBSD: patch-Makefile,v 1.3 2019/08/14 14:19:38 fox Exp $
-
-Install sample config files as... config files.
-
---- Makefile.orig      2019-07-01 04:00:00.000000000 -0400
-+++ Makefile
-@@ -51,7 +51,8 @@
- pgbouncer_EMBED_LIBUSUAL = 1
+--- Makefile.orig	2023-05-04 07:53:35.000000000 -0400
++++ Makefile	2023-05-09 22:50:23.495150905 -0400
+@@ -67,12 +67,14 @@

  # docs to install as-is
--dist_doc_DATA = README.md NEWS.md etc/pgbouncer.ini etc/userlist.txt
-+dist_doc_DATA = README.md NEWS.md
-+dist_sysconf_DATA = etc/pgbouncer.ini etc/userlist.txt
+ dist_doc_DATA = README.md NEWS.md \
+-	etc/pgbouncer-minimal.ini \
+-	etc/pgbouncer.ini \
+ 	etc/pgbouncer.service \
+-	etc/pgbouncer.socket \
++	etc/pgbouncer.socket
++
++dist_sysconf_DATA = 	etc/pgbouncer-minimal.ini \
++	etc/pgbouncer.ini \
+ 	etc/userlist.txt

++
  DISTCLEANFILES = config.mak config.status lib/usual/config.h config.log

+ DIST_SUBDIRS = doc test

>Release-Note:

>Audit-Trail:
From: Thomas Klausner <wiz@gatalith.at>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/58137: Patch to upgrade pgbouncer to the latest version,
 1.22.1
Date: Wed, 10 Apr 2024 23:25:32 +0200

 That looks easy enough.

 One question: why is pkg-config a runtime dependency? Usually it's
 only needed at build time.
  Thomas

From: Patrick McPhee <patrick.mcphee@givex.com>
To: "pkg-manager@netbsd.org" <pkg-manager@netbsd.org>,
	"gnats-admin@netbsd.org" <gnats-admin@netbsd.org>, "pkgsrc-bugs@netbsd.org"
	<pkgsrc-bugs@netbsd.org>, "gnats-bugs@netbsd.org" <gnats-bugs@netbsd.org>,
	Patrick McPhee <patrick.mcphee@givex.com>
Cc: 
Subject: Re: EXT MAIL : Re: pkg/58137: Patch to upgrade pgbouncer to the
 latest version, 1.22.1
Date: Wed, 10 Apr 2024 22:21:28 +0000

 T24gV2VkLCAyMDI0LTA0LTEwIGF0IDIxOjMwICswMDAwLCBUaG9tYXMgS2xhdXNuZXIgd3JvdGU6
 DQo+IFRoZSBmb2xsb3dpbmcgcmVwbHkgd2FzIG1hZGUgdG8gUFIgcGtnLzU4MTM3OyBpdCBoYXMg
 YmVlbiBub3RlZCBieQ0KPiBHTkFUUy4NCj4gDQo+IEZyb206IFRob21hcyBLbGF1c25lciA8d2l6
 QGdhdGFsaXRoLmF0Pg0KPiBUbzogTmV0QlNEIGJ1Z3RyYWNraW5nIDxnbmF0cy1idWdzQE5ldEJT
 RC5vcmc+DQo+IENjOg0KPiBTdWJqZWN0OiBSZTogcGtnLzU4MTM3OiBQYXRjaCB0byB1cGdyYWRl
 IHBnYm91bmNlciB0byB0aGUgbGF0ZXN0DQo+IHZlcnNpb24sDQo+IMKgMS4yMi4xDQo+IERhdGU6
 IFdlZCwgMTAgQXByIDIwMjQgMjM6MjU6MzIgKzAyMDANCj4gDQo+IMKgVGhhdCBsb29rcyBlYXN5
 IGVub3VnaC4NCj4gDQo+IMKgT25lIHF1ZXN0aW9uOiB3aHkgaXMgcGtnLWNvbmZpZyBhIHJ1bnRp
 bWUgZGVwZW5kZW5jeT8gVXN1YWxseSBpdCdzDQo+IMKgb25seSBuZWVkZWQgYXQgYnVpbGQgdGlt
 ZS4NCj4gwqAgVGhvbWFzDQoNClByb2JhYmx5IGp1c3QgY2x1ZWxlc3NuZXNzIG9uIG15IHBhcnQu
 IEl0IHdhcyBhIGZldyB5ZWFycyBhZ28gd2hlbiBJDQphZGRlZCB0aGF0IGludG8gbXkgTWFrZWZp
 bGUgYW5kIEkgY2FuJ3QgdGhpbmsgd2hlcmUgSSBnb3QgdGhhdCBzeW50YXgNCmZyb20uIFBvc3Np
 Ymx5IGEgd2ViIHNlYXJjaCBvciBzb21lIG91dHJlIGV4YW1wbGUgZnJvbSB0aGUgcGtnc3JjDQpn
 dWlkZS4NCg0KSSBqdXN0IHZlcmlmaWVkIGl0IGJ1aWxkcyBhbmQgcnVucyB3aXRob3V0IHRoZSAi
 OnJ1biIgdGV4dC4NCg0KLS0gDQogICBQYXRyaWNrIFRKIE1jUGhlZSA8cG1jcGhlZUBnaXZleC5j
 b20+DQoNCg==

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/58137: Patch to upgrade pgbouncer to the latest version,
 1.22.1
Date: Thu, 11 Apr 2024 08:48:56 +0200

 Here's Patrick's reply, decoded:

 On Wed, 2024-04-10 at 21:30 +0000, Thomas Klausner wrote:
 > The following reply was made to PR pkg/58137; it has been noted by
 > GNATS.
 > 
 > From: Thomas Klausner <wiz@gatalith.at>
 > To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
 > Cc:
 > Subject: Re: pkg/58137: Patch to upgrade pgbouncer to the latest
 > version,
 >  1.22.1
 > Date: Wed, 10 Apr 2024 23:25:32 +0200
 > 
 >  That looks easy enough.
 > 
 >  One question: why is pkg-config a runtime dependency? Usually it's
 >  only needed at build time.
 >   Thomas

 Probably just cluelessness on my part. It was a few years ago when I
 added that into my Makefile and I can't think where I got that syntax
 from. Possibly a web search or some outre example from the pkgsrc
 guide.

 I just verified it builds and runs without the ":run" text.

 -- 
    Patrick TJ McPhee <pmcphee@givex.com>

From: "Thomas Klausner" <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/58137 CVS commit: pkgsrc/databases/pgbouncer
Date: Thu, 11 Apr 2024 06:55:27 +0000

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Thu Apr 11 06:55:27 UTC 2024

 Modified Files:
 	pkgsrc/databases/pgbouncer: Makefile PLIST distinfo
 	pkgsrc/databases/pgbouncer/patches: patch-Makefile

 Log Message:
 pgbouncer: update to 1.22.1.

 Based on PR 58137 by Patrick TJ McPhee; some cleanups while here.

 Changes:

 2019-08-27 - PgBouncer 1.11.0 - "Instinct for Greatness"
 - Add support for SCRAM authentication and other password handling improvements
 - Option to disable stats logging and other logging improvements
 - Bug fixes and test suite improvements

 2019-10-17 - PgBouncer 1.12.0 - "It's about learning and getting better"
 - Support SO_REUSEPORT socket option
 - Add support for using a pgbouncer-specific resolv.conf
 - Fixes related to statistics reporting and password management
 - Removes support for libevent 1.x and adds requiremetn to use pkg-config

 2020-04-27 - PgBouncer 1.13.0 - "My favourite game"
 - option to set tcp timeout
 - TLS protocols now default to "secure" (TLS 1.1 and earlier turned off by default)
 - various bug fixes

 2020-06-11 - PgBouncer 1.14.0 - "La ritrovata magia"
 - Add SCRAM authentication pass-through.
 - New, minimal, sample config file

 2020-11-19 - PgBouncer 1.15.0 - “Ich hab noch einen Koffer in Berlin”
 - Improve authentication failure reporting.
 - Don't log anything if client disconnects immediately.
 - SHOW CONFIG now also shows the default values of the settings.
 - A few bug fixes

 2021-08-09 - PgBouncer 1.16.0 - Fended off a jaguar"
 - Support hot reloading of TLS settings
 - Add support for abstract Unix-domain sockets
 - Increased the maximum lengths of passwords and usernames (996, 128)
 - Tighter error handling in config parsing
 - Query cancel handling has been fixed
 - Mixed use of md5 and scram via hba has been fixed
 - "FIXME: query end, but query_start == 0" has been fixed
 - Fix reloading of default_pool_size, min_pool_size, and res_pool_size.
 - reserved "pgbouncer" as a database name
 - various cleanups and test improvements

 2021-11-11 - PgBouncer 1.16.1 - "Test of depth against quiet efficiency"
 - Fix to a potential man-in-the-middle vulnerability (CVE-2021-3935)

 2022-03-23 - PgBouncer 1.17.0 - "A line has been drawn"
 - support for round-robin database connection
 - some errors not reported to unauthenticated clients
 - increased maximum password length again
 - openssl 3 support fixed
 - dropped support for python 2 in test suite
 - various other bug fixes

 2022-12-12 - PgBouncer 1.18.0 - "No real mystery"
 - Add application_name to SHOW CLIENTS/SERVERS/SOCKETS output
 - Add information about cancel requests to SHOW CLIENTS/SERVERS/POOLS output
 - Bug fixes, including an overflow bug and a race condition in query cancellation handling

 2023-05-04 - PgBouncer 1.19.0 - "The old-fashioned, human-generated kind"
 - Add support for peering between PgBouncer processes.
 - Add the SHOW STATE command
 - A few new configuration options
 - New testing framework
 - Various bug fixes

 2023-05-31 - PgBouncer 1.19.1 - Sunny Spring
 - Fix a few fatal errors
 - Add missing files from the new testing framework

 2023-07-20 - PgBouncer 1.20.0 - "A funny name goes here"
 - Online restart option is now considered deprecated
 - Introduce the track_extra_parameters which allows tracking of more parameters in transaction pooling mode.
 - Forward SQLSTATE in authentication phase.
 - Change default server_tls_sslmode to prefer
 - Add support for the options startup parameter.
 - Various bug fixes

 2023-08-09 - PgBouncer 1.20.1 - "Optional options"
 - Fixed regression related to options startup parameter

 2023-10-16 - PgBouncer 1.21.0 - "The one with prepared statements"
 - Add support for protocol-level named prepared statements
 - Improve security of OpenSSL settings
 - Various bug fixes

 2024-01-31 - PgBouncer 1.22.0 - "DEALLOCATE ALL"
 - Adds support for DEALLOCATE ALL and DISCARD ALL
 - Support configuring auth_query per database
 - Make fail fast logic handle all scenarios where no working connections to the database exist anymore and none can be established
 - Some bug fixes

 2024-03-04 - PgBouncer 1.22.1 - "It's summer in Bangalore"
 - Fix issues caused by some clients using COPY FROM STDIN queries.
 - Add missing tests to release tarball
 - Multiple documentation improvements


 To generate a diff of this commit:
 cvs rdiff -u -r1.17 -r1.18 pkgsrc/databases/pgbouncer/Makefile
 cvs rdiff -u -r1.5 -r1.6 pkgsrc/databases/pgbouncer/PLIST
 cvs rdiff -u -r1.12 -r1.13 pkgsrc/databases/pgbouncer/distinfo
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/databases/pgbouncer/patches/patch-Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Thu, 11 Apr 2024 07:07:02 +0000
State-Changed-Why:
Committed, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.