Skip to content

Commit

Permalink
Merge tag 'pgbouncer_1_23_1-fixed' into sinoru/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sinoru committed Oct 18, 2024
2 parents de2e8d7 + cb8d541 commit 3f66662
Show file tree
Hide file tree
Showing 71 changed files with 3,517 additions and 877 deletions.
124 changes: 64 additions & 60 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ task:
- echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main $PGVERSION" | tee /etc/apt/sources.list.d/pgdg.list
- if [ "$PGVERSION" = 17 ]; then echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg-snapshot main 17" | tee /etc/apt/sources.list.d/pgdg.list; fi
- apt-get update
- pkgs="autoconf automake ca-certificates cpio libc-ares-dev libevent-dev libssl-dev libsystemd-dev libtool make pandoc postgresql-$PGVERSION pkg-config python3 python3-pip python3-venv sudo iptables"
- pkgs="autoconf automake ca-certificates cpio libc-ares-dev libevent-dev libpam0g-dev libssl-dev libsystemd-dev libtool make pandoc postgresql-$PGVERSION pkg-config python3 python3-pip python3-venv sudo iptables"
- case $CC in clang) pkgs="$pkgs clang";; esac
- if [ x"$ENABLE_VALGRIND" = x"yes" ]; then pkgs="$pkgs valgrind"; fi
- if [ x"$use_scan_build" = x"yes" ]; then pkgs="$pkgs clang-tools"; fi
Expand Down Expand Up @@ -100,63 +100,66 @@ task:
path: "config.log"
type: text/plain

# task:
# name: Linux (Red Hat)
# container:
# matrix:
# - image: rockylinux:9
# - image: rockylinux:8
# - image: centos:centos7
# setup_script:
# - yum -y install autoconf automake diffutils file libevent-devel libtool make openssl-devel pkg-config postgresql-server systemd-devel wget
# - if cat /etc/centos-release | grep -q ' 7'; then yum -y install python python-pip; else yum -y install python3 python3-pip sudo iptables; fi
# - wget -O /tmp/pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-linux-amd64.tar.gz
# - tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/
# # XXX: python too old
# - if cat /etc/centos-release | grep -q ' 7'; then true; else pip3 install -r requirements.txt; fi
# - useradd user
# - chown -R user .
# - echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# build_script:
# - su user -c "./autogen.sh"
# - su user -c "./configure --prefix=$HOME/install --enable-cassert --enable-werror --with-systemd"
# - su user -c "make -j4"
# test_script:
# # XXX: postgresql too old on centos7
# - if cat /etc/centos-release | grep -q ' 7'; then true; else su user -c "make -j4 check CONCURRENCY=4"; fi
# install_script:
# - make -j4 install
# always:
# configure_artifacts:
# path: "config.log"
# type: text/plain
task:
name: Linux (Red Hat)
trigger_type: manual
container:
matrix:
- image: rockylinux:9
- image: rockylinux:8
- image: centos:centos7
setup_script:
- yum -y install autoconf automake diffutils file libevent-devel libtool make openssl-devel pkg-config postgresql-server postgresql-contrib systemd-devel wget
- if cat /etc/centos-release | grep -q ' 7'; then yum -y install python python-pip; else yum -y install python3 python3-pip sudo iptables; fi
- wget -O /tmp/pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-linux-amd64.tar.gz
- tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/
# XXX: python too old
- if cat /etc/centos-release | grep -q ' 7'; then true; else pip3 install -r requirements.txt; fi
- useradd user
- chown -R user .
- echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
build_script:
- su user -c "./autogen.sh"
- su user -c "./configure --prefix=$HOME/install --enable-cassert --enable-werror --with-systemd"
- su user -c "make -j4"
test_script:
# XXX: postgresql too old on centos7
- if cat /etc/centos-release | grep -q ' 7'; then true; else su user -c "make -j4 check CONCURRENCY=4"; fi
install_script:
- make -j4 install
always:
configure_artifacts:
path: "config.log"
type: text/plain

# task:
# name: Linux (Alpine)
# container:
# matrix:
# - image: alpine:latest
# setup_script:
# - apk update
# - apk add autoconf automake bash build-base libevent-dev libtool openssl openssl-dev pkgconf postgresql python3 py3-pip wget sudo iptables
# - wget -O /tmp/pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-linux-amd64.tar.gz
# - tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/
# - python3 -m pip install -r requirements.txt
# - adduser --disabled-password user
# - chown -R user .
# - echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# build_script:
# - su user -c "./autogen.sh"
# - su user -c "./configure --prefix=$HOME/install --enable-cassert --enable-werror"
# - su user -c "make -j4"
# test_script:
# - su user -c "make -j4 check CONCURRENCY=4"
# install_script:
# - make -j4 install
# always:
# configure_artifacts:
# path: "config.log"
# type: text/plain
task:
name: Linux (Alpine)
trigger_type: manual
container:
matrix:
- image: alpine:latest
setup_script:
- apk update
- apk add autoconf automake bash build-base libevent-dev libtool openssl openssl-dev pkgconf postgresql postgresql-contrib python3 py3-pip wget sudo iptables
- wget -O /tmp/pandoc.tar.gz https://github.com/jgm/pandoc/releases/download/2.10.1/pandoc-2.10.1-linux-amd64.tar.gz
- tar xvzf /tmp/pandoc.tar.gz --strip-components 1 -C /usr/local/
- python3 -m venv /venv
- /venv/bin/pip install -r requirements.txt
- adduser --disabled-password user
- chown -R user .
- echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
build_script:
- su user -c "./autogen.sh"
- su user -c "./configure --prefix=$HOME/install --enable-cassert --enable-werror"
- su user -c "make -j4"
test_script:
- source /venv/bin/activate && su user -c "make -j4 check CONCURRENCY=4"
install_script:
- make -j4 install
always:
configure_artifacts:
path: "config.log"
type: text/plain

task:
name: FreeBSD
Expand All @@ -166,7 +169,7 @@ task:
HAVE_IPV6_LOCALHOST: yes
USE_SUDO: true
setup_script:
- pkg install -y autoconf automake bash gmake hs-pandoc libevent libtool pkgconf postgresql12-server python devel/py-pip sudo
- pkg install -y autoconf automake bash gmake hs-pandoc libevent libtool pkgconf postgresql12-server postgresql12-contrib python devel/py-pip sudo
- pip install -r requirements.txt
- kldload pf
- echo 'anchor "pgbouncer_test/*"' >> /etc/pf.conf
Expand Down Expand Up @@ -201,7 +204,8 @@ task:
USE_SUDO: true
setup_script:
- brew install autoconf automake bash libevent libtool openssl pandoc pkg-config postgresql@${PGVERSION}
- python3 -m pip install -r requirements.txt
- python3 -m venv venv
- venv/bin/pip install -r requirements.txt
- echo 'anchor "pgbouncer_test/*"' | sudo tee -a /etc/pf.conf
- sudo pfctl -f /etc/pf.conf
env:
Expand All @@ -212,7 +216,7 @@ task:
- ./configure --prefix=$HOME/install --enable-werror
- make -j4
test_script:
- make check -j4 CONCURRENCY=4
- source venv/bin/activate && make check -j4 CONCURRENCY=4
install_script:
- make -j4 install
always:
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Martin Pihlak
Mathieu Fenniak
Michael Tharp
Michał Trojnara
Matan Ryngler
Pavel Stehule
Pierre-Emmanuel André
Rich Schaaf
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pgbouncer_SOURCES = \
src/util.c \
src/varcache.c \
src/common/base64.c \
src/common/bool.c \
src/common/pgstrcasecmp.c \
src/common/saslprep.c \
src/common/scram-common.c \
src/common/unicode_norm.c \
Expand Down Expand Up @@ -55,6 +57,7 @@ pgbouncer_SOURCES = \
include/util.h \
include/varcache.h \
include/common/base64.h \
include/common/builtins.h \
include/common/pg_wchar.h \
include/common/postgres_compat.h \
include/common/saslprep.h \
Expand Down
89 changes: 79 additions & 10 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,75 @@
PgBouncer changelog
===================

PgBouncer 1.23.x
----------------

**2024-08-02 - PgBouncer 1.23.1 - "Everything is put back in order"**

- Fixes
* Fix a possible segmentation fault after PgBouncer reloads its
configuration. ([#1105]) (bug introduced in 1.23.0)
* Fix all known put_in_order crashes. ([#1120])
(new crashes were introduced in 1.23.0)
* Add missing files to release tarball that are required for testing.
([#1124]) (missing files were introduced in 1.23.0)

[#1120]: https://github.com/pgbouncer/pgbouncer/pull/1120
[#1105]: https://github.com/pgbouncer/pgbouncer/pull/1105
[#1124]: https://github.com/pgbouncer/pgbouncer/pull/1124

**2024-07-03 - PgBouncer 1.23.0 - "Into the new beginnings"**

- Features
* Add support for rolling restarts. SIGTERM doesn't cause immediate shutdown
of the PgBouncer process anymore. It now does a "super safe shutdown":
waiting for all clients to disconnect before shutting down. The new SIGTERM
behaviour allows rolling restarts of multiple PgBouncer processes behind a
load balancer, or listening on the same port using `so_reuseport`.
This is a **minor breaking change**. If you relied on the old behaviour of
SIGTERM in your Dockerfile or Systemd service file you should now use SIGQUIT.
([#902])
* Add support for user name maps for `cert` and `peer` authentication
methods. This feature provides the flexibility that the user initiating
the connection does not have to be the database user. PgBouncer support
for user name maps works very similar to the postgres with the exceptions
listed in the docs. ([#996])
* Add support for replication connections through PgBouncer. ([#876])

- Changes
* Improve `SHOW USERS` output listing the connections. ([#1040])
* Allow `pool_size` configuration per user. ([#1049])
* Allow `server_lifetime` configuration per database. ([#1057])
* Add support for listing dynamically created users in the output of `SHOW USERS`. ([#1052])
* Add support for `all` address type in hba configuration. ([#1078])
* Add support for automatically restarting when using systemd. ([#1080])
* Increase c-ares minimum version requirement to 1.9.0 ([#1076])

- Fixes
* Fix issues handling large and partial startup packets. ([#1058])
* Add support for `--config=value` format in options startup parameter. ([#1064])
* Fix `avg_wait_time` metric calculation. ([#727])
* Add support for negotiating the postgres protocol version with the client. ([#1007])
* Add outstanding request for `auth_query`. ([#1034])
* Multiple documentation and CI improvements.

[#996]: https://github.com/pgbouncer/pgbouncer/pull/996
[#1040]: https://github.com/pgbouncer/pgbouncer/pull/1040
[#1049]: https://github.com/pgbouncer/pgbouncer/pull/1049
[#1057]: https://github.com/pgbouncer/pgbouncer/pull/1057
[#1052]: https://github.com/pgbouncer/pgbouncer/pull/1052
[#1058]: https://github.com/pgbouncer/pgbouncer/pull/1058
[#1007]: https://github.com/pgbouncer/pgbouncer/pull/1007
[#876]: https://github.com/pgbouncer/pgbouncer/pull/876
[#902]: https://github.com/pgbouncer/pgbouncer/pull/902
[#1064]: https://github.com/pgbouncer/pgbouncer/pull/1064
[#1078]: https://github.com/pgbouncer/pgbouncer/pull/1078
[#1080]: https://github.com/pgbouncer/pgbouncer/pull/1080
[#727]: https://github.com/pgbouncer/pgbouncer/pull/727
[#1076]: https://github.com/pgbouncer/pgbouncer/pull/1076
[#1034]: https://github.com/pgbouncer/pgbouncer/pull/1034


PgBouncer 1.22.x
----------------

Expand Down Expand Up @@ -279,7 +348,7 @@ PgBouncer 1.18.x
([#648](https://github.com/pgbouncer/pgbouncer/pull/648))
* Fix `SHOW HELP` with PostgreSQL 15
([#769](https://github.com/pgbouncer/pgbouncer/issues/769))
* Fix race condition in query cancelation handling. It was possible
* Fix race condition in query cancellation handling. It was possible
that a query cancellation for one client canceled a query for
another one. This could happen when a cancel request was received
by PgBouncer when the query it was meant to cancel already
Expand Down Expand Up @@ -825,7 +894,7 @@ PgBouncer 1.6.x

[CVE-2015-6817](https://access.redhat.com/security/cve/cve-2015-6817)

* Skip NoticeResponce in handle_auth_response. Otherwise verbose
* Skip NoticeResponse in handle_auth_response. Otherwise verbose
log levels on server cause login failures.

* console: Fill `auth_user` when auth_type=any. Otherwise
Expand Down Expand Up @@ -966,12 +1035,12 @@ PgBouncer 1.5.x
* max_packet_size - config parameter to tune maximum packet size
that is allowed through. Default is kept same: (2G-1), but now
it can be made smaller.
* In case of unparseable packet header, show it in hex in log and
* In case of unparsable packet header, show it in hex in log and
error message.

- Fixes

* AntiMake: it used $(relpath) and $(abspath) to manupulate pathnames,
* AntiMake: it used $(relpath) and $(abspath) to manipulate pathnames,
but the result was build failure when source tree path contained
symlinks. The code is now changed to work on plain strings only.
* console: now SET can be used to set empty string values.
Expand Down Expand Up @@ -1011,7 +1080,7 @@ PgBouncer 1.5.x
earlier versions anymore.
* Stop trying to retry on EINTR from close().

**2012-01-05 - PgBouncer 1.5 - "Bouncing Satisified Clients Since 2007"**
**2012-01-05 - PgBouncer 1.5 - "Bouncing Satisfied Clients Since 2007"**

If you use more than 8 IPs behind one DNS name, you now need to
use EDNS0 protocol to query. Only getaddrinfo_a()/getaddrinfo()
Expand Down Expand Up @@ -1050,7 +1119,7 @@ GNU Make 3.81+ is required for building.
(Dan McGee)
* Console: Support ident quoting with "". Originally we did not
have any commands that took database names, so no quoting was needed.
* Console: allow numbers at the stard of word regex. Trying
* Console: allow numbers at the start of word regex. Trying
to use strict parser makes things too complex here.
* Don't expire auto DBs that are paused.
(Michael Tharp)
Expand Down Expand Up @@ -1363,7 +1432,7 @@ PgBouncer 1.3.x

* In case event_del() reports failure, just proceed with cleanup.
Previously pgbouncer retried it, in case the failure was due ENOMEM.
But this has caused log floods with inifinite repeats, so it seems
But this has caused log floods with infinite repeats, so it seems
libevent does not like it.

Why event_del() report failure first time is still mystery.
Expand Down Expand Up @@ -1545,7 +1614,7 @@ PgBouncer 1.1.x
- Accept custom unix socket location in host=
- Accept quoted values: password=' asd''foo'

* New config var: server_reset_query, to be sent immidiately after release
* New config var: server_reset_query, to be sent immediately after release
* New config var: server_round_robin, to switch between LIFO and RR.
* Cancel pkt sent for idle connection does not drop it anymore.
* Cancel with ^C from psql works for SUSPEND / PAUSE.
Expand Down Expand Up @@ -1634,13 +1703,13 @@ PgBouncer 1.0.x
- Fixes
* libevent may report a deleted event inside same loop.
Avoid socket reuse for one loop.
* release_server() from disconnect_client() didnt look
* release_server() from disconnect_client() didn't look
it the packet was actually sent.

**2007-03-15 - PgBouncer 1.0.1 - "Alien technology"**

- Fixes
* Mixed usage of cached and non-cached time, plus unsiged usec_t typedef
* Mixed usage of cached and non-cached time, plus unsigned usec_t typedef
created spurious query_timeout errors.
* Fix rare case when socket woken up from send-wait could stay stalling.
* More fair queueing of server connections. Before, a new query could
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,24 @@ well as socket activation. See `etc/pgbouncer.service` and
Building from Git
-----------------

Building PgBouncer from Git requires that you fetch the libusual
submodule and generate the header and configuration files before
Building PgBouncer from Git requires that you fetch the libusual and
uthash submodules and generate the header and configuration files before
you can run `configure`:

$ git clone https://github.com/pgbouncer/pgbouncer.git
$ cd pgbouncer
$ git submodule init
$ git submodule update
$ ./autogen.sh
$ ./configure ...
$ ./configure
$ make
$ make install

All files will be installed under `/usr/local` by default. You can
supply one or more command-line options to `configure`. Run
`./configure --help` to list the available options and the environment
variables that customizes the configuration.

Additional packages required: autoconf, automake, libtool, pandoc

Testing
Expand All @@ -113,12 +118,12 @@ Visual $ANYTHING are not supported.

To build on MinGW, do the usual:

$ ./configure ...
$ ./configure
$ make

If cross-compiling from Unix:

$ ./configure --host=i586-mingw32msvc ...
$ ./configure --host=i586-mingw32msvc

Running on Windows
------------------
Expand Down
Loading

0 comments on commit 3f66662

Please sign in to comment.