diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a34a4b3..5d0f177a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -77,7 +77,7 @@ jobs: wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt-get update # Setup build deps - sudo apt-get install -y libsnappy-dev postgresql-10 postgresql-11 postgresql-12 postgresql-13 postgresql-14 postgresql-15 + sudo apt-get install -y libsnappy-dev postgresql-10 postgresql-11 postgresql-12 postgresql-13 postgresql-14 postgresql-15 postgresql-16 # Setup common python dependencies python -m pip install --upgrade pip pip install -r requirements.txt diff --git a/pghoard/config.py b/pghoard/config.py index 309c5f3f..52712c07 100644 --- a/pghoard/config.py +++ b/pghoard/config.py @@ -17,7 +17,7 @@ from pghoard.common import (extract_pg_command_version_string, pg_major_version, pg_version_string_to_number) from pghoard.postgres_command import PGHOARD_HOST, PGHOARD_PORT -SUPPORTED_VERSIONS = ["14", "13", "12", "11", "10", "9.6", "9.5", "9.4", "9.3"] +SUPPORTED_VERSIONS = ["16", "15", "14", "13", "12", "11", "10", "9.6", "9.5", "9.4", "9.3"] def get_cpu_count(): diff --git a/pghoard/restore.py b/pghoard/restore.py index 9f78e33d..fa1cc7f3 100644 --- a/pghoard/restore.py +++ b/pghoard/restore.py @@ -116,18 +116,21 @@ def create_recovery_conf( with open(os.path.join(dirpath, "PG_VERSION"), "r") as fp: pg_version = LooseVersion(fp.read().strip()) - if pg_version >= "12": - trigger_file_setting = "promote_trigger_file" - else: + trigger_file_setting = None + if pg_version < "12": trigger_file_setting = "trigger_file" + elif pg_version < "16": # PG 16 has removed `promote_trigger_file` config param. + trigger_file_setting = "promote_trigger_file" lines = [ "# pghoard created recovery.conf", "recovery_target_timeline = 'latest'", - "{} = {}".format(trigger_file_setting, adapt("trigger_file")), "restore_command = '{}'".format(" ".join(restore_command)), ] + if trigger_file_setting: + lines.append("{} = {}".format(trigger_file_setting, adapt("trigger_file"))) + use_recovery_conf = (pg_version < "12") # no more recovery.conf in PG >= 12 if not restore_to_primary: if use_recovery_conf: diff --git a/pghoard/wal.py b/pghoard/wal.py index 116ec90c..58f55ede 100644 --- a/pghoard/wal.py +++ b/pghoard/wal.py @@ -31,6 +31,7 @@ 0xD106: 130000, 0xD10D: 140000, 0xD110: 150000, + 0xD113: 160000, } WAL_MAGIC_BY_VERSION = {value: key for key, value in WAL_MAGIC.items()} diff --git a/test/conftest.py b/test/conftest.py index dde73f9c..4ebab8d3 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -34,7 +34,7 @@ logutil.configure_logging() -DEFAULT_PG_VERSIONS = ["15", "14", "13", "12", "11", "10"] +DEFAULT_PG_VERSIONS = ["16", "15", "14", "13", "12", "11", "10"] def port_is_listening(hostname: str, port: int, timeout: float = 0.5) -> bool: