Skip to content

Commit

Permalink
Merge tag 'pgbouncer_1_24_0' into sinoru/develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	configure.ac
#	include/bouncer.h
#	src/objects.c
  • Loading branch information
sinoru committed Feb 2, 2025
2 parents 3f66662 + 127bd61 commit 40c1903
Show file tree
Hide file tree
Showing 50 changed files with 2,500 additions and 543 deletions.
29 changes: 11 additions & 18 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ env:
CIRRUS_CLONE_SUBMODULES: true
DEBIAN_FRONTEND: noninteractive
LANG: C
PGVERSION: 14
PGVERSION: 16

task:
name: Linux (Debian/Ubuntu)
Expand Down Expand Up @@ -62,15 +62,11 @@ task:
- apt-get -y install curl gnupg lsb-release
- curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
- 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 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
- if [ "$PGVERSION" = 17 ]; then pkgs="$pkgs libpq5=$(apt-cache show libpq5 | grep "^Version: $PGVERSION" | awk '{print $2}')"; fi
- if [ "$PGVERSION" = 17 ]; then pkgs="$pkgs postgresql-common=$(apt-cache show postgresql-common | grep "^Version: .*pgdg" | awk '{print $2}')"; fi
- if [ "$PGVERSION" = 17 ]; then pkgs="$pkgs postgresql-client-common=$(apt-cache show postgresql-client-common | grep "^Version: .*pgdg" | awk '{print $2}')"; fi
- apt-get -y install $pkgs
- python3 -m venv /venv
- /venv/bin/pip install -r requirements.txt
Expand Down Expand Up @@ -107,14 +103,12 @@ task:
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
- yum -y install python3 python3-pip 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/
# XXX: python too old
- if cat /etc/centos-release | grep -q ' 7'; then true; else pip3 install -r requirements.txt; fi
- pip3 install -r requirements.txt
- useradd user
- chown -R user .
- echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
Expand All @@ -123,8 +117,7 @@ task:
- 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
- su user -c "make -j4 check CONCURRENCY=4"
install_script:
- make -j4 install
always:
Expand Down Expand Up @@ -164,7 +157,7 @@ task:
task:
name: FreeBSD
freebsd_instance:
image_family: freebsd-14-0
image_family: freebsd-14-1
env:
HAVE_IPV6_LOCALHOST: yes
USE_SUDO: true
Expand Down Expand Up @@ -198,25 +191,25 @@ task:
task:
name: macOS
macos_instance:
image: ghcr.io/cirruslabs/macos-sonoma-base:latest
image: ghcr.io/cirruslabs/macos-runner:sonoma
env:
HAVE_IPV6_LOCALHOST: yes
USE_SUDO: true
CPPFLAGS: -I/opt/homebrew/opt/openssl@3/include
LDFLAGS: -L/opt/homebrew/opt/openssl@3/lib
PATH: /opt/homebrew/opt/postgresql@${PGVERSION}/bin:$PATH
setup_script:
- brew install autoconf automake bash libevent libtool openssl pandoc pkg-config postgresql@${PGVERSION}
- 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:
CPPFLAGS: -I/opt/homebrew/opt/openssl@3/include
LDFLAGS: -L/opt/homebrew/opt/openssl@3/lib
build_script:
- ./autogen.sh
- ./configure --prefix=$HOME/install --enable-werror
- make -j4
test_script:
- source venv/bin/activate && make check -j4 CONCURRENCY=4
- source venv/bin/activate && make -j4 check CONCURRENCY=4
install_script:
- make -j4 install
always:
Expand All @@ -239,7 +232,7 @@ task:
# MSYSTEM: MINGW32
setup_script:
- choco install -y --no-progress msys2
- sh -l -c "pacman --noconfirm -S --needed base-devel ${MINGW_PACKAGE_PREFIX}-gcc ${MINGW_PACKAGE_PREFIX}-libevent ${MINGW_PACKAGE_PREFIX}-openssl ${MINGW_PACKAGE_PREFIX}-postgresql autoconf automake libtool ${MINGW_PACKAGE_PREFIX}-python ${MINGW_PACKAGE_PREFIX}-python-pip zip"
- sh -l -c "pacman --noconfirm -S --needed base-devel ${MINGW_PACKAGE_PREFIX}-gcc ${MINGW_PACKAGE_PREFIX}-libevent ${MINGW_PACKAGE_PREFIX}-openssl ${MINGW_PACKAGE_PREFIX}-postgresql autoconf automake libtool pkg-config ${MINGW_PACKAGE_PREFIX}-python ${MINGW_PACKAGE_PREFIX}-python-pip zip"
- sh -l -c 'pip install -r requirements.txt'
- echo 127.0.0.1 localhost >> c:\Windows\System32\Drivers\etc\hosts
- sh -l -c 'echo "127.0.0.1 localhost" >> /etc/hosts'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ venv
.venv

/uncrustify

__pycache__/
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pgbouncer_SOURCES = \
include/common/builtins.h \
include/common/pg_wchar.h \
include/common/postgres_compat.h \
include/common/protocol.h \
include/common/saslprep.h \
include/common/scram-common.h \
include/common/unicode_combining_table.h \
Expand Down Expand Up @@ -193,8 +194,8 @@ lint:
flake8

format-check: uncrustify
black --check .
isort --check .
black --check --diff .
isort --check --diff .
./uncrustify -c uncrustify.cfg --check include/*.h src/*.c -L WARN

format: uncrustify
Expand Down
80 changes: 80 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,86 @@
PgBouncer changelog
===================

PgBouncer 1.24.x
----------------

**2025-01-10 - PgBouncer 1.24.0 - "New year, new bouncer"**

- Features
* Add support for `Type=notify-reload` for systemd. This requires systemd
version 253 or later. ([#1148])
* Add `KILL_CLIENT` command to the admin console. This allows terminating a
client connection by force. ([#1147])
* Add `max_user_client_connections` setting, both globally and at the user level. ([#1137])
* Add `max_db_client_connections` setting, both globally and at the database level. ([#1138])
* Add `current_client_connections` counter to `SHOW USERS` and `SHOW DATABASES` output. ([#1137], [#1138])
* Add `load_balance_hosts` parameter, to support **not** load balancing between hosts. ([#736])
* Expose prepared statement usage counters in `SHOW STATS`. ([#1192])
* Add `client_idle_timeout` setting. ([#1189])
* Add user level `query_timeout` and `reserve_pool_size`. ([#1180], [#1228])
* Enable `pam` authentication support in HBA file. ([#326])

- Changes
* Don't recycle connections on RELOAD if TLS config is unchanged. Previously
if you had TLS connections they would all be recycled on RELOAD, which could
cause a temporary but serious performance degradation. Now this only
happens when the TLS settings are actually changed. ([#1157])
* Enable prepared statement support by default, `max_prepared_statements` is
now set to 200 by default. This change in defaultls should only impact
clients that actually use prepared statements. If you do use prepared
statements it's recommended to read about the limitations of the prepared
statement support in [our documentation][prepared-docs] ([#1144])
* Sockets/clients/servers can now be identified by a unique ID in the admin
output. Previously they could be identified by their pointer, but these
would often be reused by new clients after disconnect. ([#1172])
* Clearer error for empty pidfile. ([#1195])
* Return original error to client in case of `server_login_retry` failure. ([#1152])
* Log original server error in case of error from `auth_query`. ([#1187])
* Setting `default_pool_size` to 0 means unlimited size. ([#1227])
* Change the name of the `reserve_pool` setting for databases, to
`reserve_pool_size`. The previous name is still an alias for the new name.
([#1232])

- Fixes
* Handle various unlikely error cases better, such as OOM errors. These could
previously cause crashes or memory leaks. ([#1108], [#1101], [#1099], [#1169], [#1202])
* Correct default value for `server_tls_sslmode` in sample config file. ([#1133])
* Remove mention in docs of invalid alias for `server_tls_protocols`. ([#1155])
* Fix bug when using `auth_query` and replication connections together. This
bug would cause connection failures in such setups. ([#1166])
* Ignore client cancel requests while PgBouncer is configuring server setting. ([#298])

[prepared-docs]: https://www.pgbouncer.org/config.html#max_prepared_statements

[#1148]: https://github.com/pgbouncer/pgbouncer/pull/1148
[#1147]: https://github.com/pgbouncer/pgbouncer/pull/1147
[#1137]: https://github.com/pgbouncer/pgbouncer/pull/1137
[#1138]: https://github.com/pgbouncer/pgbouncer/pull/1138
[#736]: https://github.com/pgbouncer/pgbouncer/pull/736
[#1192]: https://github.com/pgbouncer/pgbouncer/pull/1192
[#1189]: https://github.com/pgbouncer/pgbouncer/pull/1189
[#1180]: https://github.com/pgbouncer/pgbouncer/pull/1180
[#1228]: https://github.com/pgbouncer/pgbouncer/pull/1228
[#326]: https://github.com/pgbouncer/pgbouncer/pull/326
[#1157]: https://github.com/pgbouncer/pgbouncer/pull/1157
[#1144]: https://github.com/pgbouncer/pgbouncer/pull/1144
[#1172]: https://github.com/pgbouncer/pgbouncer/pull/1172
[#1195]: https://github.com/pgbouncer/pgbouncer/pull/1195
[#1152]: https://github.com/pgbouncer/pgbouncer/pull/1152
[#1187]: https://github.com/pgbouncer/pgbouncer/pull/1187
[#1227]: https://github.com/pgbouncer/pgbouncer/pull/1227
[#1232]: https://github.com/pgbouncer/pgbouncer/pull/1232
[#1108]: https://github.com/pgbouncer/pgbouncer/pull/1108
[#1101]: https://github.com/pgbouncer/pgbouncer/pull/1101
[#1099]: https://github.com/pgbouncer/pgbouncer/pull/1099
[#1169]: https://github.com/pgbouncer/pgbouncer/pull/1169
[#1202]: https://github.com/pgbouncer/pgbouncer/pull/1202
[#1133]: https://github.com/pgbouncer/pgbouncer/pull/1133
[#1155]: https://github.com/pgbouncer/pgbouncer/pull/1155
[#1166]: https://github.com/pgbouncer/pgbouncer/pull/1166
[#298]: https://github.com/pgbouncer/pgbouncer/pull/298


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

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ systemd integration
-------------------

To enable systemd integration, use the `configure` option
`--with-systemd`. This allows using `Type=notify` service units as
well as socket activation. See `etc/pgbouncer.service` and
`etc/pgbouncer.socket` for examples.
`--with-systemd`. This allows using `Type=notify` (or `Type=notify-reload` if
you are using systemd 253 or later) as well as socket activation. See
`etc/pgbouncer.service` and `etc/pgbouncer.socket` for examples.

Building from Git
-----------------
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.

AC_INIT([PgBouncer],
[1.23.1],
[1.24.0],
[https://github.com/pgbouncer/pgbouncer/issues], [],
[https://www.pgbouncer.org/])
AC_CONFIG_SRCDIR(src/janitor.c)
Expand Down
Loading

0 comments on commit 40c1903

Please sign in to comment.