From fd440e7d7926733813985c5babab079136230126 Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Tue, 28 Nov 2023 23:43:24 +0000 Subject: [PATCH] neonvm: add pgbouncer patch to support DEALLOCATD/DISCARD ALL (#5958) pgbouncer 1.21.0 doesn't play nicely with DEALLOCATD/DISCARD ALL if prepared statement support is enabled (max_prepared_statements > 0). There's a patch[0] that improves this (it will be included in the next release of pgbouncer). This PR applies this patch on top of 1.21.0 release tarball. For some reason, the tarball doesn't include `test/test_prepared.py` (which is modified by the patch as well), so the patch can't be applied clearly. I use `filterdiff` (from `patchutils` package) to apply the required changes. [0] https://github.com/pgbouncer/pgbouncer/commit/a7b3c0a5f4caa9dbe92743d04cf1e28c4c05806c --- vm-image-spec.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vm-image-spec.yaml b/vm-image-spec.yaml index 2aa935fac6..d0ba742a63 100644 --- a/vm-image-spec.yaml +++ b/vm-image-spec.yaml @@ -88,11 +88,12 @@ build: | RUN set -e \ && apt-get update \ && apt-get install -y \ - curl \ build-essential \ - pkg-config \ + curl \ libevent-dev \ - libssl-dev + libssl-dev \ + patchutils \ + pkg-config ENV PGBOUNCER_VERSION 1.21.0 ENV PGBOUNCER_GITPATH 1_21_0 @@ -100,6 +101,7 @@ build: | && curl -sfSL https://github.com/pgbouncer/pgbouncer/releases/download/pgbouncer_${PGBOUNCER_GITPATH}/pgbouncer-${PGBOUNCER_VERSION}.tar.gz -o pgbouncer-${PGBOUNCER_VERSION}.tar.gz \ && tar xzvf pgbouncer-${PGBOUNCER_VERSION}.tar.gz \ && cd pgbouncer-${PGBOUNCER_VERSION} \ + && curl https://github.com/pgbouncer/pgbouncer/commit/a7b3c0a5f4caa9dbe92743d04cf1e28c4c05806c.patch | filterdiff --include a/src/server.c | patch -p1 \ && LDFLAGS=-static ./configure --prefix=/usr/local/pgbouncer --without-openssl \ && make -j $(nproc) \ && make install