1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

PostgreSQL 17 Support.

Add catalog version and WAL magic for PostgreSQL 17.
This commit is contained in:
David Steele
2024-04-18 10:56:24 +10:00
committed by GitHub
parent c8cf8e1f2b
commit fb22f04555
13 changed files with 82 additions and 12 deletions
+4 -1
View File
@@ -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:
@@ -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
+3 -1
View File
@@ -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
+3 -1
View File
@@ -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,
],
},
};
+11
View File
@@ -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,
+2
View File
@@ -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
@@ -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);
+1
View File
@@ -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}
};
+6 -5
View File
@@ -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");