You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-17 01:12:23 +02:00
PostgreSQL 17 Support.
Add catalog version and WAL magic for PostgreSQL 17.
This commit is contained in:
@ -13,6 +13,17 @@
|
|||||||
|
|
||||||
<p><proper>S3</proper> <id>SSE-C</id> encryption support.</p>
|
<p><proper>S3</proper> <id>SSE-C</id> encryption support.</p>
|
||||||
</release-item>
|
</release-item>
|
||||||
|
|
||||||
|
<release-item>
|
||||||
|
<github-pull-request id="2328"/>
|
||||||
|
|
||||||
|
<release-item-contributor-list>
|
||||||
|
<release-item-contributor id="david.steele"/>
|
||||||
|
<release-item-reviewer id="stefan.fercot"/>
|
||||||
|
</release-item-contributor-list>
|
||||||
|
|
||||||
|
<p><proper>PostgreSQL</proper> 17 support. </p>
|
||||||
|
</release-item>
|
||||||
</release-feature-list>
|
</release-feature-list>
|
||||||
|
|
||||||
<release-improvement-list>
|
<release-improvement-list>
|
||||||
|
@ -15,3 +15,5 @@ version:
|
|||||||
- 14
|
- 14
|
||||||
- 15
|
- 15
|
||||||
- 16
|
- 16
|
||||||
|
- 17:
|
||||||
|
release: false
|
||||||
|
@ -158,6 +158,19 @@ Types from src/include/catalog/catversion.h
|
|||||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||||
#if PG_VERSION > PG_VERSION_MAX
|
#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
|
#elif PG_VERSION >= PG_VERSION_16
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -576,7 +589,7 @@ typedef enum DBState
|
|||||||
DB_SHUTDOWNING,
|
DB_SHUTDOWNING,
|
||||||
DB_IN_CRASH_RECOVERY,
|
DB_IN_CRASH_RECOVERY,
|
||||||
DB_IN_ARCHIVE_RECOVERY,
|
DB_IN_ARCHIVE_RECOVERY,
|
||||||
DB_IN_PRODUCTION
|
DB_IN_PRODUCTION,
|
||||||
} DBState;
|
} DBState;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -1567,6 +1580,10 @@ Types from src/include/access/xlog_internal.h
|
|||||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||||
#if PG_VERSION > PG_VERSION_MAX
|
#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
|
#elif PG_VERSION >= PG_VERSION_16
|
||||||
|
|
||||||
#define XLOG_PAGE_MAGIC 0xD113 /* can be used as WAL version indicator */
|
#define XLOG_PAGE_MAGIC 0xD113 /* can be used as WAL version indicator */
|
||||||
|
@ -19,8 +19,9 @@ PostgreSQL version constants
|
|||||||
#define PG_VERSION_14 140000
|
#define PG_VERSION_14 140000
|
||||||
#define PG_VERSION_15 150000
|
#define PG_VERSION_15 150000
|
||||||
#define PG_VERSION_16 160000
|
#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
|
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_14_Z "14"
|
||||||
#define PG_VERSION_15_Z "15"
|
#define PG_VERSION_15_Z "15"
|
||||||
#define PG_VERSION_16_Z "16"
|
#define PG_VERSION_16_Z "16"
|
||||||
|
#define PG_VERSION_17_Z "17"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,11 +12,14 @@
|
|||||||
# - docker login -u pgbackrest
|
# - docker login -u pgbackrest
|
||||||
# - VM=XXX;DATE=YYYYMMDDX;BASE=pgbackrest/test:${VM?}-base;docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?}
|
# - VM=XXX;DATE=YYYYMMDDX;BASE=pgbackrest/test:${VM?}-base;docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?}
|
||||||
# **********************************************************************************************************************************
|
# **********************************************************************************************************************************
|
||||||
|
20240417A:
|
||||||
|
x86_64:
|
||||||
|
u22: 287933d006d8780a521dac6409f4910ebafe6ded
|
||||||
|
|
||||||
20231109A:
|
20231109A:
|
||||||
x86_64:
|
x86_64:
|
||||||
d10: 927b594d0f0319c19d692947f9218a4474cf8cd6
|
d10: 927b594d0f0319c19d692947f9218a4474cf8cd6
|
||||||
u20: 51041e6806d2d05ccefbd8a2ab23f2c9e42a7997
|
u20: 51041e6806d2d05ccefbd8a2ab23f2c9e42a7997
|
||||||
u22: 287933d006d8780a521dac6409f4910ebafe6ded
|
|
||||||
|
|
||||||
20230622A:
|
20230622A:
|
||||||
x86_64:
|
x86_64:
|
||||||
|
@ -510,9 +510,13 @@ sub containerBuild
|
|||||||
$strScript .=
|
$strScript .=
|
||||||
" echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg main" .
|
" echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg main" .
|
||||||
"\" >> /etc/apt/sources.list.d/pgdg.list && \\\n" .
|
"\" >> /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" .
|
" wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \\\n" .
|
||||||
" apt-get update && \\\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/' " .
|
" sed -i 's/^\\#create\\_main\\_cluster.*\$/create\\_main\\_cluster \\= false/' " .
|
||||||
"/etc/postgresql-common/createcluster.conf";
|
"/etc/postgresql-common/createcluster.conf";
|
||||||
}
|
}
|
||||||
@ -528,7 +532,9 @@ sub containerBuild
|
|||||||
}
|
}
|
||||||
else
|
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
|
# Construct list of databases to install
|
||||||
|
@ -35,6 +35,8 @@ use constant PG_VERSION_15 => '15';
|
|||||||
push @EXPORT, qw(PG_VERSION_15);
|
push @EXPORT, qw(PG_VERSION_15);
|
||||||
use constant PG_VERSION_16 => '16';
|
use constant PG_VERSION_16 => '16';
|
||||||
push @EXPORT, qw(PG_VERSION_16);
|
push @EXPORT, qw(PG_VERSION_16);
|
||||||
|
use constant PG_VERSION_17 => '17';
|
||||||
|
push @EXPORT, qw(PG_VERSION_17);
|
||||||
|
|
||||||
####################################################################################################################################
|
####################################################################################################################################
|
||||||
# versionSupport
|
# versionSupport
|
||||||
@ -47,7 +49,7 @@ sub versionSupport
|
|||||||
my ($strOperation) = logDebugParam(__PACKAGE__ . '->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,
|
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 from function and log return values if any
|
||||||
return logDebugReturn
|
return logDebugReturn
|
||||||
|
@ -174,6 +174,7 @@ my $oyVm =
|
|||||||
PG_VERSION_12,
|
PG_VERSION_12,
|
||||||
PG_VERSION_13,
|
PG_VERSION_13,
|
||||||
PG_VERSION_14,
|
PG_VERSION_14,
|
||||||
|
PG_VERSION_15,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -258,14 +259,15 @@ my $oyVm =
|
|||||||
PG_VERSION_14,
|
PG_VERSION_14,
|
||||||
PG_VERSION_15,
|
PG_VERSION_15,
|
||||||
PG_VERSION_16,
|
PG_VERSION_16,
|
||||||
|
PG_VERSION_17,
|
||||||
],
|
],
|
||||||
|
|
||||||
&VM_DB_TEST =>
|
&VM_DB_TEST =>
|
||||||
[
|
[
|
||||||
PG_VERSION_95,
|
PG_VERSION_95,
|
||||||
PG_VERSION_10,
|
PG_VERSION_10,
|
||||||
PG_VERSION_15,
|
|
||||||
PG_VERSION_16,
|
PG_VERSION_16,
|
||||||
|
PG_VERSION_17,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -51,6 +51,10 @@ uint32_t hrnPgInterfaceCatalogVersion160(void);
|
|||||||
void hrnPgInterfaceControl160(unsigned int controlVersion, unsigned int crc, PgControl pgControl, unsigned char *buffer);
|
void hrnPgInterfaceControl160(unsigned int controlVersion, unsigned int crc, PgControl pgControl, unsigned char *buffer);
|
||||||
void hrnPgInterfaceWal160(unsigned int magic, PgWal pgWal, 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
|
typedef struct HrnPgInterface
|
||||||
{
|
{
|
||||||
// Version of PostgreSQL supported by this interface
|
// Version of PostgreSQL supported by this interface
|
||||||
@ -68,6 +72,13 @@ typedef struct HrnPgInterface
|
|||||||
|
|
||||||
static const HrnPgInterface hrnPgInterface[] =
|
static const HrnPgInterface hrnPgInterface[] =
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
.version = PG_VERSION_17,
|
||||||
|
|
||||||
|
.catalogVersion = hrnPgInterfaceCatalogVersion170,
|
||||||
|
.control = hrnPgInterfaceControl170,
|
||||||
|
.wal = hrnPgInterfaceWal170,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.version = PG_VERSION_16,
|
.version = PG_VERSION_16,
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@ System id constants by version
|
|||||||
#define HRN_PG_SYSTEMID_15_Z "10000000000000150000"
|
#define HRN_PG_SYSTEMID_15_Z "10000000000000150000"
|
||||||
#define HRN_PG_SYSTEMID_16 (10000000000000000000ULL + (uint64_t)PG_VERSION_16)
|
#define HRN_PG_SYSTEMID_16 (10000000000000000000ULL + (uint64_t)PG_VERSION_16)
|
||||||
#define HRN_PG_SYSTEMID_16_Z "10000000000000160000"
|
#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
|
Put a control file to storage
|
||||||
|
10
test/src/common/harnessPostgres/harness170.c
Normal file
10
test/src/common/harnessPostgres/harness170.c
Normal file
@ -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);
|
@ -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 = "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 = "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 = "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}
|
// {uncrustify_on}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ testRun(void)
|
|||||||
"HINT: is this version of PostgreSQL supported?");
|
"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_94), 942, "9.4 control version");
|
||||||
TEST_RESULT_UINT(pgControlVersion(PG_VERSION_11), 1100, "11 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,
|
pgControlFromFile(storageTest, NULL), FormatError,
|
||||||
"wal segment size is 47 but must be a power of two between 1048576 and 1073741824 inclusive");
|
"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(
|
TEST_ERROR(
|
||||||
pgControlFromFile(storageTest, NULL), FormatError,
|
pgControlFromFile(storageTest, NULL), FormatError,
|
||||||
@ -231,13 +232,13 @@ testRun(void)
|
|||||||
TEST_RESULT_UINT(info.pageSize, pgPageSize16, "check page size");
|
TEST_RESULT_UINT(info.pageSize, pgPageSize16, "check page size");
|
||||||
|
|
||||||
HRN_PG_CONTROL_PUT(
|
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);
|
.checkpoint = 0xAABBAABBEEFFEEFF, .timeline = 88, .pageSize = pgPageSize32);
|
||||||
|
|
||||||
TEST_ASSIGN(info, pgControlFromFile(storageTest, NULL), "get control info");
|
TEST_ASSIGN(info, pgControlFromFile(storageTest, NULL), "get control info");
|
||||||
TEST_RESULT_UINT(info.systemId, 0xEFEFEFEFEF, " check system id");
|
TEST_RESULT_UINT(info.systemId, 0xEFEFEFEFEF, "check system id");
|
||||||
TEST_RESULT_UINT(info.version, PG_VERSION_16, "check version");
|
TEST_RESULT_UINT(info.version, PG_VERSION_17, "check version");
|
||||||
TEST_RESULT_UINT(info.catalogVersion, 202307071, "check catalog version");
|
TEST_RESULT_UINT(info.catalogVersion, 202404021, "check catalog version");
|
||||||
TEST_RESULT_UINT(info.checkpoint, 0xAABBAABBEEFFEEFF, "check checkpoint");
|
TEST_RESULT_UINT(info.checkpoint, 0xAABBAABBEEFFEEFF, "check checkpoint");
|
||||||
TEST_RESULT_UINT(info.timeline, 88, "check timeline");
|
TEST_RESULT_UINT(info.timeline, 88, "check timeline");
|
||||||
TEST_RESULT_UINT(info.pageSize, pgPageSize32, "check page size");
|
TEST_RESULT_UINT(info.pageSize, pgPageSize32, "check page size");
|
||||||
|
Reference in New Issue
Block a user