You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-07 00:35:37 +02:00
PostgreSQL 15 support.
PostgreSQL 15 drops support for exclusive backup and renames the start/stop backup commands. This is based on the pgdg-testing repo since beta1 has not been released yet, but it seems unlikely that breaking changes will be made at this point. beta1 should be tagged just before our next release so we'll retest before the release.
This commit is contained in:
@ -45,6 +45,22 @@
|
|||||||
</release-bug-list>
|
</release-bug-list>
|
||||||
|
|
||||||
<release-feature-list>
|
<release-feature-list>
|
||||||
|
<release-item>
|
||||||
|
<commit subject="Remove dependency on pg_database.datlastsysoid.">
|
||||||
|
<github-pull-request id="1735"/>
|
||||||
|
</commit>
|
||||||
|
<commit subject="PostgreSQL 15 support.">
|
||||||
|
<github-pull-request id="1736"/>
|
||||||
|
</commit>
|
||||||
|
|
||||||
|
<release-item-contributor-list>
|
||||||
|
<release-item-contributor id="david.steele"/>
|
||||||
|
<release-item-reviewer id="stefan.fercot"/>
|
||||||
|
</release-item-contributor-list>
|
||||||
|
|
||||||
|
<p><postgres/> 15 support.</p>
|
||||||
|
</release-item>
|
||||||
|
|
||||||
<release-item>
|
<release-item>
|
||||||
<commit subject="Refactor target type checking for clarity in restore module."/>
|
<commit subject="Refactor target type checking for clarity in restore module."/>
|
||||||
<commit subject="Auto-select backup for restore command --type=lsn.">
|
<commit subject="Auto-select backup for restore command --type=lsn.">
|
||||||
@ -169,19 +185,6 @@
|
|||||||
</release-improvement-list>
|
</release-improvement-list>
|
||||||
|
|
||||||
<release-development-list>
|
<release-development-list>
|
||||||
<release-item>
|
|
||||||
<commit subject="Remove dependency on pg_database.datlastsysoid.">
|
|
||||||
<github-pull-request id="1735"/>
|
|
||||||
</commit>
|
|
||||||
|
|
||||||
<release-item-contributor-list>
|
|
||||||
<release-item-contributor id="david.steele"/>
|
|
||||||
<release-item-reviewer id="stefan.fercot"/>
|
|
||||||
</release-item-contributor-list>
|
|
||||||
|
|
||||||
<p><postgres/> 15 support.</p>
|
|
||||||
</release-item>
|
|
||||||
|
|
||||||
<release-item>
|
<release-item>
|
||||||
<commit subject="Remove redundant restoreFile() test and improve coverage."/>
|
<commit subject="Remove redundant restoreFile() test and improve coverage."/>
|
||||||
<commit subject="Add limit parameter to ioCopyP()."/>
|
<commit subject="Add limit parameter to ioCopyP()."/>
|
||||||
|
24
src/db/db.c
24
src/db/db.c
@ -332,8 +332,8 @@ dbBackupStartQuery(unsigned int pgVersion, bool startFast)
|
|||||||
strNew(),
|
strNew(),
|
||||||
"select lsn::text as lsn,\n"
|
"select lsn::text as lsn,\n"
|
||||||
" pg_catalog.pg_%sfile_name(lsn)::text as wal_segment_name\n"
|
" pg_catalog.pg_%sfile_name(lsn)::text as wal_segment_name\n"
|
||||||
" from pg_catalog.pg_start_backup('" PROJECT_NAME " backup started at ' || current_timestamp",
|
" from pg_catalog.pg_%s('" PROJECT_NAME " backup started at ' || current_timestamp",
|
||||||
strZ(pgWalName(pgVersion)));
|
strZ(pgWalName(pgVersion)), pgVersion >= PG_VERSION_15 ? "backup_start" : "start_backup");
|
||||||
|
|
||||||
// Start backup after immediate checkpoint
|
// Start backup after immediate checkpoint
|
||||||
if (startFast)
|
if (startFast)
|
||||||
@ -345,7 +345,7 @@ dbBackupStartQuery(unsigned int pgVersion, bool startFast)
|
|||||||
strCatZ(result, ", " FALSE_Z);
|
strCatZ(result, ", " FALSE_Z);
|
||||||
|
|
||||||
// Use non-exclusive backup mode when available
|
// Use non-exclusive backup mode when available
|
||||||
if (pgVersion >= PG_VERSION_96)
|
if (pgVersion >= PG_VERSION_96 && pgVersion <= PG_VERSION_14)
|
||||||
strCatZ(result, ", " FALSE_Z);
|
strCatZ(result, ", " FALSE_Z);
|
||||||
|
|
||||||
// Complete query
|
// Complete query
|
||||||
@ -491,7 +491,7 @@ dbBackupStopQuery(unsigned int pgVersion)
|
|||||||
" pg_catalog.pg_%sfile_name(lsn)::text as wal_segment_name",
|
" pg_catalog.pg_%sfile_name(lsn)::text as wal_segment_name",
|
||||||
strZ(pgWalName(pgVersion)));
|
strZ(pgWalName(pgVersion)));
|
||||||
|
|
||||||
// For PostgreSQL >= 9.6 the backup label and tablespace map are returned from pg_stop_backup
|
// For PostgreSQL >= 9.6 the backup label and tablespace map are returned
|
||||||
if (pgVersion >= PG_VERSION_96)
|
if (pgVersion >= PG_VERSION_96)
|
||||||
{
|
{
|
||||||
strCatZ(
|
strCatZ(
|
||||||
@ -502,18 +502,24 @@ dbBackupStopQuery(unsigned int pgVersion)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build stop backup function
|
// Build stop backup function
|
||||||
strCatZ(
|
strCatFmt(
|
||||||
result,
|
result,
|
||||||
"\n"
|
"\n"
|
||||||
" from pg_catalog.pg_stop_backup(");
|
" from pg_catalog.pg_%s(",
|
||||||
|
pgVersion >= PG_VERSION_15 ? "backup_stop" : "stop_backup");
|
||||||
|
|
||||||
// Use non-exclusive backup mode when available
|
// Use non-exclusive backup mode when available
|
||||||
if (pgVersion >= PG_VERSION_96)
|
if (pgVersion >= PG_VERSION_96 && pgVersion <= PG_VERSION_14)
|
||||||
strCatZ(result, FALSE_Z);
|
strCatZ(result, FALSE_Z);
|
||||||
|
|
||||||
// Disable archive checking in pg_stop_backup() since we do this elsewhere
|
// Disable archive checking since we do this elsewhere
|
||||||
if (pgVersion >= PG_VERSION_10)
|
if (pgVersion >= PG_VERSION_10)
|
||||||
strCatZ(result, ", " FALSE_Z);
|
{
|
||||||
|
if (pgVersion <= PG_VERSION_14)
|
||||||
|
strCatZ(result, ", ");
|
||||||
|
|
||||||
|
strCatZ(result, FALSE_Z);
|
||||||
|
}
|
||||||
|
|
||||||
// Complete query
|
// Complete query
|
||||||
strCatZ(result, ")");
|
strCatZ(result, ")");
|
||||||
|
@ -797,7 +797,8 @@ manifestBuildCallback(void *data, const StorageInfo *info)
|
|||||||
FUNCTION_TEST_RETURN_VOID();
|
FUNCTION_TEST_RETURN_VOID();
|
||||||
|
|
||||||
// Skip temporary statistics in pg_stat_tmp even when stats_temp_directory is set because PGSS_TEXT_FILE is always
|
// Skip temporary statistics in pg_stat_tmp even when stats_temp_directory is set because PGSS_TEXT_FILE is always
|
||||||
// created there
|
// created there in PostgreSQL < 15. PostgreSQL >= 15 no longer uses this directory, but it may be used by
|
||||||
|
// extensions such as pg_stat_statements so it should still be excluded.
|
||||||
if (strEqZ(info->name, PG_PATH_PGSTATTMP))
|
if (strEqZ(info->name, PG_PATH_PGSTATTMP))
|
||||||
FUNCTION_TEST_RETURN_VOID();
|
FUNCTION_TEST_RETURN_VOID();
|
||||||
|
|
||||||
|
@ -79,6 +79,16 @@ typedef struct PgInterface
|
|||||||
|
|
||||||
static const PgInterface pgInterface[] =
|
static const PgInterface pgInterface[] =
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
.version = PG_VERSION_15,
|
||||||
|
|
||||||
|
.controlIs = pgInterfaceControlIs150,
|
||||||
|
.control = pgInterfaceControl150,
|
||||||
|
.controlVersion = pgInterfaceControlVersion150,
|
||||||
|
|
||||||
|
.walIs = pgInterfaceWalIs150,
|
||||||
|
.wal = pgInterfaceWal150,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.version = PG_VERSION_14,
|
.version = PG_VERSION_14,
|
||||||
|
|
||||||
|
12
src/postgres/interface/v150.c
Normal file
12
src/postgres/interface/v150.c
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/***********************************************************************************************************************************
|
||||||
|
PostgreSQL 15 Interface
|
||||||
|
|
||||||
|
See postgres/interface/version.intern.h for documentation.
|
||||||
|
***********************************************************************************************************************************/
|
||||||
|
#include "build.auto.h"
|
||||||
|
|
||||||
|
#define PG_VERSION PG_VERSION_15
|
||||||
|
|
||||||
|
#include "postgres/interface/version.intern.h"
|
||||||
|
|
||||||
|
PG_INTERFACE(150);
|
@ -81,4 +81,10 @@ uint32_t pgInterfaceControlVersion140(void);
|
|||||||
bool pgInterfaceWalIs140(const unsigned char *walFile);
|
bool pgInterfaceWalIs140(const unsigned char *walFile);
|
||||||
PgWal pgInterfaceWal140(const unsigned char *controlFile);
|
PgWal pgInterfaceWal140(const unsigned char *controlFile);
|
||||||
|
|
||||||
|
bool pgInterfaceControlIs150(const unsigned char *controlFile);
|
||||||
|
PgControl pgInterfaceControl150(const unsigned char *controlFile);
|
||||||
|
uint32_t pgInterfaceControlVersion150(void);
|
||||||
|
bool pgInterfaceWalIs150(const unsigned char *walFile);
|
||||||
|
PgWal pgInterfaceWal150(const unsigned char *controlFile);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -186,6 +186,22 @@ Types from src/include/catalog/catversion.h
|
|||||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||||
#if PG_VERSION > PG_VERSION_MAX
|
#if PG_VERSION > PG_VERSION_MAX
|
||||||
|
|
||||||
|
#elif PG_VERSION >= PG_VERSION_15
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 202204076
|
||||||
|
|
||||||
|
// Allow the catalog version to float during the PostgreSQL 15 beta/rc period
|
||||||
|
#define CATALOG_VERSION_NO_MAX
|
||||||
|
|
||||||
#elif PG_VERSION >= PG_VERSION_14
|
#elif PG_VERSION >= PG_VERSION_14
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -728,6 +744,142 @@ typedef enum DBState
|
|||||||
// ---------------------------------------------------------------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------------------------------------------------------------
|
||||||
#if PG_VERSION > PG_VERSION_MAX
|
#if PG_VERSION > PG_VERSION_MAX
|
||||||
|
|
||||||
|
#elif PG_VERSION >= PG_VERSION_15
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Contents of pg_control.
|
||||||
|
*/
|
||||||
|
typedef struct ControlFileData
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Unique system identifier --- to ensure we match up xlog files with the
|
||||||
|
* installation that produced them.
|
||||||
|
*/
|
||||||
|
uint64 system_identifier;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Version identifier information. Keep these fields at the same offset,
|
||||||
|
* especially pg_control_version; they won't be real useful if they move
|
||||||
|
* around. (For historical reasons they must be 8 bytes into the file
|
||||||
|
* rather than immediately at the front.)
|
||||||
|
*
|
||||||
|
* pg_control_version identifies the format of pg_control itself.
|
||||||
|
* catalog_version_no identifies the format of the system catalogs.
|
||||||
|
*
|
||||||
|
* There are additional version identifiers in individual files; for
|
||||||
|
* example, WAL logs contain per-page magic numbers that can serve as
|
||||||
|
* version cues for the WAL log.
|
||||||
|
*/
|
||||||
|
uint32 pg_control_version; /* PG_CONTROL_VERSION */
|
||||||
|
uint32 catalog_version_no; /* see catversion.h */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* System status data
|
||||||
|
*/
|
||||||
|
DBState state; /* see enum above */
|
||||||
|
pg_time_t time; /* time stamp of last pg_control update */
|
||||||
|
XLogRecPtr checkPoint; /* last check point record ptr */
|
||||||
|
|
||||||
|
CheckPoint checkPointCopy; /* copy of last check point record */
|
||||||
|
|
||||||
|
XLogRecPtr unloggedLSN; /* current fake LSN value, for unlogged rels */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These two values determine the minimum point we must recover up to
|
||||||
|
* before starting up:
|
||||||
|
*
|
||||||
|
* minRecoveryPoint is updated to the latest replayed LSN whenever we
|
||||||
|
* flush a data change during archive recovery. That guards against
|
||||||
|
* starting archive recovery, aborting it, and restarting with an earlier
|
||||||
|
* stop location. If we've already flushed data changes from WAL record X
|
||||||
|
* to disk, we mustn't start up until we reach X again. Zero when not
|
||||||
|
* doing archive recovery.
|
||||||
|
*
|
||||||
|
* backupStartPoint is the redo pointer of the backup start checkpoint, if
|
||||||
|
* we are recovering from an online backup and haven't reached the end of
|
||||||
|
* backup yet. It is reset to zero when the end of backup is reached, and
|
||||||
|
* we mustn't start up before that. A boolean would suffice otherwise, but
|
||||||
|
* we use the redo pointer as a cross-check when we see an end-of-backup
|
||||||
|
* record, to make sure the end-of-backup record corresponds the base
|
||||||
|
* backup we're recovering from.
|
||||||
|
*
|
||||||
|
* backupEndPoint is the backup end location, if we are recovering from an
|
||||||
|
* online backup which was taken from the standby and haven't reached the
|
||||||
|
* end of backup yet. It is initialized to the minimum recovery point in
|
||||||
|
* pg_control which was backed up last. It is reset to zero when the end
|
||||||
|
* of backup is reached, and we mustn't start up before that.
|
||||||
|
*
|
||||||
|
* If backupEndRequired is true, we know for sure that we're restoring
|
||||||
|
* from a backup, and must see a backup-end record before we can safely
|
||||||
|
* start up.
|
||||||
|
*/
|
||||||
|
XLogRecPtr minRecoveryPoint;
|
||||||
|
TimeLineID minRecoveryPointTLI;
|
||||||
|
XLogRecPtr backupStartPoint;
|
||||||
|
XLogRecPtr backupEndPoint;
|
||||||
|
bool backupEndRequired;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Parameter settings that determine if the WAL can be used for archival
|
||||||
|
* or hot standby.
|
||||||
|
*/
|
||||||
|
int wal_level;
|
||||||
|
bool wal_log_hints;
|
||||||
|
int MaxConnections;
|
||||||
|
int max_worker_processes;
|
||||||
|
int max_wal_senders;
|
||||||
|
int max_prepared_xacts;
|
||||||
|
int max_locks_per_xact;
|
||||||
|
bool track_commit_timestamp;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This data is used to check for hardware-architecture compatibility of
|
||||||
|
* the database and the backend executable. We need not check endianness
|
||||||
|
* explicitly, since the pg_control version will surely look wrong to a
|
||||||
|
* machine of different endianness, but we do need to worry about MAXALIGN
|
||||||
|
* and floating-point format. (Note: storage layout nominally also
|
||||||
|
* depends on SHORTALIGN and INTALIGN, but in practice these are the same
|
||||||
|
* on all architectures of interest.)
|
||||||
|
*
|
||||||
|
* Testing just one double value is not a very bulletproof test for
|
||||||
|
* floating-point compatibility, but it will catch most cases.
|
||||||
|
*/
|
||||||
|
uint32 maxAlign; /* alignment requirement for tuples */
|
||||||
|
double floatFormat; /* constant 1234567.0 */
|
||||||
|
#define FLOATFORMAT_VALUE 1234567.0
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This data is used to make sure that configuration of this database is
|
||||||
|
* compatible with the backend executable.
|
||||||
|
*/
|
||||||
|
uint32 blcksz; /* data block size for this DB */
|
||||||
|
uint32 relseg_size; /* blocks per segment of large relation */
|
||||||
|
|
||||||
|
uint32 xlog_blcksz; /* block size within WAL files */
|
||||||
|
uint32 xlog_seg_size; /* size of each WAL segment */
|
||||||
|
|
||||||
|
uint32 nameDataLen; /* catalog name field width */
|
||||||
|
uint32 indexMaxKeys; /* max number of columns in an index */
|
||||||
|
|
||||||
|
uint32 toast_max_chunk_size; /* chunk size in TOAST tables */
|
||||||
|
uint32 loblksize; /* chunk size in pg_largeobject */
|
||||||
|
|
||||||
|
bool float8ByVal; /* float8, int8, etc pass-by-value? */
|
||||||
|
|
||||||
|
/* Are data pages protected by checksums? Zero if no checksum version */
|
||||||
|
uint32 data_checksum_version;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Random nonce, used in authentication requests that need to proceed
|
||||||
|
* based on values that are cluster-unique, like a SASL exchange that
|
||||||
|
* failed at an early stage.
|
||||||
|
*/
|
||||||
|
char mock_authentication_nonce[MOCK_AUTH_NONCE_LEN];
|
||||||
|
|
||||||
|
/* CRC of all above ... MUST BE LAST! */
|
||||||
|
pg_crc32c crc;
|
||||||
|
} ControlFileData;
|
||||||
|
|
||||||
#elif PG_VERSION >= PG_VERSION_13
|
#elif PG_VERSION >= PG_VERSION_13
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1956,6 +2108,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_15
|
||||||
|
|
||||||
|
#define XLOG_PAGE_MAGIC 0xD110 /* can be used as WAL version indicator */
|
||||||
|
|
||||||
#elif PG_VERSION >= PG_VERSION_14
|
#elif PG_VERSION >= PG_VERSION_14
|
||||||
|
|
||||||
#define XLOG_PAGE_MAGIC 0xD10D /* can be used as WAL version indicator */
|
#define XLOG_PAGE_MAGIC 0xD10D /* can be used as WAL version indicator */
|
||||||
|
@ -24,8 +24,9 @@ PostgreSQL version constants
|
|||||||
#define PG_VERSION_12 120000
|
#define PG_VERSION_12 120000
|
||||||
#define PG_VERSION_13 130000
|
#define PG_VERSION_13 130000
|
||||||
#define PG_VERSION_14 140000
|
#define PG_VERSION_14 140000
|
||||||
|
#define PG_VERSION_15 150000
|
||||||
|
|
||||||
#define PG_VERSION_MAX PG_VERSION_14
|
#define PG_VERSION_MAX PG_VERSION_15
|
||||||
|
|
||||||
/***********************************************************************************************************************************
|
/***********************************************************************************************************************************
|
||||||
Version where various PostgreSQL capabilities were introduced
|
Version where various PostgreSQL capabilities were introduced
|
||||||
@ -72,5 +73,6 @@ PostgreSQL version string constants for use in error messages
|
|||||||
#define PG_VERSION_12_STR "12"
|
#define PG_VERSION_12_STR "12"
|
||||||
#define PG_VERSION_13_STR "13"
|
#define PG_VERSION_13_STR "13"
|
||||||
#define PG_VERSION_14_STR "14"
|
#define PG_VERSION_14_STR "14"
|
||||||
|
#define PG_VERSION_15_STR "15"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,14 +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?}
|
||||||
# **********************************************************************************************************************************
|
# **********************************************************************************************************************************
|
||||||
|
20220504A:
|
||||||
|
x86_64:
|
||||||
|
u20: 45b0905785dfd06c867b4067563171970c7581c5
|
||||||
|
|
||||||
20211016A:
|
20211016A:
|
||||||
x86_64:
|
x86_64:
|
||||||
d9: 3a0ed45fd9115f9612767e7bd13564608d1f8f83
|
d9: 3a0ed45fd9115f9612767e7bd13564608d1f8f83
|
||||||
|
|
||||||
20210930A:
|
|
||||||
x86_64:
|
|
||||||
u20: 7ffb73ceb9a2e3aad2cba7eb5c8e28fc3982db18
|
|
||||||
|
|
||||||
20210902A:
|
20210902A:
|
||||||
x86_64:
|
x86_64:
|
||||||
rh7: c4d02428812374ab6a22efa437499592ae9c5f08
|
rh7: c4d02428812374ab6a22efa437499592ae9c5f08
|
||||||
|
@ -401,6 +401,7 @@ unit:
|
|||||||
- postgres/interface/v120
|
- postgres/interface/v120
|
||||||
- postgres/interface/v130
|
- postgres/interface/v130
|
||||||
- postgres/interface/v140
|
- postgres/interface/v140
|
||||||
|
- postgres/interface/v150
|
||||||
- protocol/client
|
- protocol/client
|
||||||
- protocol/command
|
- protocol/command
|
||||||
- protocol/helper
|
- protocol/helper
|
||||||
|
@ -398,6 +398,11 @@ sub containerBuild
|
|||||||
" libppi-html-perl libtemplate-perl libtest-differences-perl zlib1g-dev libxml2-dev pkg-config \\\n" .
|
" libppi-html-perl libtemplate-perl libtest-differences-perl zlib1g-dev libxml2-dev pkg-config \\\n" .
|
||||||
" libbz2-dev bzip2 libyaml-dev libjson-pp-perl liblz4-dev liblz4-tool gnupg";
|
" libbz2-dev bzip2 libyaml-dev libjson-pp-perl liblz4-dev liblz4-tool gnupg";
|
||||||
|
|
||||||
|
if ($strOS eq VM_U20)
|
||||||
|
{
|
||||||
|
$strScript .= " lsb-release";
|
||||||
|
}
|
||||||
|
|
||||||
# This package is required to build valgrind on 32-bit
|
# This package is required to build valgrind on 32-bit
|
||||||
if ($oVm->{$strOS}{&VM_ARCH} eq VM_ARCH_I386)
|
if ($oVm->{$strOS}{&VM_ARCH} eq VM_ARCH_I386)
|
||||||
{
|
{
|
||||||
@ -499,9 +504,13 @@ sub containerBuild
|
|||||||
$strScript .=
|
$strScript .=
|
||||||
" echo 'deb http://apt.postgresql.org/pub/repos/apt/ " .
|
" echo 'deb http://apt.postgresql.org/pub/repos/apt/ " .
|
||||||
$$oVm{$strOS}{&VM_OS_REPO} . '-pgdg main' . "' >> /etc/apt/sources.list.d/pgdg.list && \\\n" .
|
$$oVm{$strOS}{&VM_OS_REPO} . '-pgdg main' . "' >> /etc/apt/sources.list.d/pgdg.list && \\\n" .
|
||||||
|
($strOS eq VM_U20 ?
|
||||||
|
" echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg-testing main 15\"" .
|
||||||
|
" >> /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_U20 ? " -t \$(lsb_release -s -c)-pgdg-testing" : '') . " 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";
|
||||||
}
|
}
|
||||||
@ -517,7 +526,9 @@ sub containerBuild
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$strScript .= " apt-get install -y --no-install-recommends";
|
$strScript .=
|
||||||
|
" apt-get install -y --no-install-recommends" .
|
||||||
|
($strOS eq VM_U20 ? " -t \$(lsb_release -s -c)-pgdg-testing" : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
# Construct list of databases to install
|
# Construct list of databases to install
|
||||||
|
@ -39,6 +39,8 @@ use constant PG_VERSION_13 => '13';
|
|||||||
push @EXPORT, qw(PG_VERSION_13);
|
push @EXPORT, qw(PG_VERSION_13);
|
||||||
use constant PG_VERSION_14 => '14';
|
use constant PG_VERSION_14 => '14';
|
||||||
push @EXPORT, qw(PG_VERSION_14);
|
push @EXPORT, qw(PG_VERSION_14);
|
||||||
|
use constant PG_VERSION_15 => '15';
|
||||||
|
push @EXPORT, qw(PG_VERSION_15);
|
||||||
|
|
||||||
use constant PG_VERSION_HOT_STANDBY => PG_VERSION_91;
|
use constant PG_VERSION_HOT_STANDBY => PG_VERSION_91;
|
||||||
push @EXPORT, qw(PG_VERSION_HOT_STANDBY);
|
push @EXPORT, qw(PG_VERSION_HOT_STANDBY);
|
||||||
@ -56,7 +58,8 @@ sub versionSupport
|
|||||||
my ($strOperation) = logDebugParam(__PACKAGE__ . '->versionSupport');
|
my ($strOperation) = logDebugParam(__PACKAGE__ . '->versionSupport');
|
||||||
|
|
||||||
my @strySupportVersion = (PG_VERSION_90, PG_VERSION_91, PG_VERSION_92, PG_VERSION_93, PG_VERSION_94, PG_VERSION_95,
|
my @strySupportVersion = (PG_VERSION_90, PG_VERSION_91, PG_VERSION_92, PG_VERSION_93, 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_96, PG_VERSION_10, PG_VERSION_11, PG_VERSION_12, PG_VERSION_13, PG_VERSION_14,
|
||||||
|
PG_VERSION_15);
|
||||||
|
|
||||||
# Return from function and log return values if any
|
# Return from function and log return values if any
|
||||||
return logDebugReturn
|
return logDebugReturn
|
||||||
|
@ -275,6 +275,7 @@ my $oyVm =
|
|||||||
PG_VERSION_12,
|
PG_VERSION_12,
|
||||||
PG_VERSION_13,
|
PG_VERSION_13,
|
||||||
PG_VERSION_14,
|
PG_VERSION_14,
|
||||||
|
PG_VERSION_15,
|
||||||
],
|
],
|
||||||
|
|
||||||
&VM_DB_TEST =>
|
&VM_DB_TEST =>
|
||||||
@ -289,6 +290,7 @@ my $oyVm =
|
|||||||
PG_VERSION_12,
|
PG_VERSION_12,
|
||||||
PG_VERSION_13,
|
PG_VERSION_13,
|
||||||
PG_VERSION_14,
|
PG_VERSION_14,
|
||||||
|
PG_VERSION_15,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -254,6 +254,7 @@ sub dbCatalogVersion
|
|||||||
&PG_VERSION_12 => 201909212,
|
&PG_VERSION_12 => 201909212,
|
||||||
&PG_VERSION_13 => 202007201,
|
&PG_VERSION_13 => 202007201,
|
||||||
&PG_VERSION_14 => 202105121,
|
&PG_VERSION_14 => 202105121,
|
||||||
|
&PG_VERSION_15 => 202204076,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!defined($hCatalogVersion->{$strPgVersion}))
|
if (!defined($hCatalogVersion->{$strPgVersion}))
|
||||||
@ -297,6 +298,7 @@ sub dbControlVersion
|
|||||||
&PG_VERSION_12 => 1201,
|
&PG_VERSION_12 => 1201,
|
||||||
&PG_VERSION_13 => 1300,
|
&PG_VERSION_13 => 1300,
|
||||||
&PG_VERSION_14 => 1300,
|
&PG_VERSION_14 => 1300,
|
||||||
|
&PG_VERSION_15 => 1300,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!defined($hControlVersion->{$strPgVersion}))
|
if (!defined($hControlVersion->{$strPgVersion}))
|
||||||
|
@ -64,6 +64,7 @@ sub run
|
|||||||
{pg => '12', repoDest => HOST_BACKUP, tls => 0, storage => S3, encrypt => 1, compress => LZ4, repo => 1, bnd => 0},
|
{pg => '12', repoDest => HOST_BACKUP, tls => 0, storage => S3, encrypt => 1, compress => LZ4, repo => 1, bnd => 0},
|
||||||
{pg => '13', repoDest => HOST_DB_STANDBY, tls => 1, storage => GCS, encrypt => 0, compress => ZST, repo => 1, bnd => 1},
|
{pg => '13', repoDest => HOST_DB_STANDBY, tls => 1, storage => GCS, encrypt => 0, compress => ZST, repo => 1, bnd => 1},
|
||||||
{pg => '14', repoDest => HOST_BACKUP, tls => 0, storage => POSIX, encrypt => 1, compress => LZ4, repo => 2, bnd => 0},
|
{pg => '14', repoDest => HOST_BACKUP, tls => 0, storage => POSIX, encrypt => 1, compress => LZ4, repo => 2, bnd => 0},
|
||||||
|
{pg => '15', repoDest => HOST_DB_STANDBY, tls => 0, storage => AZURE, encrypt => 0, compress => NONE, repo => 2, bnd => 1},
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# Only run tests for this pg version
|
# Only run tests for this pg version
|
||||||
|
@ -59,6 +59,10 @@ uint32_t hrnPgInterfaceCatalogVersion140(void);
|
|||||||
void hrnPgInterfaceControl140(PgControl pgControl, unsigned char *buffer);
|
void hrnPgInterfaceControl140(PgControl pgControl, unsigned char *buffer);
|
||||||
void hrnPgInterfaceWal140(PgWal pgWal, unsigned char *buffer);
|
void hrnPgInterfaceWal140(PgWal pgWal, unsigned char *buffer);
|
||||||
|
|
||||||
|
uint32_t hrnPgInterfaceCatalogVersion150(void);
|
||||||
|
void hrnPgInterfaceControl150(PgControl pgControl, unsigned char *buffer);
|
||||||
|
void hrnPgInterfaceWal150(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
|
||||||
@ -76,6 +80,13 @@ typedef struct HrnPgInterface
|
|||||||
|
|
||||||
static const HrnPgInterface hrnPgInterface[] =
|
static const HrnPgInterface hrnPgInterface[] =
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
.version = PG_VERSION_15,
|
||||||
|
|
||||||
|
.catalogVersion = hrnPgInterfaceCatalogVersion150,
|
||||||
|
.control = hrnPgInterfaceControl150,
|
||||||
|
.wal = hrnPgInterfaceWal150,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.version = PG_VERSION_14,
|
.version = PG_VERSION_14,
|
||||||
|
|
||||||
|
10
test/src/common/harnessPostgres/harness150.c
Normal file
10
test/src/common/harnessPostgres/harness150.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_15
|
||||||
|
|
||||||
|
#include "common/harnessPostgres/harnessVersion.intern.h"
|
||||||
|
|
||||||
|
HRN_PG_INTERFACE(150);
|
@ -298,6 +298,28 @@ Macros for defining groups of functions that implement various queries and comma
|
|||||||
{.session = sessionParam, .function = HRNPQ_CLEAR}, \
|
{.session = sessionParam, .function = HRNPQ_CLEAR}, \
|
||||||
{.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true}
|
{.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true}
|
||||||
|
|
||||||
|
#define HRNPQ_MACRO_START_BACKUP_GE_15(sessionParam, startFastParam, lsnParam, walSegmentNameParam) \
|
||||||
|
{.session = sessionParam, \
|
||||||
|
.function = HRNPQ_SENDQUERY, \
|
||||||
|
.param = strZ(strNewFmt( \
|
||||||
|
"[\"select lsn::text as lsn,\\n" \
|
||||||
|
" pg_catalog.pg_walfile_name(lsn)::text as wal_segment_name\\n" \
|
||||||
|
" from pg_catalog.pg_backup_start('pgBackRest backup started at ' || current_timestamp, %s) as lsn\"]", \
|
||||||
|
cvtBoolToConstZ(startFastParam))), \
|
||||||
|
.resultInt = 1}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_ISBUSY}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETRESULT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 2}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_CLEAR}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true}
|
||||||
|
|
||||||
#define HRNPQ_MACRO_STOP_BACKUP_LE_95(sessionParam, lsnParam, walSegmentNameParam) \
|
#define HRNPQ_MACRO_STOP_BACKUP_LE_95(sessionParam, lsnParam, walSegmentNameParam) \
|
||||||
{.session = sessionParam, \
|
{.session = sessionParam, \
|
||||||
.function = HRNPQ_SENDQUERY, \
|
.function = HRNPQ_SENDQUERY, \
|
||||||
@ -375,6 +397,34 @@ Macros for defining groups of functions that implement various queries and comma
|
|||||||
{.session = sessionParam, .function = HRNPQ_CLEAR}, \
|
{.session = sessionParam, .function = HRNPQ_CLEAR}, \
|
||||||
{.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true}
|
{.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true}
|
||||||
|
|
||||||
|
#define HRNPQ_MACRO_STOP_BACKUP_GE_15(sessionParam, lsnParam, walSegmentNameParam, tablespaceMapParam) \
|
||||||
|
{.session = sessionParam, \
|
||||||
|
.function = HRNPQ_SENDQUERY, \
|
||||||
|
.param = \
|
||||||
|
"[\"select lsn::text as lsn,\\n" \
|
||||||
|
" pg_catalog.pg_walfile_name(lsn)::text as wal_segment_name,\\n" \
|
||||||
|
" labelfile::text as backuplabel_file,\\n" \
|
||||||
|
" spcmapfile::text as tablespacemap_file\\n" \
|
||||||
|
" from pg_catalog.pg_backup_stop(false)\"]", \
|
||||||
|
.resultInt = 1}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_CONSUMEINPUT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_ISBUSY}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETRESULT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_NTUPLES, .resultInt = 1}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_NFIELDS, .resultInt = 4}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[0]", .resultInt = HRNPQ_TYPE_TEXT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[1]", .resultInt = HRNPQ_TYPE_TEXT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[2]", .resultInt = HRNPQ_TYPE_TEXT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_FTYPE, .param = "[3]", .resultInt = HRNPQ_TYPE_TEXT}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,2]", .resultZ = "BACKUP_LABEL_DATA"}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETVALUE, .param = "[0,3]", \
|
||||||
|
.resultZ = tablespaceMapParam ? "TABLESPACE_MAP_DATA" : "\n"}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_CLEAR}, \
|
||||||
|
{.session = sessionParam, .function = HRNPQ_GETRESULT, .resultNull = true}
|
||||||
|
|
||||||
#define HRNPQ_MACRO_DATABASE_LIST_1(sessionParam, databaseNameParam) \
|
#define HRNPQ_MACRO_DATABASE_LIST_1(sessionParam, databaseNameParam) \
|
||||||
{.session = sessionParam, \
|
{.session = sessionParam, \
|
||||||
.function = HRNPQ_SENDQUERY, \
|
.function = HRNPQ_SENDQUERY, \
|
||||||
|
@ -671,6 +671,50 @@ testRun(void)
|
|||||||
|
|
||||||
TEST_RESULT_VOID(dbFree(db.primary), "free primary");
|
TEST_RESULT_VOID(dbFree(db.primary), "free primary");
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------------------------------------------------------
|
||||||
|
TEST_TITLE("PostgreSQL 15 - non-exclusive flag dropped");
|
||||||
|
|
||||||
|
HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_15, .timeline = 6, .checkpoint = pgLsnFromStr(STRDEF("6/6")));
|
||||||
|
|
||||||
|
argList = strLstNew();
|
||||||
|
hrnCfgArgRawZ(argList, cfgOptStanza, "test1");
|
||||||
|
hrnCfgArgKeyRawZ(argList, cfgOptRepoRetentionFull, 1, "1");
|
||||||
|
hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg1");
|
||||||
|
HRN_CFG_LOAD(cfgCmdBackup, argList);
|
||||||
|
|
||||||
|
harnessPqScriptSet((HarnessPq [])
|
||||||
|
{
|
||||||
|
// Connect to primary
|
||||||
|
HRNPQ_MACRO_OPEN_GE_96(1, "dbname='postgres' port=5432", PG_VERSION_15, TEST_PATH "/pg1", false, NULL, NULL),
|
||||||
|
|
||||||
|
// Start backup
|
||||||
|
HRNPQ_MACRO_ADVISORY_LOCK(1, true),
|
||||||
|
HRNPQ_MACRO_CURRENT_WAL_GE_10(1, "000000060000000600000005"),
|
||||||
|
HRNPQ_MACRO_START_BACKUP_GE_15(1, false, "6/6", "000000060000000600000006"),
|
||||||
|
|
||||||
|
// Stop backup
|
||||||
|
HRNPQ_MACRO_STOP_BACKUP_GE_15(1, "6/7", "000000060000000600000006", false),
|
||||||
|
|
||||||
|
// Close primary
|
||||||
|
HRNPQ_MACRO_CLOSE(1),
|
||||||
|
|
||||||
|
HRNPQ_MACRO_DONE()
|
||||||
|
});
|
||||||
|
|
||||||
|
TEST_ASSIGN(db, dbGet(true, true, false), "get primary");
|
||||||
|
TEST_ASSIGN(backupStartResult, dbBackupStart(db.primary, false, false, true), "start backup");
|
||||||
|
TEST_RESULT_STR_Z(backupStartResult.lsn, "6/6", "check lsn");
|
||||||
|
TEST_RESULT_STR_Z(backupStartResult.walSegmentName, "000000060000000600000006", "check wal segment name");
|
||||||
|
TEST_RESULT_STR_Z(backupStartResult.walSegmentCheck, "000000060000000600000005", "check wal segment check");
|
||||||
|
|
||||||
|
backupStopResult = (DbBackupStopResult){.lsn = NULL};
|
||||||
|
TEST_ASSIGN(backupStopResult, dbBackupStop(db.primary), "stop backup");
|
||||||
|
TEST_RESULT_STR_Z(backupStopResult.lsn, "6/7", "check lsn");
|
||||||
|
TEST_RESULT_STR_Z(backupStopResult.walSegmentName, "000000060000000600000006", "check wal segment name");
|
||||||
|
TEST_RESULT_STR_Z(backupStopResult.backupLabel, "BACKUP_LABEL_DATA", "check backup label");
|
||||||
|
TEST_RESULT_STR_Z(backupStopResult.tablespaceMap, NULL, "check tablespace map is not set");
|
||||||
|
|
||||||
|
TEST_RESULT_VOID(dbFree(db.primary), "free primary");
|
||||||
}
|
}
|
||||||
|
|
||||||
// *****************************************************************************************************************************
|
// *****************************************************************************************************************************
|
||||||
|
Reference in New Issue
Block a user