diff --git a/doc/xml/release/2024/2.52.xml b/doc/xml/release/2024/2.52.xml index 0cd8facd2..423e59edd 100644 --- a/doc/xml/release/2024/2.52.xml +++ b/doc/xml/release/2024/2.52.xml @@ -13,6 +13,17 @@

S3 SSE-C encryption support.

+ + + + + + + + + +

PostgreSQL 17 support.

+
diff --git a/src/build/postgres/postgres.yaml b/src/build/postgres/postgres.yaml index 4e303e0e5..706c6e4d2 100644 --- a/src/build/postgres/postgres.yaml +++ b/src/build/postgres/postgres.yaml @@ -15,3 +15,5 @@ version: - 14 - 15 - 16 + - 17: + release: false diff --git a/src/postgres/interface/version.vendor.h b/src/postgres/interface/version.vendor.h index ab631940a..9c8f75331 100644 --- a/src/postgres/interface/version.vendor.h +++ b/src/postgres/interface/version.vendor.h @@ -158,6 +158,19 @@ Types from src/include/catalog/catversion.h // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX +#elif PG_VERSION >= PG_VERSION_17 + +/* + * We could use anything we wanted for version numbers, but I recommend + * following the "YYYYMMDDN" style often used for DNS zone serial numbers. + * YYYYMMDD are the date of the change, and N is the number of the change + * on that day. (Hopefully we'll never commit ten independent sets of + * catalog changes on the same day...) + */ + +/* yyyymmddN */ +#define CATALOG_VERSION_NO 202404021 + #elif PG_VERSION >= PG_VERSION_16 /* @@ -576,7 +589,7 @@ typedef enum DBState DB_SHUTDOWNING, DB_IN_CRASH_RECOVERY, DB_IN_ARCHIVE_RECOVERY, - DB_IN_PRODUCTION + DB_IN_PRODUCTION, } DBState; #endif @@ -1567,6 +1580,10 @@ Types from src/include/access/xlog_internal.h // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX +#elif PG_VERSION >= PG_VERSION_17 + +#define XLOG_PAGE_MAGIC 0xD115 /* can be used as WAL version indicator */ + #elif PG_VERSION >= PG_VERSION_16 #define XLOG_PAGE_MAGIC 0xD113 /* can be used as WAL version indicator */ diff --git a/src/postgres/version.auto.h b/src/postgres/version.auto.h index 608a9c181..43d14ee71 100644 --- a/src/postgres/version.auto.h +++ b/src/postgres/version.auto.h @@ -19,8 +19,9 @@ PostgreSQL version constants #define PG_VERSION_14 140000 #define PG_VERSION_15 150000 #define PG_VERSION_16 160000 +#define PG_VERSION_17 170000 -#define PG_VERSION_MAX PG_VERSION_16 +#define PG_VERSION_MAX PG_VERSION_17 /*********************************************************************************************************************************** PostgreSQL version string constants for use in error messages @@ -35,5 +36,6 @@ PostgreSQL version string constants for use in error messages #define PG_VERSION_14_Z "14" #define PG_VERSION_15_Z "15" #define PG_VERSION_16_Z "16" +#define PG_VERSION_17_Z "17" #endif diff --git a/test/container.yaml b/test/container.yaml index 4ba5bd6e3..32debb227 100644 --- a/test/container.yaml +++ b/test/container.yaml @@ -12,11 +12,14 @@ # - docker login -u pgbackrest # - VM=XXX;DATE=YYYYMMDDX;BASE=pgbackrest/test:${VM?}-base;docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?} # ********************************************************************************************************************************** +20240417A: + x86_64: + u22: 287933d006d8780a521dac6409f4910ebafe6ded + 20231109A: x86_64: d10: 927b594d0f0319c19d692947f9218a4474cf8cd6 u20: 51041e6806d2d05ccefbd8a2ab23f2c9e42a7997 - u22: 287933d006d8780a521dac6409f4910ebafe6ded 20230622A: x86_64: diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm index 5b5eda49c..f2d7b4360 100644 --- a/test/lib/pgBackRestTest/Common/ContainerTest.pm +++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm @@ -510,9 +510,13 @@ sub containerBuild $strScript .= " echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg main" . "\" >> /etc/apt/sources.list.d/pgdg.list && \\\n" . + ($strOS eq VM_U22 ? + " echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg-snapshot main 17\"" . + " >> /etc/apt/sources.list.d/pgdg.list && \\\n" : '') . " wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \\\n" . " apt-get update && \\\n" . - " apt-get install -y --no-install-recommends postgresql-common libpq-dev && \\\n" . + " apt-get install -y --no-install-recommends" . + ($strOS eq VM_U22 ? " -t \$(lsb_release -s -c)-pgdg-snapshot" : '') . " postgresql-common libpq-dev && \\\n" . " sed -i 's/^\\#create\\_main\\_cluster.*\$/create\\_main\\_cluster \\= false/' " . "/etc/postgresql-common/createcluster.conf"; } @@ -528,7 +532,9 @@ sub containerBuild } else { - $strScript .= " apt-get install -y --no-install-recommends"; + $strScript .= + " apt-get install -y --no-install-recommends" . + ($strOS eq VM_U22 ? " -t \$(lsb_release -s -c)-pgdg-snapshot" : ''); } # Construct list of databases to install diff --git a/test/lib/pgBackRestTest/Common/DbVersion.pm b/test/lib/pgBackRestTest/Common/DbVersion.pm index 83ad74ac3..bb737273d 100644 --- a/test/lib/pgBackRestTest/Common/DbVersion.pm +++ b/test/lib/pgBackRestTest/Common/DbVersion.pm @@ -35,6 +35,8 @@ use constant PG_VERSION_15 => '15'; push @EXPORT, qw(PG_VERSION_15); use constant PG_VERSION_16 => '16'; push @EXPORT, qw(PG_VERSION_16); +use constant PG_VERSION_17 => '17'; + push @EXPORT, qw(PG_VERSION_17); #################################################################################################################################### # versionSupport @@ -47,7 +49,7 @@ sub versionSupport my ($strOperation) = logDebugParam(__PACKAGE__ . '->versionSupport'); my @strySupportVersion = (PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, PG_VERSION_10, PG_VERSION_11, PG_VERSION_12, - PG_VERSION_13, PG_VERSION_14, PG_VERSION_15, PG_VERSION_16); + PG_VERSION_13, PG_VERSION_14, PG_VERSION_15, PG_VERSION_16, PG_VERSION_17); # Return from function and log return values if any return logDebugReturn diff --git a/test/lib/pgBackRestTest/Common/VmTest.pm b/test/lib/pgBackRestTest/Common/VmTest.pm index 95c2aace7..d1a077a72 100644 --- a/test/lib/pgBackRestTest/Common/VmTest.pm +++ b/test/lib/pgBackRestTest/Common/VmTest.pm @@ -174,6 +174,7 @@ my $oyVm = PG_VERSION_12, PG_VERSION_13, PG_VERSION_14, + PG_VERSION_15, ], }, @@ -258,14 +259,15 @@ my $oyVm = PG_VERSION_14, PG_VERSION_15, PG_VERSION_16, + PG_VERSION_17, ], &VM_DB_TEST => [ PG_VERSION_95, PG_VERSION_10, - PG_VERSION_15, PG_VERSION_16, + PG_VERSION_17, ], }, }; diff --git a/test/src/common/harnessPostgres.c b/test/src/common/harnessPostgres.c index c636e7293..e2cd94744 100644 --- a/test/src/common/harnessPostgres.c +++ b/test/src/common/harnessPostgres.c @@ -51,6 +51,10 @@ uint32_t hrnPgInterfaceCatalogVersion160(void); void hrnPgInterfaceControl160(unsigned int controlVersion, unsigned int crc, PgControl pgControl, unsigned char *buffer); void hrnPgInterfaceWal160(unsigned int magic, PgWal pgWal, unsigned char *buffer); +uint32_t hrnPgInterfaceCatalogVersion170(void); +void hrnPgInterfaceControl170(unsigned int controlVersion, unsigned int crc, PgControl pgControl, unsigned char *buffer); +void hrnPgInterfaceWal170(unsigned int magic, PgWal pgWal, unsigned char *buffer); + typedef struct HrnPgInterface { // Version of PostgreSQL supported by this interface @@ -68,6 +72,13 @@ typedef struct HrnPgInterface static const HrnPgInterface hrnPgInterface[] = { + { + .version = PG_VERSION_17, + + .catalogVersion = hrnPgInterfaceCatalogVersion170, + .control = hrnPgInterfaceControl170, + .wal = hrnPgInterfaceWal170, + }, { .version = PG_VERSION_16, diff --git a/test/src/common/harnessPostgres.h b/test/src/common/harnessPostgres.h index 27953abdd..bc91aa113 100644 --- a/test/src/common/harnessPostgres.h +++ b/test/src/common/harnessPostgres.h @@ -39,6 +39,8 @@ System id constants by version #define HRN_PG_SYSTEMID_15_Z "10000000000000150000" #define HRN_PG_SYSTEMID_16 (10000000000000000000ULL + (uint64_t)PG_VERSION_16) #define HRN_PG_SYSTEMID_16_Z "10000000000000160000" +#define HRN_PG_SYSTEMID_17 (10000000000000000000ULL + (uint64_t)PG_VERSION_17) +#define HRN_PG_SYSTEMID_17_Z "10000000000000170000" /*********************************************************************************************************************************** Put a control file to storage diff --git a/test/src/common/harnessPostgres/harness170.c b/test/src/common/harnessPostgres/harness170.c new file mode 100644 index 000000000..65450fbf1 --- /dev/null +++ b/test/src/common/harnessPostgres/harness170.c @@ -0,0 +1,10 @@ +/*********************************************************************************************************************************** +Harness for PostgreSQL Interface (see PG_VERSION for version) +***********************************************************************************************************************************/ +#include "build.auto.h" + +#define PG_VERSION PG_VERSION_17 + +#include "common/harnessPostgres/harnessVersion.intern.h" + +HRN_PG_INTERFACE(170); diff --git a/test/src/module/integration/allTest.c b/test/src/module/integration/allTest.c index d749731fa..d54b6a5b4 100644 --- a/test/src/module/integration/allTest.c +++ b/test/src/module/integration/allTest.c @@ -28,6 +28,7 @@ static HrnHostTestDefine testMatrix[] = {.pg = "14", .repo = "repo", .tls = 0, .stg = "gcs", .enc = 0, .cmp = "lz4", .rt = 1, .bnd = 1, .bi = 0}, {.pg = "15", .repo = "pg2", .tls = 0, .stg = "azure", .enc = 0, .cmp = "none", .rt = 2, .bnd = 1, .bi = 1}, {.pg = "16", .repo = "repo", .tls = 0, .stg = "posix", .enc = 0, .cmp = "none", .rt = 1, .bnd = 0, .bi = 0}, + {.pg = "17", .repo = "repo", .tls = 0, .stg = "posix", .enc = 0, .cmp = "none", .rt = 1, .bnd = 0, .bi = 0}, // {uncrustify_on} }; diff --git a/test/src/module/postgres/interfaceTest.c b/test/src/module/postgres/interfaceTest.c index e015b610d..7a4208835 100644 --- a/test/src/module/postgres/interfaceTest.c +++ b/test/src/module/postgres/interfaceTest.c @@ -61,6 +61,7 @@ testRun(void) "HINT: is this version of PostgreSQL supported?"); TEST_RESULT_UINT(pgControlVersion(PG_VERSION_94), 942, "9.4 control version"); TEST_RESULT_UINT(pgControlVersion(PG_VERSION_11), 1100, "11 control version"); + TEST_RESULT_UINT(pgControlVersion(PG_VERSION_17), 1300, "17 control version"); } // ***************************************************************************************************************************** @@ -146,7 +147,7 @@ testRun(void) pgControlFromFile(storageTest, NULL), FormatError, "wal segment size is 47 but must be a power of two between 1048576 and 1073741824 inclusive"); - HRN_PG_CONTROL_PUT(storageTest, PG_VERSION_11, .walSegmentSize = (unsigned int)2 * 1024 * 1024 * 1024); + HRN_PG_CONTROL_PUT(storageTest, PG_VERSION_17, .walSegmentSize = (unsigned int)2 * 1024 * 1024 * 1024); TEST_ERROR( pgControlFromFile(storageTest, NULL), FormatError, @@ -231,13 +232,13 @@ testRun(void) TEST_RESULT_UINT(info.pageSize, pgPageSize16, "check page size"); HRN_PG_CONTROL_PUT( - storageTest, PG_VERSION_16, .systemId = 0xEFEFEFEFEF, .catalogVersion = hrnPgCatalogVersion(PG_VERSION_16), + storageTest, PG_VERSION_17, .systemId = 0xEFEFEFEFEF, .catalogVersion = hrnPgCatalogVersion(PG_VERSION_17), .checkpoint = 0xAABBAABBEEFFEEFF, .timeline = 88, .pageSize = pgPageSize32); TEST_ASSIGN(info, pgControlFromFile(storageTest, NULL), "get control info"); - TEST_RESULT_UINT(info.systemId, 0xEFEFEFEFEF, " check system id"); - TEST_RESULT_UINT(info.version, PG_VERSION_16, "check version"); - TEST_RESULT_UINT(info.catalogVersion, 202307071, "check catalog version"); + TEST_RESULT_UINT(info.systemId, 0xEFEFEFEFEF, "check system id"); + TEST_RESULT_UINT(info.version, PG_VERSION_17, "check version"); + TEST_RESULT_UINT(info.catalogVersion, 202404021, "check catalog version"); TEST_RESULT_UINT(info.checkpoint, 0xAABBAABBEEFFEEFF, "check checkpoint"); TEST_RESULT_UINT(info.timeline, 88, "check timeline"); TEST_RESULT_UINT(info.pageSize, pgPageSize32, "check page size");