Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL 16 support #992

Merged
merged 22 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
88f7ca4
add init setup pg16 (#913)
idanovinda Sep 1, 2023
13fa3ef
Fix tests for pg16 (#914)
idanovinda Sep 11, 2023
76bbb93
Enable build and push of dev-16 branch (#919)
idanovinda Sep 12, 2023
9f4f7d3
Bump BGMON version (#922)
idanovinda Sep 15, 2023
50f66a2
Update available extensions for pg16 (#934)
idanovinda Oct 11, 2023
41fd7b4
Reflect refactor tests from master branch (#936)
idanovinda Oct 11, 2023
44aff30
Tiny tests fix (#946)
hughcapet Nov 13, 2023
d170d49
Adjust extensions build/installation process for pg16 (#945)
hughcapet Nov 13, 2023
e75167e
Update timescaledb versions (#947)
hughcapet Nov 17, 2023
46d7360
Remove amcheck_next installation, removal (#949)
hughcapet Nov 27, 2023
8f1283c
Add pg_partman to shared_preload_libraries for pg16 (#952)
hughcapet Nov 30, 2023
952d151
add timescaledb version 2.13.0 to PG16 (#951)
jopadi Dec 8, 2023
2b2d42d
add last commit from bg_mon (#956)
jopadi Dec 13, 2023
a4fbfee
Sync dev-16 branch with the latest changes (#973)
hughcapet Feb 21, 2024
465d2d2
Update timescaledb and pg_profile (#977)
hughcapet Feb 29, 2024
708c4fe
Enable tagging on dev-16 branch (#978)
hughcapet Mar 6, 2024
c3781ec
Don't try to build pg_mon for DEMO build (#983)
hughcapet Mar 7, 2024
a8444fa
Merge branch 'master' into dev-16
hughcapet Apr 15, 2024
3bfaa4c
Remove build on push to dev-16 branch
hughcapet Apr 15, 2024
77a141a
Update pg_mon and pg_profile
hughcapet Apr 15, 2024
816392f
Revert tagging for dev-16 push as well
hughcapet Apr 15, 2024
2a577ee
Remove redundant diff
hughcapet May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pipeline:
- id: push-spilo-ecr
env:
BASE_IMAGE: container-registry.zalando.net/library/ubuntu-22.04
PGVERSION: 15
PGVERSION: 16
MULTI_ARCH_REGISTRY: container-registry-test.zalando.net/acid
type: script
requires_human_approval: true
Expand Down
23 changes: 10 additions & 13 deletions postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_IMAGE=ubuntu:22.04
ARG PGVERSION=15
ARG TIMESCALEDB="1.7.5 2.3.1 2.11.2"
ARG PGVERSION=16
ARG TIMESCALEDB="2.3.1 2.11.2 2.14.2"
ARG DEMO=false
ARG COMPRESS=false
ARG ADDITIONAL_LOCALES=
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN bash /builddeps/prepare.sh

COPY --from=ubuntu-18 /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.18

COPY cron_unprivileged.c dependencies/src /builddeps/
COPY cron_unprivileged.c /builddeps/
COPY build_scripts/base.sh /builddeps/
COPY --from=dependencies-builder /builddeps/*.deb /builddeps/

Expand All @@ -48,25 +48,22 @@ ARG TIMESCALEDB
ARG TIMESCALEDB_APACHE_ONLY=true
ARG TIMESCALEDB_TOOLKIT=true
ARG COMPRESS
ARG PGOLDVERSIONS="10 11 12 13 14"
ARG PGOLDVERSIONS="11 12 13 14 15"
ARG WITH_PERL=false

ARG DEB_PG_SUPPORTED_VERSIONS="$PGOLDVERSIONS $PGVERSION"

# Install PostgreSQL, extensions and contribs
ENV POSTGIS_VERSION=3.4 \
POSTGIS_LEGACY=3.3 \
POSTGIS_SUPER_LEGACY=3.2 \
BG_MON_COMMIT=a0e7c93458ee7d96b0c95d9a0a4c5bc7a72ff5f4 \
PG_AUTH_MON_COMMIT=439697fe2980cf48f1760f45e04c2d69b2748e73 \
PG_MON_COMMIT=34c35a86e6dea26930bf1f770048cea2c695b80b \
BG_MON_COMMIT=ef60961eff92672b1e21f5260dc1211367da6f1f \
PG_AUTH_MON_COMMIT=3d010e5959285c32b155e8064c9c9b57869aeca7 \
PG_MON_COMMIT=a6c5982368edd876edbee01e51b91e7387071e21 \
SET_USER=REL4_0_1 \
PLPROFILER=fix/pg15-shmem \
PG_PROFILE=4.2 \
PLPROFILER=REL4_2_4 \
PG_PROFILE=4.5 \
PAM_OAUTH2=v1.0.1 \
PLANTUNER_COMMIT=800d81bc85da64ff3ef66e12aed1d4e1e54fc006 \
PG_PERMISSIONS_COMMIT=314b9359e3d77c0b2ef7dbbde97fa4be80e31925 \
PG_TM_AUX_COMMIT=51cf42f6043608919802fcc48458471d0ea3a127
PG_PERMISSIONS_COMMIT=314b9359e3d77c0b2ef7dbbde97fa4be80e31925

WORKDIR /builddeps
RUN bash base.sh
Expand Down
43 changes: 9 additions & 34 deletions postgres-appliance/build_scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ else
make -C pam-oauth2 install

# prepare 3rd sources
git clone -b "$PLPROFILER" https://github.com/hughcapet/plprofiler.git
tar -xzf "plantuner-${PLANTUNER_COMMIT}.tar.gz"
git clone -b "$PLPROFILER" https://github.com/bigsql/plprofiler.git
curl -sL "https://github.com/zalando-pg/pg_mon/archive/$PG_MON_COMMIT.tar.gz" | tar xz

for p in python3-keyring python3-docutils ieee-data; do
Expand All @@ -55,7 +54,6 @@ fi
curl -sL "https://github.com/zalando-pg/bg_mon/archive/$BG_MON_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/zalando-pg/pg_auth_mon/archive/$PG_AUTH_MON_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/cybertec-postgresql/pg_permissions/archive/$PG_PERMISSIONS_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/hughcapet/pg_tm_aux/archive/$PG_TM_AUX_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/zubkov-andrei/pg_profile/archive/$PG_PROFILE.tar.gz" | tar xz
git clone -b "$SET_USER" https://github.com/pgaudit/set_user.git
git clone https://github.com/timescale/timescaledb.git
Expand Down Expand Up @@ -96,28 +94,15 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
"postgresql-${version}-postgis-${POSTGIS_VERSION%.*}"
"postgresql-${version}-postgis-${POSTGIS_VERSION%.*}-scripts"
"postgresql-${version}-repack"
"postgresql-${version}-wal2json")

if [ "$version" != "15" ]; then
# not yet present for pg15
EXTRAS+=("postgresql-${version}-pllua")
fi
"postgresql-${version}-wal2json"
"postgresql-${version}-decoderbufs"
"postgresql-${version}-pllua"
"postgresql-${version}-pgvector")

if [ "$WITH_PERL" = "true" ]; then
EXTRAS+=("postgresql-plperl-${version}")
fi

if [ "${version%.*}" -ge 10 ]; then
EXTRAS+=("postgresql-${version}-decoderbufs")
fi

if [ "${version%.*}" -ge 11 ]; then
EXTRAS+=("postgresql-${version}-pgvector")
fi

if [ "${version%.*}" -lt 11 ]; then
EXTRAS+=("postgresql-${version}-amcheck")
fi
fi

# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
Expand Down Expand Up @@ -166,20 +151,15 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
rm /usr/share/keyrings/timescale_E7391C94080429FF.gpg
fi

EXTRA_EXTENSIONS=()
if [ "$DEMO" != "true" ]; then
EXTRA_EXTENSIONS=("plantuner-${PLANTUNER_COMMIT}" plprofiler)
if [ "${version%.*}" -ge 10 ]; then
EXTRA_EXTENSIONS+=("pg_mon-${PG_MON_COMMIT}")
fi
else
EXTRA_EXTENSIONS=()
EXTRA_EXTENSIONS+=("plprofiler" "pg_mon-${PG_MON_COMMIT}")
fi

for n in bg_mon-${BG_MON_COMMIT} \
pg_auth_mon-${PG_AUTH_MON_COMMIT} \
set_user \
pg_permissions-${PG_PERMISSIONS_COMMIT} \
pg_tm_aux-${PG_TM_AUX_COMMIT} \
pg_profile-${PG_PROFILE} \
"${EXTRA_EXTENSIONS[@]}"; do
make -C "$n" USE_PGXS=1 clean install-strip
Expand Down Expand Up @@ -281,17 +261,12 @@ if [ "$DEMO" != "true" ]; then
if [ "$v1" = "$v2" ]; then
started=1
elif [ $started = 1 ]; then

used_postgis_version=$POSTGIS_VERSION
if [ "${v1##*/}" = "11" ]; then used_postgis_version=$POSTGIS_LEGACY; fi

for d1 in extension contrib contrib/postgis-$used_postgis_version; do
for d1 in extension contrib contrib/postgis-$POSTGIS_VERSION; do
cd "$v1/$d1"
d2="$d1"
d1="../../${v1##*/}/$d1"
if [ "${d2%-*}" = "contrib/postgis" ]; then
if [ "${v2##*/}" = "11" ]; then d2="${d2%-*}-$POSTGIS_LEGACY"
elif [ "${v2##*/}" = "10" ]; then d2="${d2%-*}-$POSTGIS_SUPER_LEGACY"; fi
if [ "${v2##*/}" = "11" ]; then d2="${d2%-*}-$POSTGIS_LEGACY"; fi
d1="../$d1"
fi
d2="$v2/$d2"
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion postgres-appliance/major_upgrade/pg_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class _PostgresqlUpgrade(Postgresql):

_INCOMPATIBLE_EXTENSIONS = ('amcheck_next', 'pg_repack',)
_INCOMPATIBLE_EXTENSIONS = ('pg_repack',)

def adjust_shared_preload_libraries(self, version):
from spilo_commons import adjust_extensions
Expand Down
10 changes: 5 additions & 5 deletions postgres-appliance/scripts/spilo_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

# (min_version, max_version, shared_preload_libraries, extwlist.extensions)
extensions = {
'timescaledb': (9.6, 15, True, True),
'pg_cron': (9.5, 15, True, False),
'pg_stat_kcache': (9.4, 15, True, False),
'pg_partman': (9.4, 15, False, True)
'timescaledb': (9.6, 16, True, True),
'pg_cron': (9.5, 16, True, False),
'pg_stat_kcache': (9.4, 16, True, False),
'pg_partman': (9.4, 16, False, True)
}
if os.environ.get('ENABLE_PG_MON') == 'true':
extensions['pg_mon'] = (11, 15, True, False)
extensions['pg_mon'] = (11, 16, True, False)


def adjust_extensions(old, version, extwlist=False):
Expand Down
2 changes: 1 addition & 1 deletion postgres-appliance/tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ services:
postgresql:
parameters:
shared_buffers: 32MB
PGVERSION: '10'
PGVERSION: '11'
# Just to test upgrade with clone. Without CLONE_SCOPE they don't work
CLONE_WAL_S3_BUCKET: *bucket
CLONE_AWS_ACCESS_KEY_ID: *access_key
Expand Down
3 changes: 1 addition & 2 deletions postgres-appliance/tests/schema.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CREATE EXTENSION pg_repack;
CREATE EXTENSION amcheck_next; /* the upgrade script must delete it before running pg_upgrade --check! */
CREATE EXTENSION pg_repack; /* the upgrade script must delete it before running pg_upgrade --check! */

CREATE DATABASE test_db;
\c test_db
Expand Down
Loading
Loading