diff --git a/README.md b/README.md index 4d23f8352..8c317d59f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ All operations utilize file and directory level fsync to ensure durability. ### Page Checksums -PostgreSQL has supported page-level checksums since 9.3. If page checksums are enabled pgBackRest will validate the checksums for every file that is copied during a backup. All page checksums are validated during a full backup and checksums in files that have changed are validated during differential and incremental backups. +If page checksums are enabled pgBackRest will validate the checksums for every file that is copied during a backup. All page checksums are validated during a full backup and checksums in files that have changed are validated during differential and incremental backups. Validation failures do not stop the backup process, but warnings with details of exactly which pages have failed validation are output to the console and file log. diff --git a/doc/xml/index.xml b/doc/xml/index.xml index 0ec1130c4..01e0ddb4f 100644 --- a/doc/xml/index.xml +++ b/doc/xml/index.xml @@ -92,7 +92,7 @@
Page Checksums -

has supported page-level checksums since 9.3. If page checksums are enabled will validate the checksums for every file that is copied during a backup. All page checksums are validated during a full backup and checksums in files that have changed are validated during differential and incremental backups.

+

If page checksums are enabled will validate the checksums for every file that is copied during a backup. All page checksums are validated during a full backup and checksums in files that have changed are validated during differential and incremental backups.

Validation failures do not stop the backup process, but warnings with details of exactly which pages have failed validation are output to the console and file log.

diff --git a/doc/xml/release/2023/2.49.xml b/doc/xml/release/2023/2.49.xml index aa2d48a78..bcaaa773f 100644 --- a/doc/xml/release/2023/2.49.xml +++ b/doc/xml/release/2023/2.49.xml @@ -21,6 +21,19 @@

Fix regression in retries.

+ + + + + + + + + + +

Remove support for PostgreSQL 9.3.

+
+
diff --git a/src/build/help/help.xml b/src/build/help/help.xml index 3fe68e79d..8b9c94d7a 100644 --- a/src/build/help/help.xml +++ b/src/build/help/help.xml @@ -1449,8 +1449,6 @@

This will only be done if an exclusive advisory lock can be acquired to demonstrate that the prior failed backup process has really stopped.

-

This feature relies on pg_is_in_backup() so only works on >= 9.3.

-

This feature is not supported for >= 9.6 since backups are run in non-exclusive mode.

The setting is disabled by default because it assumes that is the only process doing exclusive online backups. It depends on an advisory lock that only sets so it may abort other processes that do exclusive online backups. Note that base_backup and pg_dump are safe to use with this setting because they do not call pg_start_backup() so are not exclusive.

diff --git a/src/build/postgres/postgres.yaml b/src/build/postgres/postgres.yaml index a603738b1..4e303e0e5 100644 --- a/src/build/postgres/postgres.yaml +++ b/src/build/postgres/postgres.yaml @@ -5,7 +5,6 @@ # - 'version' contains a list of all supported versions # - For a specific version, 'release' marks it as not released (i.e. this should always be false when used) version: - - 9.3 - 9.4 - 9.5 - 9.6 diff --git a/src/info/manifest.c b/src/info/manifest.c index 2769fcab5..891ea3a58 100644 --- a/src/info/manifest.c +++ b/src/info/manifest.c @@ -940,7 +940,7 @@ manifestBuildInfo( if (strEq(manifestParentName, MANIFEST_TARGET_PGDATA_STR)) { // Skip pg_dynshmem/* since these files cannot be reused on recovery - if (strEqZ(info->name, PG_PATH_PGDYNSHMEM) && pgVersion >= PG_VERSION_94) + if (strEqZ(info->name, PG_PATH_PGDYNSHMEM)) FUNCTION_TEST_RETURN_VOID(); // Skip pg_notify/* since these files cannot be reused on recovery @@ -948,7 +948,7 @@ manifestBuildInfo( FUNCTION_TEST_RETURN_VOID(); // Skip pg_replslot/* since these files are generally not useful after a restore - if (strEqZ(info->name, PG_PATH_PGREPLSLOT) && pgVersion >= PG_VERSION_94) + if (strEqZ(info->name, PG_PATH_PGREPLSLOT)) FUNCTION_TEST_RETURN_VOID(); // Skip pg_serial/* since these files are reset @@ -1031,7 +1031,7 @@ manifestBuildInfo( ((strEqZ(info->name, PG_FILE_RECOVERYCONF) || strEqZ(info->name, PG_FILE_RECOVERYDONE)) && pgVersion < PG_VERSION_12) || // Skip temp file for safely writing postgresql.auto.conf - (strEqZ(info->name, PG_FILE_POSTGRESQLAUTOCONFTMP) && pgVersion >= PG_VERSION_94) || + (strEqZ(info->name, PG_FILE_POSTGRESQLAUTOCONFTMP)) || // Skip backup_label in versions where non-exclusive backup is supported (strEqZ(info->name, PG_FILE_BACKUPLABEL) && pgVersion >= PG_VERSION_96) || // Skip old backup labels diff --git a/src/postgres/interface/version.intern.h b/src/postgres/interface/version.intern.h index 87802e5a6..4f056fc82 100644 --- a/src/postgres/interface/version.intern.h +++ b/src/postgres/interface/version.intern.h @@ -16,7 +16,7 @@ alpha/beta/rc period without needing to be updated, unless of course the actual ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #ifdef CATALOG_VERSION_NO_MAX @@ -54,7 +54,7 @@ Read the version specific pg_control into a general data structure ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define PG_INTERFACE_CONTROL(version) \ static PgControl \ @@ -81,7 +81,7 @@ Get control crc offset ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define PG_INTERFACE_CONTROL_CRC_OFFSET(version) \ static size_t \ @@ -97,7 +97,7 @@ Get the control version ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define PG_INTERFACE_CONTROL_VERSION(version) \ static uint32_t \ @@ -113,7 +113,7 @@ Determine if the supplied WAL is for this version of PostgreSQL ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define PG_INTERFACE_WAL_IS(version) \ static bool \ @@ -131,7 +131,7 @@ Read the version specific WAL header into a general data structure ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define PG_INTERFACE_WAL(version) \ static PgWal \ diff --git a/src/postgres/interface/version.vendor.h b/src/postgres/interface/version.vendor.h index 710d1c2e9..419f678d7 100644 --- a/src/postgres/interface/version.vendor.h +++ b/src/postgres/interface/version.vendor.h @@ -32,7 +32,7 @@ Types from src/include/c.h // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 typedef int64_t int64; @@ -42,7 +42,7 @@ typedef int64_t int64; // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* MultiXactId must be equivalent to TransactionId, to fit in t_xmax */ typedef TransactionId MultiXactId; @@ -53,7 +53,7 @@ typedef TransactionId MultiXactId; // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 typedef uint32 MultiXactOffset; @@ -67,7 +67,7 @@ Types from src/include/pgtime.h // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * The API of this library is generally similar to the corresponding @@ -86,7 +86,7 @@ Types from src/include/postgres_ext.h // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * Object ID is a fundamental type in Postgres. @@ -107,7 +107,7 @@ Types from src/include/port/pg_crc32.h typedef uint32 pg_crc32c; -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 typedef uint32 pg_crc32; @@ -121,7 +121,7 @@ Types from src/include/access/xlogdefs.h // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * Pointer to a location in the XLOG. These pointers are 64 bits wide, @@ -135,7 +135,7 @@ typedef uint64 XLogRecPtr; // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * TimeLineID (TLI) - identifies different database histories to prevent @@ -288,19 +288,6 @@ Types from src/include/catalog/catversion.h /* yyyymmddN */ #define CATALOG_VERSION_NO 201409291 -#elif PG_VERSION >= PG_VERSION_93 - -/* - * 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 201306121 - #endif /*********************************************************************************************************************************** @@ -363,11 +350,6 @@ Types from src/include/catalog/pg_control.h /* Version identifier for this pg_control format */ #define PG_CONTROL_VERSION 942 -#elif PG_VERSION >= PG_VERSION_93 - -/* Version identifier for this pg_control format */ -#define PG_CONTROL_VERSION 937 - #endif // MOCK_AUTH_NONCE_LEN define @@ -539,7 +521,7 @@ typedef struct CheckPoint TransactionId oldestActiveXid; } CheckPoint; -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * Body of CheckPoint XLOG records. This is declared here because we keep @@ -580,7 +562,7 @@ typedef struct CheckPoint // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * System status indicator. Note this is stored in pg_control; if you change @@ -1575,142 +1557,6 @@ typedef struct ControlFileData pg_crc32 crc; } ControlFileData; -#elif PG_VERSION >= PG_VERSION_93 - -/* - * Contents of pg_control. - * - * NOTE: try to keep this under 512 bytes so that it will fit on one physical - * sector of typical disk drives. This reduces the odds of corruption due to - * power failure midway through a write. - */ -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 */ - XLogRecPtr prevCheckPoint; /* previous 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. If it's false, but backupStartPoint is set, a backup_label - * file was found at startup but it may have been a leftover from a stray - * pg_start_backup() call, not accompanied by pg_stop_backup(). - */ - 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; - int MaxConnections; - int max_prepared_xacts; - int max_locks_per_xact; - - /* - * 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 */ - - /* flag indicating internal format of timestamp, interval, time */ - bool enableIntTimes; /* int64 storage enabled? */ - - /* flags indicating pass-by-value status of various types */ - bool float4ByVal; /* float4 pass-by-value? */ - bool float8ByVal; /* float8, int8, etc pass-by-value? */ - - /* Are data pages protected by checksums? Zero if no checksum version */ - uint32 data_checksum_version; - - /* CRC of all above ... MUST BE LAST! */ - pg_crc32 crc; -} ControlFileData; - #endif /*********************************************************************************************************************************** @@ -1761,10 +1607,6 @@ Types from src/include/access/xlog_internal.h #define XLOG_PAGE_MAGIC 0xD07E /* can be used as WAL version indicator */ -#elif PG_VERSION >= PG_VERSION_93 - -#define XLOG_PAGE_MAGIC 0xD075 /* can be used as WAL version indicator */ - #endif // XLogPageHeaderData type @@ -1792,7 +1634,7 @@ typedef struct XLogPageHeaderData uint32 xlp_rem_len; /* total len of remaining data for record */ } XLogPageHeaderData; -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * Each page of XLOG file has a header like this: @@ -1822,7 +1664,7 @@ typedef struct XLogPageHeaderData // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* * When the XLP_LONG_HEADER flag is set, we store additional fields in the @@ -1843,7 +1685,7 @@ typedef struct XLogLongPageHeaderData // --------------------------------------------------------------------------------------------------------------------------------- #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 /* This flag indicates a "long" page header */ #define XLP_LONG_HEADER 0x0002 diff --git a/src/postgres/version.auto.h b/src/postgres/version.auto.h index 7aea0b1a0..608a9c181 100644 --- a/src/postgres/version.auto.h +++ b/src/postgres/version.auto.h @@ -9,7 +9,6 @@ Automatically generated by 'build-code postgres-version' -- do not modify direct /*********************************************************************************************************************************** PostgreSQL version constants ***********************************************************************************************************************************/ -#define PG_VERSION_93 90300 #define PG_VERSION_94 90400 #define PG_VERSION_95 90500 #define PG_VERSION_96 90600 @@ -26,7 +25,6 @@ PostgreSQL version constants /*********************************************************************************************************************************** PostgreSQL version string constants for use in error messages ***********************************************************************************************************************************/ -#define PG_VERSION_93_Z "9.3" #define PG_VERSION_94_Z "9.4" #define PG_VERSION_95_Z "9.5" #define PG_VERSION_96_Z "9.6" diff --git a/test/code-count/file-type.yaml b/test/code-count/file-type.yaml index d9ade2ea3..2fc3226cb 100644 --- a/test/code-count/file-type.yaml +++ b/test/code-count/file-type.yaml @@ -2731,10 +2731,6 @@ test/src/common/harnessPostgres.h: class: test/harness type: c/h -test/src/common/harnessPostgres/harness093.c: - class: test/harness - type: c - test/src/common/harnessPostgres/harness094.c: class: test/harness type: c diff --git a/test/container.yaml b/test/container.yaml index 8a8f4ebe0..4ba5bd6e3 100644 --- a/test/container.yaml +++ b/test/container.yaml @@ -12,19 +12,16 @@ # - docker login -u pgbackrest # - VM=XXX;DATE=YYYYMMDDX;BASE=pgbackrest/test:${VM?}-base;docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?} # ********************************************************************************************************************************** -20230914A: +20231109A: x86_64: - u22: 82f81ccd261d9b83066cd59da44ada3f328403ab + d10: 927b594d0f0319c19d692947f9218a4474cf8cd6 + u20: 51041e6806d2d05ccefbd8a2ab23f2c9e42a7997 + u22: 287933d006d8780a521dac6409f4910ebafe6ded 20230622A: x86_64: f38: 3dc5e099699d3f4f3bc65d06f20c0ae1c9124eaf -20230523A: - x86_64: - u20: 31c2124ab0db03d97eb6324e12e22eb64eb4a3b8 - 20230513A: x86_64: - d10: 633def5323eeed51d7aa187ad1d61e854c47d6fa rh7: 18dd0cbe19aa66dd9d72d312da5cb8c4bddea8b9 diff --git a/test/lib/pgBackRestTest/Common/DbVersion.pm b/test/lib/pgBackRestTest/Common/DbVersion.pm index f5bbaa6aa..83ad74ac3 100644 --- a/test/lib/pgBackRestTest/Common/DbVersion.pm +++ b/test/lib/pgBackRestTest/Common/DbVersion.pm @@ -15,8 +15,6 @@ use pgBackRestDoc::Common::Log; #################################################################################################################################### # PostgreSQL version numbers #################################################################################################################################### -use constant PG_VERSION_93 => '9.3'; - push @EXPORT, qw(PG_VERSION_93); use constant PG_VERSION_94 => '9.4'; push @EXPORT, qw(PG_VERSION_94); use constant PG_VERSION_95 => '9.5'; @@ -48,8 +46,8 @@ sub versionSupport # Assign function parameters, defaults, and log debug info my ($strOperation) = logDebugParam(__PACKAGE__ . '->versionSupport'); - my @strySupportVersion = (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_15, PG_VERSION_16); + 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); # 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 5a8af0ca6..95c2aace7 100644 --- a/test/lib/pgBackRestTest/Common/VmTest.pm +++ b/test/lib/pgBackRestTest/Common/VmTest.pm @@ -136,7 +136,6 @@ my $oyVm = &VM_DB => [ - PG_VERSION_93, PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, @@ -144,8 +143,8 @@ my $oyVm = &VM_DB_TEST => [ - PG_VERSION_93, PG_VERSION_94, + PG_VERSION_96, ], }, @@ -217,7 +216,6 @@ my $oyVm = &VM_DB => [ - PG_VERSION_93, PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, @@ -250,7 +248,6 @@ my $oyVm = &VM_DB => [ - PG_VERSION_93, PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, @@ -266,7 +263,6 @@ my $oyVm = &VM_DB_TEST => [ PG_VERSION_95, - PG_VERSION_96, PG_VERSION_10, PG_VERSION_15, PG_VERSION_16, diff --git a/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm b/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm index c1e8387b7..541bc8a2d 100644 --- a/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm +++ b/test/lib/pgBackRestTest/Env/ExpireEnvTest.pm @@ -77,7 +77,6 @@ sub new my $oPgControlVersionHash = { # iControlVersion => {iCatalogVersion => strDbVersion} - 937 => {201306121 => PG_VERSION_93}, 942 => { 201409291 => PG_VERSION_94, @@ -390,8 +389,8 @@ sub backupCreate my $strManifestFile = "$$oStanza{strBackupClusterPath}/${strBackupLabel}/" . FILE_MANIFEST; - my $oManifest = new pgBackRestTest::Env::Manifest($strManifestFile, {bLoad => false, strDbVersion => PG_VERSION_93, - iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_93), + my $oManifest = new pgBackRestTest::Env::Manifest($strManifestFile, {bLoad => false, strDbVersion => PG_VERSION_94, + iDbCatalogVersion => $self->dbCatalogVersion(PG_VERSION_94), strCipherPass => $strCipherPassManifest, strCipherPassSub => $strCipherPassBackupSet}); # Store information about the backup into the backup section diff --git a/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm b/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm index 5b680445f..10a292d4f 100644 --- a/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm +++ b/test/lib/pgBackRestTest/Env/Host/HostDbTest.pm @@ -351,8 +351,7 @@ sub clusterCreate my $strWalPath = defined($$hParam{strWalPath}) ? $$hParam{strWalPath} : $self->dbPath() . '/pg_' . $self->walId(); $self->executeSimple( - $self->pgBinPath() . '/initdb ' . - ($self->pgVersion() >= PG_VERSION_93 ? ' -k' : '') . + $self->pgBinPath() . '/initdb -k' . ($self->pgVersion() >= PG_VERSION_11 ? ' --wal-segsize=1' : '') . ' --' . $self->walId() . "dir=${strWalPath}" . ' --pgdata=' . $self->dbBasePath() . ' --auth=trust'); @@ -456,7 +455,7 @@ sub clusterStart ' -c log_rotation_age=0' . ' -c log_rotation_size=0' . ' -c log_error_verbosity=verbose' . - ' -c unix_socket_director' . ($self->pgVersion() < PG_VERSION_93 ? 'y=\'' : 'ies=\'') . $self->dbPath() . '\'"' . + ' -c unix_socket_directories=\'' . $self->dbPath() . '\'"' . ' -D ' . $self->dbBasePath() . ' -l ' . $self->pgLogFile() . ' -s'; $self->executeSimple($strCommand); diff --git a/test/lib/pgBackRestTest/Env/HostEnvTest.pm b/test/lib/pgBackRestTest/Env/HostEnvTest.pm index 6812b8fc6..e7ca012d9 100644 --- a/test/lib/pgBackRestTest/Env/HostEnvTest.pm +++ b/test/lib/pgBackRestTest/Env/HostEnvTest.pm @@ -250,7 +250,6 @@ sub dbCatalogVersion my $hCatalogVersion = { - &PG_VERSION_93 => 201306121, &PG_VERSION_94 => 201409291, &PG_VERSION_95 => 201510051, &PG_VERSION_96 => 201608131, @@ -294,11 +293,6 @@ sub controlGenerateContent { 32 => { - &PG_VERSION_93 => - "5d0064a7b3b6e00da903000009b0ff0b00000000000000000000000001000000000000000000000000000000000000000000000001000000" . - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" . - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" . - "00000000000000000000000000200000000000000000000000000001000000000000000000000000000000000000000043d77e50", &PG_VERSION_94 => "5e0064a7b3b6e00dae0300000b43010c00000000000000000000000001000000000000000000000000000000000000000000000001000000" . "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" . @@ -326,12 +320,6 @@ sub controlGenerateContent }, 64 => { - &PG_VERSION_93 => - "5d0064a7b3b6e00da903000009b0ff0b00000000000000000000000000000000010000000000000000000000000000000000000000000000" . - "0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" . - "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" . - "0000000000000000000000000000000000000000000000000020000000000000000000000000000100000000000000000000000000000000" . - "0000000003fff8cc", &PG_VERSION_94 => "5e0064a7b3b6e00dae0300000b43010c00000000000000000000000000000000010000000000000000000000000000000000000000000000" . "0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" . @@ -448,7 +436,6 @@ sub walGenerateContent # Get WAL magic for the PG version my $hWalMagic = { - &PG_VERSION_93 => hex('0xD075'), &PG_VERSION_94 => hex('0xD07E'), &PG_VERSION_95 => hex('0xD087'), &PG_VERSION_96 => hex('0xD093'), @@ -464,7 +451,7 @@ sub walGenerateContent $tWalContent .= pack('S', 2); # Add junk (H for header) for the bytes that won't be read by the tests - my $iOffset = 12 + ($strPgVersion >= PG_VERSION_93 ? testRunGet()->archBits() / 8 : 0); + my $iOffset = 12 + (testRunGet()->archBits() / 8); $tWalContent .= ('H' x $iOffset); # Add the system identifier diff --git a/test/lib/pgBackRestTest/Env/Manifest.pm b/test/lib/pgBackRestTest/Env/Manifest.pm index fc8761899..564e6db65 100644 --- a/test/lib/pgBackRestTest/Env/Manifest.pm +++ b/test/lib/pgBackRestTest/Env/Manifest.pm @@ -1422,7 +1422,7 @@ sub isPrimaryFile #################################################################################################################################### # isChecksumPage # -# Can this file have page checksums in PG >= 9.3? +# Can this file have page checksums? #################################################################################################################################### sub isChecksumPage { diff --git a/test/lib/pgBackRestTest/Module/Mock/MockExpireTest.pm b/test/lib/pgBackRestTest/Module/Mock/MockExpireTest.pm index 2ba26eb61..6ec91d213 100644 --- a/test/lib/pgBackRestTest/Module/Mock/MockExpireTest.pm +++ b/test/lib/pgBackRestTest/Module/Mock/MockExpireTest.pm @@ -173,7 +173,7 @@ sub run #----------------------------------------------------------------------------------------------------------------------- $strDescription = 'Upgrade stanza and expire only earliest db backup and archive'; - $oExpireTest->stanzaUpgrade($self->stanza(), PG_VERSION_93); + $oExpireTest->stanzaUpgrade($self->stanza(), PG_VERSION_94); $oExpireTest->backupCreate($self->stanza(), CFGOPTVAL_BACKUP_TYPE_FULL, $lBaseTime += SECONDS_PER_DAY); $oExpireTest->backupCreate($self->stanza(), CFGOPTVAL_BACKUP_TYPE_INCR, $lBaseTime += SECONDS_PER_DAY, 246); $oExpireTest->backupCreate($self->stanza(), CFGOPTVAL_BACKUP_TYPE_FULL, $lBaseTime += SECONDS_PER_DAY); diff --git a/test/lib/pgBackRestTest/Module/Mock/MockStanzaTest.pm b/test/lib/pgBackRestTest/Module/Mock/MockStanzaTest.pm index 915ad0bb2..829b05e88 100644 --- a/test/lib/pgBackRestTest/Module/Mock/MockStanzaTest.pm +++ b/test/lib/pgBackRestTest/Module/Mock/MockStanzaTest.pm @@ -85,7 +85,7 @@ sub run # Generate pg_control for stanza-create storageTest()->pathCreate(($oHostDbPrimary->dbBasePath() . '/' . DB_PATH_GLOBAL), {bCreateParent => true}); - $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_93); + $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_94); # Fail stanza upgrade before stanza-create has been performed #-------------------------------------------------------------------------------------------------------------------------- @@ -105,13 +105,13 @@ sub run # Stanza Create fails when not using force - database mismatch with pg_control file #-------------------------------------------------------------------------------------------------------------------------- # Change the database version by copying a new pg_control file - $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_94); + $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_95); $oHostBackup->stanzaCreate('fail on database mismatch and warn force option deprecated', {iExpectedExitStatus => ERROR_FILE_INVALID, strOptionalParam => '--no-online --force'}); # Restore pg_control - $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_93); + $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_94); # Perform a stanza upgrade which will indicate already up to date #-------------------------------------------------------------------------------------------------------------------------- @@ -125,7 +125,7 @@ sub run #-------------------------------------------------------------------------------------------------------------------------- # Generate WAL then push to get valid archive data in the archive directory my $strArchiveFile = $self->walSegment(1, 1, 1); - my $strSourceFile = $self->walGenerate($strWalPath, PG_VERSION_93, 1, $strArchiveFile); + my $strSourceFile = $self->walGenerate($strWalPath, PG_VERSION_94, 1, $strArchiveFile); my $strCommand = $oHostDbPrimary->backrestExe() . ' --config=' . $oHostDbPrimary->backrestConfig() . ' --stanza=db archive-push'; @@ -148,16 +148,16 @@ sub run # Just before upgrading push one last WAL on the old version to ensure it can be retrieved later #-------------------------------------------------------------------------------------------------------------------------- $strArchiveFile = $self->walSegment(1, 1, 2); - $strSourceFile = $self->walGenerate($strWalPath, PG_VERSION_93, 1, $strArchiveFile); + $strSourceFile = $self->walGenerate($strWalPath, PG_VERSION_94, 1, $strArchiveFile); $oHostDbPrimary->executeSimple($strCommand . " ${strSourceFile}"); # Fail on archive push due to mismatch of DB since stanza not upgraded #-------------------------------------------------------------------------------------------------------------------------- my $strArchiveTestFile = $self->testPath() . '/test-wal'; - storageTest()->put($strArchiveTestFile, $self->walGenerateContent(PG_VERSION_94)); + storageTest()->put($strArchiveTestFile, $self->walGenerateContent(PG_VERSION_95)); # Upgrade the DB by copying new pg_control - $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_94); + $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_95); forceStorageMode(storageTest(), $oHostDbPrimary->dbBasePath() . '/' . DB_FILE_PGCONTROL, '600'); # Fail on attempt to push an archive @@ -173,7 +173,7 @@ sub run # Make sure that WAL from the old version can still be retrieved #-------------------------------------------------------------------------------------------------------------------------- # Generate the old pg_control so it looks like the original db has been restored - $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_93); + $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_94); # Attempt to get the last archive log that was pushed to this repo $oHostDbPrimary->executeSimple( @@ -181,7 +181,7 @@ sub run " --stanza=db archive-get ${strArchiveFile} " . $oHostDbPrimary->dbBasePath() . '/pg_xlog/RECOVERYXLOG'); # Copy the new pg_control back so the tests can continue with the upgraded stanza - $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_94); + $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_95); forceStorageMode(storageTest(), $oHostDbPrimary->dbBasePath() . '/' . DB_FILE_PGCONTROL, '600'); # After stanza upgrade, make sure archives are pushed to the new db verion-id directory (9.4-2) @@ -189,8 +189,8 @@ sub run # Push a WAL segment so have a valid file in the latest DB archive dir only $oHostDbPrimary->archivePush($strWalPath, $strArchiveTestFile, 1); $self->testResult( - sub {storageRepo()->list($oHostBackup->repoArchivePath(PG_VERSION_94 . '-2/0000000100000001'))}, - '000000010000000100000001-' . $self->walGenerateContentChecksum(PG_VERSION_94) . ".${strCompressType}", + sub {storageRepo()->list($oHostBackup->repoArchivePath(PG_VERSION_95 . '-2/0000000100000001'))}, + '000000010000000100000001-' . $self->walGenerateContentChecksum(PG_VERSION_95) . ".${strCompressType}", 'check that WAL is in the archive at -2'); # Create the tablespace directory and perform a backup @@ -201,8 +201,8 @@ sub run # Upgrade the stanza #-------------------------------------------------------------------------------------------------------------------------- - # Copy pg_control for 9.5 - $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_95); + # Copy pg_control for 9.6 + $self->controlGenerate($oHostDbPrimary->dbBasePath(), PG_VERSION_96); forceStorageMode(storageTest(), $oHostDbPrimary->dbBasePath() . '/' . DB_FILE_PGCONTROL, '600'); # Run from the db server to ensure ability to run remotely @@ -217,9 +217,9 @@ sub run my $oArchiveInfo = new pgBackRestTest::Env::ArchiveInfo($oHostBackup->repoArchivePath()); my $oBackupInfo = new pgBackRestTest::Env::BackupInfo($oHostBackup->repoBackupPath()); $self->testResult(sub {$oArchiveInfo->test(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_VERSION, undef, - PG_VERSION_93)}, true, 'archive at old pg version'); + PG_VERSION_94)}, true, 'archive at old pg version'); $self->testResult(sub {$oBackupInfo->test(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_DB_VERSION, undef, - PG_VERSION_95)}, true, 'backup at new pg version'); + PG_VERSION_96)}, true, 'backup at new pg version'); $oHostBackup->stanzaUpgrade( 'upgrade fails with mismatched db-ids', {iExpectedExitStatus => ERROR_FILE_INVALID, strOptionalParam => '--no-online'}); @@ -229,7 +229,7 @@ sub run # Push a WAL and create a backup in the new DB to confirm diff changed to full #-------------------------------------------------------------------------------------------------------------------------- - storageTest()->put($strArchiveTestFile, $self->walGenerateContent(PG_VERSION_95)); + storageTest()->put($strArchiveTestFile, $self->walGenerateContent(PG_VERSION_96)); $oHostDbPrimary->archivePush($strWalPath, $strArchiveTestFile, 1); # Test backup is changed from type=DIFF to FULL (WARN message displayed) diff --git a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm index 551158ba4..911c42a44 100644 --- a/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm +++ b/test/lib/pgBackRestTest/Module/Real/RealAllTest.pm @@ -52,7 +52,6 @@ sub run foreach my $rhRun ( - {pg => '9.3', dst => 'backup', tls => 0, stg => AZURE, enc => 0, cmp => NONE, rt => 2, bnd => 0, bi => 0}, {pg => '9.4', dst => 'db-standby', tls => 0, stg => POSIX, enc => 1, cmp => LZ4, rt => 1, bnd => 1, bi => 0}, {pg => '9.5', dst => 'backup', tls => 1, stg => GCS, enc => 0, cmp => BZ2, rt => 1, bnd => 0, bi => 1}, {pg => '9.6', dst => 'backup', tls => 0, stg => POSIX, enc => 0, cmp => NONE, rt => 2, bnd => 1, bi => 1}, @@ -62,7 +61,7 @@ sub run {pg => '13', dst => 'db-standby', tls => 1, stg => GCS, enc => 0, cmp => ZST, rt => 1, bnd => 1, bi => 1}, {pg => '14', dst => 'sftp-srvr', tls => 0, stg => SFTP, enc => 0, cmp => LZ4, rt => 1, bnd => 1, bi => 0}, {pg => '15', dst => 'db-standby', tls => 0, stg => AZURE, enc => 0, cmp => NONE, rt => 2, bnd => 1, bi => 1}, - {pg => '16', dst => 'db-standby', tls => 0, stg => S3, enc => 1, cmp => NONE, rt => 1, bnd => 0, bi => 0}, + {pg => '16', dst => 'backup', tls => 0, stg => S3, enc => 1, cmp => NONE, rt => 1, bnd => 0, bi => 0}, ) { # Only run tests for this pg version @@ -419,7 +418,7 @@ sub run # Start a backup so the next backup has to restart it. This test is not required for PostgreSQL >= 9.6 since backups are run # in non-exclusive mode. - if ($oHostDbPrimary->pgVersion() >= PG_VERSION_93 && $oHostDbPrimary->pgVersion() < PG_VERSION_96) + if ($oHostDbPrimary->pgVersion() < PG_VERSION_96) { $oHostDbPrimary->sqlSelectOne("select pg_start_backup('test backup that will cause an error', true)"); diff --git a/test/src/common/harnessPostgres.c b/test/src/common/harnessPostgres.c index f22bc19bd..6bae6ac5b 100644 --- a/test/src/common/harnessPostgres.c +++ b/test/src/common/harnessPostgres.c @@ -11,10 +11,6 @@ Harness for PostgreSQL Interface /*********************************************************************************************************************************** Interface definition ***********************************************************************************************************************************/ -uint32_t hrnPgInterfaceCatalogVersion093(void); -void hrnPgInterfaceControl093(unsigned int controlVersion, unsigned int crc, PgControl pgControl, unsigned char *buffer); -void hrnPgInterfaceWal093(unsigned int magic, PgWal pgWal, unsigned char *buffer); - uint32_t hrnPgInterfaceCatalogVersion094(void); void hrnPgInterfaceControl094(unsigned int controlVersion, unsigned int crc, PgControl pgControl, unsigned char *buffer); void hrnPgInterfaceWal094(unsigned int magic, PgWal pgWal, unsigned char *buffer); @@ -142,13 +138,6 @@ static const HrnPgInterface hrnPgInterface[] = .control = hrnPgInterfaceControl094, .wal = hrnPgInterfaceWal094, }, - { - .version = PG_VERSION_93, - - .catalogVersion = hrnPgInterfaceCatalogVersion093, - .control = hrnPgInterfaceControl093, - .wal = hrnPgInterfaceWal093, - }, }; /*********************************************************************************************************************************** diff --git a/test/src/common/harnessPostgres.h b/test/src/common/harnessPostgres.h index 4841086f5..27953abdd 100644 --- a/test/src/common/harnessPostgres.h +++ b/test/src/common/harnessPostgres.h @@ -17,8 +17,6 @@ Control file size used to create pg_control /*********************************************************************************************************************************** System id constants by version ***********************************************************************************************************************************/ -#define HRN_PG_SYSTEMID_93 (10000000000000000000ULL + (uint64_t)PG_VERSION_93) -#define HRN_PG_SYSTEMID_93_Z "10000000000000090300" #define HRN_PG_SYSTEMID_94 (10000000000000000000ULL + (uint64_t)PG_VERSION_94) #define HRN_PG_SYSTEMID_94_Z "10000000000000090400" #define HRN_PG_SYSTEMID_95 (10000000000000000000ULL + (uint64_t)PG_VERSION_95) diff --git a/test/src/common/harnessPostgres/harness093.c b/test/src/common/harnessPostgres/harness093.c deleted file mode 100644 index 6aa565463..000000000 --- a/test/src/common/harnessPostgres/harness093.c +++ /dev/null @@ -1,10 +0,0 @@ -/*********************************************************************************************************************************** -Harness for PostgreSQL Interface (see PG_VERSION for version) -***********************************************************************************************************************************/ -#include "build.auto.h" - -#define PG_VERSION PG_VERSION_93 - -#include "common/harnessPostgres/harnessVersion.intern.h" - -HRN_PG_INTERFACE(093); diff --git a/test/src/common/harnessPostgres/harnessVersion.intern.h b/test/src/common/harnessPostgres/harnessVersion.intern.h index 0d0ca2f08..1ce629151 100644 --- a/test/src/common/harnessPostgres/harnessVersion.intern.h +++ b/test/src/common/harnessPostgres/harnessVersion.intern.h @@ -16,7 +16,7 @@ Get the catalog version ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define HRN_PG_INTERFACE_CATALOG_VERSION(version) \ uint32_t \ @@ -32,7 +32,7 @@ Create a pg_control file ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define HRN_PG_INTERFACE_CONTROL_TEST(version) \ void \ @@ -70,7 +70,7 @@ Create a WAL file ***********************************************************************************************************************************/ #if PG_VERSION > PG_VERSION_MAX -#elif PG_VERSION >= PG_VERSION_93 +#elif PG_VERSION >= PG_VERSION_94 #define HRN_PG_INTERFACE_WAL_TEST(version) \ void \ diff --git a/test/src/module/command/archiveCommonTest.c b/test/src/module/command/archiveCommonTest.c index 1967aa860..1dabb695e 100644 --- a/test/src/module/command/archiveCommonTest.c +++ b/test/src/module/command/archiveCommonTest.c @@ -386,15 +386,15 @@ testRun(void) walSegmentNext(STRDEF("000000010000000100000001"), 16 * 1024 * 1024, PG_VERSION_10), "000000010000000100000002", "get next"); TEST_RESULT_STR_Z( - walSegmentNext(STRDEF("0000000100000001000000FE"), 16 * 1024 * 1024, PG_VERSION_93), "0000000100000001000000FF", + walSegmentNext(STRDEF("0000000100000001000000FE"), 16 * 1024 * 1024, PG_VERSION_94), "0000000100000001000000FF", "get next"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("check overflow by version"); TEST_RESULT_STR_Z( - walSegmentNext(STRDEF("0000009900000001000000FF"), 16 * 1024 * 1024, PG_VERSION_93), "000000990000000200000000", - "get next overflow >= 9.3"); + walSegmentNext(STRDEF("0000009900000001000000FF"), 16 * 1024 * 1024, PG_VERSION_94), "000000990000000200000000", + "get next overflow >= 9.4"); TEST_RESULT_STR_Z( walSegmentNext(STRDEF("000000010000000100000003"), 1024 * 1024 * 1024, PG_VERSION_11), "000000010000000200000000", "get next overflow >= 11/1GB"); @@ -410,16 +410,16 @@ testRun(void) TEST_TITLE("single segment"); TEST_RESULT_STRLST_Z( - walSegmentRange(STRDEF("000000010000000100000000"), 16 * 1024 * 1024, PG_VERSION_93, 1), "000000010000000100000000\n", + walSegmentRange(STRDEF("000000010000000100000000"), 16 * 1024 * 1024, PG_VERSION_94, 1), "000000010000000100000000\n", "get single"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("check range by version"); TEST_RESULT_STRLST_Z( - walSegmentRange(STRDEF("0000000100000001000000FD"), 16 * 1024 * 1024, PG_VERSION_93, 4), + walSegmentRange(STRDEF("0000000100000001000000FD"), 16 * 1024 * 1024, PG_VERSION_94, 4), "0000000100000001000000FD\n0000000100000001000000FE\n0000000100000001000000FF\n000000010000000200000000\n", - "get range >= 9.3"); + "get range >= 9.4"); TEST_RESULT_STRLST_Z( walSegmentRange(STRDEF("000000080000000A00000000"), 1024 * 1024 * 1024, PG_VERSION_11, 8), "000000080000000A00000000\n000000080000000A00000001\n000000080000000A00000002\n000000080000000A00000003\n" diff --git a/test/src/module/command/archiveGetTest.c b/test/src/module/command/archiveGetTest.c index 0f4df4c29..3e9f2397d 100644 --- a/test/src/module/command/archiveGetTest.c +++ b/test/src/module/command/archiveGetTest.c @@ -84,7 +84,7 @@ testRun(void) TEST_RESULT_STRLST_Z( queueNeed(STRDEF("000000010000000A00000FFD"), true, queueSize, walSegmentSize, PG_VERSION_11), - "000000010000000B00000000\n000000010000000B00000001\n000000010000000B00000002\n", "queue has wal >= 9.3"); + "000000010000000B00000000\n000000010000000B00000001\n000000010000000B00000002\n", "queue has wal"); TEST_STORAGE_LIST( storageSpool(), STORAGE_SPOOL_ARCHIVE_IN, diff --git a/test/src/module/command/backupTest.c b/test/src/module/command/backupTest.c index 1bb7be6df..e0e3de983 100644 --- a/test/src/module/command/backupTest.c +++ b/test/src/module/command/backupTest.c @@ -1928,7 +1928,7 @@ testRun(void) TEST_TITLE("reset checksum-page when the cluster does not have checksums enabled"); // Create pg_control - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_93); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_94); // Create stanza argList = strLstNew(); @@ -1951,11 +1951,11 @@ testRun(void) HRN_PQ_SCRIPT_SET( // Connect to primary - HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_93, TEST_PATH "/pg1", false, NULL, NULL)); + HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_94, TEST_PATH "/pg1", false, NULL, NULL)); TEST_RESULT_VOID( dbFree( - backupInit(infoBackupNew(PG_VERSION_93, HRN_PG_SYSTEMID_93, hrnPgCatalogVersion(PG_VERSION_93), NULL))->dbPrimary), + backupInit(infoBackupNew(PG_VERSION_94, HRN_PG_SYSTEMID_94, hrnPgCatalogVersion(PG_VERSION_94), NULL))->dbPrimary), "backup init"); TEST_RESULT_BOOL(cfgOptionBool(cfgOptChecksumPage), false, "check checksum-page"); @@ -1966,7 +1966,7 @@ testRun(void) TEST_TITLE("ok if cluster checksums are enabled and checksum-page is any value"); // Create pg_control with page checksums - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_93, .pageChecksum = true); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_94, .pageChecksum = true); argList = strLstNew(); hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); @@ -1978,24 +1978,24 @@ testRun(void) HRN_PQ_SCRIPT_SET( // Connect to primary - HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_93, TEST_PATH "/pg1", false, NULL, NULL)); + HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_94, TEST_PATH "/pg1", false, NULL, NULL)); TEST_RESULT_VOID( dbFree( - backupInit(infoBackupNew(PG_VERSION_93, HRN_PG_SYSTEMID_93, hrnPgCatalogVersion(PG_VERSION_93), NULL))->dbPrimary), + backupInit(infoBackupNew(PG_VERSION_94, HRN_PG_SYSTEMID_94, hrnPgCatalogVersion(PG_VERSION_94), NULL))->dbPrimary), "backup init"); TEST_RESULT_BOOL(cfgOptionBool(cfgOptChecksumPage), false, "check checksum-page"); // Create pg_control without page checksums - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_93); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_94); HRN_PQ_SCRIPT_SET( // Connect to primary - HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_93, TEST_PATH "/pg1", false, NULL, NULL)); + HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_94, TEST_PATH "/pg1", false, NULL, NULL)); TEST_RESULT_VOID( dbFree( - backupInit(infoBackupNew(PG_VERSION_93, HRN_PG_SYSTEMID_93, hrnPgCatalogVersion(PG_VERSION_93), NULL))->dbPrimary), + backupInit(infoBackupNew(PG_VERSION_94, HRN_PG_SYSTEMID_94, hrnPgCatalogVersion(PG_VERSION_94), NULL))->dbPrimary), "backup init"); TEST_RESULT_BOOL(cfgOptionBool(cfgOptChecksumPage), false, "check checksum-page"); } @@ -2007,7 +2007,7 @@ testRun(void) TEST_TITLE("sleep retries and stall error"); // Create pg_control - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_93); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_94); // Create stanza StringList *argList = strLstNew(); @@ -2029,7 +2029,7 @@ testRun(void) HRN_PQ_SCRIPT_SET( // Connect to primary - HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_93, TEST_PATH "/pg1", false, NULL, NULL), + HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_94, TEST_PATH "/pg1", false, NULL, NULL), // Advance the time slowly to force retries HRN_PQ_SCRIPT_TIME_QUERY(1, 1575392588998), @@ -2043,7 +2043,7 @@ testRun(void) HRN_PQ_SCRIPT_TIME_QUERY(1, 1575392589999)); BackupData *backupData = backupInit( - infoBackupNew(PG_VERSION_93, HRN_PG_SYSTEMID_93, hrnPgCatalogVersion(PG_VERSION_93), NULL)); + infoBackupNew(PG_VERSION_94, HRN_PG_SYSTEMID_94, hrnPgCatalogVersion(PG_VERSION_94), NULL)); TEST_RESULT_INT(backupTime(backupData, true), 1575392588, "multiple tries for sleep"); TEST_ERROR(backupTime(backupData, true), KernelError, "PostgreSQL clock has not advanced to the next second after 3 tries"); diff --git a/test/src/module/command/checkTest.c b/test/src/module/command/checkTest.c index 73ff746d9..95817b949 100644 --- a/test/src/module/command/checkTest.c +++ b/test/src/module/command/checkTest.c @@ -259,8 +259,8 @@ testRun(void) // Two standbys found but no primary HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_93, "/pgdata", true, NULL, NULL), - HRN_PQ_SCRIPT_OPEN_GE_93(8, "dbname='postgres' port=5433", PG_VERSION_93, "/pgdata", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_94, "/pgdata", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN_GE_93(8, "dbname='postgres' port=5433", PG_VERSION_94, "/pgdata", true, NULL, NULL), HRN_PQ_SCRIPT_CLOSE(8), HRN_PQ_SCRIPT_CLOSE(1)); diff --git a/test/src/module/command/infoTest.c b/test/src/module/command/infoTest.c index bd330b4f6..8d74f63fc 100644 --- a/test/src/module/command/infoTest.c +++ b/test/src/module/command/infoTest.c @@ -138,17 +138,17 @@ testRun(void) HRN_INFO_PUT( storageTest, TEST_PATH "/repo/" STORAGE_PATH_BACKUP "/stanza1/" INFO_BACKUP_FILE, "[db]\n" - "db-catalog-version=201409291\n" - "db-control-version=942\n" + "db-catalog-version=201608131\n" + "db-control-version=960\n" "db-id=2\n" "db-system-id=6569239123849665679\n" - "db-version=\"9.4\"\n" + "db-version=\"9.6\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201306121,\"db-control-version\":937,\"db-system-id\":6569239123849665666" - ",\"db-version\":\"9.3\"}\n" - "2={\"db-catalog-version\":201409291,\"db-control-version\":942,\"db-system-id\":6569239123849665679" - ",\"db-version\":\"9.4\"}\n"); + "1={\"db-catalog-version\":201510051,\"db-control-version\":960,\"db-system-id\":6569239123849665666" + ",\"db-version\":\"9.5\"}\n" + "2={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665679" + ",\"db-version\":\"9.6\"}\n"); TEST_RESULT_STR_Z( infoRender(), @@ -218,16 +218,16 @@ testRun(void) "[db]\n" "db-id=3\n" "db-system-id=6569239123849665679\n" - "db-version=\"9.4\"\n" + "db-version=\"9.6\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6569239123849665679,\"db-version\":\"9.4\"}\n" - "2={\"db-id\":6569239123849665666,\"db-version\":\"9.3\"}\n" - "3={\"db-id\":6569239123849665679,\"db-version\":\"9.4\"}\n"); + "1={\"db-id\":6569239123849665679,\"db-version\":\"9.6\"}\n" + "2={\"db-id\":6569239123849665666,\"db-version\":\"9.5\"}\n" + "3={\"db-id\":6569239123849665679,\"db-version\":\"9.6\"}\n"); - // Create a WAL directory in 9.3-2 but since there are no WAL files or backups it will not show + // Create a WAL directory in 9.5-2 but since there are no WAL files or backups it will not show HRN_STORAGE_PATH_CREATE( - storageRepoWrite(), STORAGE_REPO_ARCHIVE "/9.3-2/0000000100000000", + storageRepoWrite(), STORAGE_REPO_ARCHIVE "/9.5-2/0000000100000000", .comment = "create empty db2 archive WAL1 directory"); // archive section will cross reference backup db-id 2 to archive db-id 3 but db section will only use the db-ids from @@ -266,7 +266,7 @@ testRun(void) "\"id\":2," "\"repo-key\":1" "}," - "\"id\":\"9.4-3\"," + "\"id\":\"9.6-3\"," "\"max\":null," "\"min\":null" "}" @@ -278,13 +278,13 @@ testRun(void) "\"id\":1," "\"repo-key\":1," "\"system-id\":6569239123849665666," - "\"version\":\"9.3\"" + "\"version\":\"9.5\"" "}," "{" "\"id\":2," "\"repo-key\":1," "\"system-id\":6569239123849665679," - "\"version\":\"9.4\"" + "\"version\":\"9.6\"" "}" "]," "\"name\":\"stanza1\"," @@ -316,7 +316,7 @@ testRun(void) " cipher: none\n" "\n" " db (current)\n" - " wal archive min/max (9.4): none present\n", + " wal archive min/max (9.6): none present\n", "text - single stanza, no valid backups, backup/expire lock detected"); // Notify child to release lock @@ -351,7 +351,7 @@ testRun(void) // Add WAL segment HRN_STORAGE_PUT_EMPTY( storageRepoIdxWrite(0), - STORAGE_REPO_ARCHIVE "/9.4-3/0000000300000000/000000030000000000000001-47dff2b7552a9d66e4bae1a762488a6885e7082c.gz", + STORAGE_REPO_ARCHIVE "/9.6-3/0000000300000000/000000030000000000000001-47dff2b7552a9d66e4bae1a762488a6885e7082c.gz", .comment = "write WAL db3 timeline 3 repo1"); TEST_RESULT_STR_Z( @@ -361,7 +361,7 @@ testRun(void) " cipher: none\n" "\n" " db (current)\n" - " wal archive min/max (9.4): 000000030000000000000001/000000030000000000000001\n", + " wal archive min/max (9.6): 000000030000000000000001/000000030000000000000001\n", "text - multi-repo, single stanza, one wal segment"); // ------------------------------------------------------------------------------------------------------------------------- @@ -370,34 +370,34 @@ testRun(void) // Db1 and Db3 (from above) have same system-id and db-version so consider them the same for WAL reporting HRN_STORAGE_PUT_EMPTY( storageRepoIdxWrite(0), - STORAGE_REPO_ARCHIVE "/9.4-1/0000000100000000/000000010000000000000002-ac61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz", + STORAGE_REPO_ARCHIVE "/9.6-1/0000000100000000/000000010000000000000002-ac61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz", .comment = "write WAL db1 timeline 1 repo1"); HRN_STORAGE_PUT_EMPTY( storageRepoIdxWrite(0), - STORAGE_REPO_ARCHIVE "/9.4-1/0000000100000000/000000010000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz", + STORAGE_REPO_ARCHIVE "/9.6-1/0000000100000000/000000010000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz", .comment = "write WAL db1 timeline 1 repo1"); HRN_STORAGE_PUT_EMPTY( storageRepoIdxWrite(0), - STORAGE_REPO_ARCHIVE "/9.4-1/0000000200000000/000000020000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz", + STORAGE_REPO_ARCHIVE "/9.6-1/0000000200000000/000000020000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz", .comment = "write WAL db1 timeline 2 repo1"); HRN_STORAGE_PATH_CREATE( - storageRepoWrite(), STORAGE_REPO_ARCHIVE "/9.4-1/0000000300000000", + storageRepoWrite(), STORAGE_REPO_ARCHIVE "/9.6-1/0000000300000000", .comment = "create empty db1 timeline 3 directory"); - // Create a WAL file in 9.3-2 so that a prior will show + // Create a WAL file in 9.5-2 so that a prior will show HRN_STORAGE_PUT_EMPTY( storageRepoIdxWrite(0), - STORAGE_REPO_ARCHIVE "/9.3-2/0000000100000000/000000010000000000000001-ac61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz", + STORAGE_REPO_ARCHIVE "/9.5-2/0000000100000000/000000010000000000000001-ac61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz", .comment = "write WAL db2 timeline 1 repo1"); HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201409291\n" - "db-control-version=942\n" + "db-catalog-version=201608131\n" + "db-control-version=960\n" "db-id=3\n" "db-system-id=6569239123849665679\n" - "db-version=\"9.4\"\n" + "db-version=\"9.6\"\n" "\n" "[backup:current]\n" "20181116-154756F={\"backrest-format\":5,\"backrest-version\":\"2.04\"," @@ -416,12 +416,12 @@ testRun(void) "\"option-online\":true}\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201409291,\"db-control-version\":942,\"db-system-id\":6569239123849665679" - ",\"db-version\":\"9.4\"}\n" - "2={\"db-catalog-version\":201306121,\"db-control-version\":937,\"db-system-id\":6569239123849665666" - ",\"db-version\":\"9.3\"}\n" - "3={\"db-catalog-version\":201409291,\"db-control-version\":942,\"db-system-id\":6569239123849665679" - ",\"db-version\":\"9.4\"}\n"); + "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665679" + ",\"db-version\":\"9.6\"}\n" + "2={\"db-catalog-version\":201510051,\"db-control-version\":960,\"db-system-id\":6569239123849665666" + ",\"db-version\":\"9.5\"}\n" + "3={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665679" + ",\"db-version\":\"9.6\"}\n"); // Execute while a backup lock is held HRN_FORK_BEGIN() @@ -459,7 +459,7 @@ testRun(void) "\"id\":1," "\"repo-key\":1" "}," - "\"id\":\"9.4-1\"," + "\"id\":\"9.6-1\"," "\"max\":\"000000020000000000000003\"," "\"min\":\"000000010000000000000002\"" "}," @@ -468,7 +468,7 @@ testRun(void) "\"id\":2," "\"repo-key\":1" "}," - "\"id\":\"9.3-2\"," + "\"id\":\"9.5-2\"," "\"max\":\"000000010000000000000001\"," "\"min\":\"000000010000000000000001\"" "}," @@ -477,7 +477,7 @@ testRun(void) "\"id\":3," "\"repo-key\":1" "}," - "\"id\":\"9.4-3\"," + "\"id\":\"9.6-3\"," "\"max\":\"000000030000000000000001\"," "\"min\":\"000000030000000000000001\"" "}" @@ -550,19 +550,19 @@ testRun(void) "\"id\":1," "\"repo-key\":1," "\"system-id\":6569239123849665679," - "\"version\":\"9.4\"" + "\"version\":\"9.6\"" "}," "{" "\"id\":2," "\"repo-key\":1," "\"system-id\":6569239123849665666," - "\"version\":\"9.3\"" + "\"version\":\"9.5\"" "}," "{" "\"id\":3," "\"repo-key\":1," "\"system-id\":6569239123849665679," - "\"version\":\"9.4\"" + "\"version\":\"9.6\"" "}" "]," "\"name\":\"stanza1\"," @@ -594,10 +594,10 @@ testRun(void) " cipher: none\n" "\n" " db (prior)\n" - " wal archive min/max (9.3): 000000010000000000000001/000000010000000000000001\n" + " wal archive min/max (9.5): 000000010000000000000001/000000010000000000000001\n" "\n" " db (current)\n" - " wal archive min/max (9.4): 000000010000000000000002/000000030000000000000001\n" + " wal archive min/max (9.6): 000000010000000000000002/000000030000000000000001\n" "\n" " full backup: 20181116-154756F\n" " timestamp start/stop: 2018-11-16 15:47:56+00 / 2018-11-16 15:48:09+00\n" @@ -620,14 +620,28 @@ testRun(void) HRN_FORK_END(); // Cleanup - HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/9.3-2", .recurse = true); - HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/9.4-3", .recurse = true); + HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/9.6-1", .recurse = true); + HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/9.5-2", .recurse = true); + HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/9.6-3", .recurse = true); // backup.info/archive.info files exist, backups exist, archives exist, multi-repo (mixed) with one stanza existing on both // repos and the db history is different between the repos // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("mixed multi-repo, percent complete non-null"); + HRN_STORAGE_PUT_EMPTY( + storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE + "/stanza1/9.4-1/0000000100000000/000000010000000000000002-ac61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz", + .comment = "write WAL db1 timeline 1 repo1"); + HRN_STORAGE_PUT_EMPTY( + storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE + "/stanza1/9.4-1/0000000100000000/000000010000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz", + .comment = "write WAL db1 timeline 1 repo1"); + HRN_STORAGE_PUT_EMPTY( + storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE + "/stanza1/9.4-1/0000000200000000/000000020000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz", + .comment = "write WAL db1 timeline 2 repo1"); + HRN_INFO_PUT( storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/" INFO_ARCHIVE_FILE, "[db]\n" diff --git a/test/src/module/command/stanzaTest.c b/test/src/module/command/stanzaTest.c index 24b551c83..18c806d8b 100644 --- a/test/src/module/command/stanzaTest.c +++ b/test/src/module/command/stanzaTest.c @@ -563,10 +563,10 @@ testRun(void) TEST_TITLE("pgControl and database match"); // Create pg_control - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_93); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_94); HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_93, TEST_PATH "/pg", false, NULL, NULL)); + HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_94, TEST_PATH "/pg", false, NULL, NULL)); TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - db online"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1"); @@ -584,7 +584,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdStanzaUpgrade, argList); HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_93, TEST_PATH "/pg", false, NULL, NULL)); + HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_94, TEST_PATH "/pg", false, NULL, NULL)); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - db online"); TEST_RESULT_LOG( diff --git a/test/src/module/command/verifyTest.c b/test/src/module/command/verifyTest.c index e0651b40c..0b6d2d896 100644 --- a/test/src/module/command/verifyTest.c +++ b/test/src/module/command/verifyTest.c @@ -231,11 +231,11 @@ testRun(void) TEST_MANIFEST_HEADER "\n" "[backup:db]\n" - "db-catalog-version=201306121\n" - "db-control-version=937\n" + "db-catalog-version=201608131\n" + "db-control-version=960\n" "db-id=1\n" - "db-system-id=" HRN_PG_SYSTEMID_94_Z "\n" - "db-version=\"9.3\"\n" + "db-system-id=" HRN_PG_SYSTEMID_94_Z "\n" // 9.4 system id is used so version will trigger error + "db-version=\"9.6\"\n" TEST_MANIFEST_OPTION_ALL TEST_MANIFEST_TARGET TEST_MANIFEST_DB @@ -256,7 +256,7 @@ testRun(void) TEST_RESULT_LOG( "P00 DETAIL: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152138F/backup.manifest.copy'" " for read\n" - "P00 INFO: '20181119-152138F' may not be recoverable - PG data (id 1, version 9.3, system-id" + "P00 INFO: '20181119-152138F' may not be recoverable - PG data (id 1, version 9.6, system-id" " " HRN_PG_SYSTEMID_94_Z ") is not in the backup.info history, skipping"); // ------------------------------------------------------------------------------------------------------------------------- diff --git a/test/src/module/db/dbTest.c b/test/src/module/db/dbTest.c index 11198dbb4..86b928616 100644 --- a/test/src/module/db/dbTest.c +++ b/test/src/module/db/dbTest.c @@ -83,7 +83,7 @@ testRun(void) HRN_PQ_SCRIPT_OPEN(1, "dbname='testdb' port=5432"), HRN_PQ_SCRIPT_SET_SEARCH_PATH(1), HRN_PQ_SCRIPT_SET_CLIENT_ENCODING(1), - HRN_PQ_SCRIPT_VALIDATE_QUERY(1, PG_VERSION_93, TEST_PATH "/pg", NULL, NULL), + HRN_PQ_SCRIPT_VALIDATE_QUERY(1, PG_VERSION_94, TEST_PATH "/pg", NULL, NULL), HRN_PQ_SCRIPT_SET_APPLICATION_NAME(1), HRN_PQ_SCRIPT_IS_STANDBY_QUERY(1, false), HRN_PQ_SCRIPT_CLOSE(1), @@ -91,7 +91,7 @@ testRun(void) HRN_PQ_SCRIPT_OPEN(1, "dbname='testdb' port=5432"), HRN_PQ_SCRIPT_SET_SEARCH_PATH(1), HRN_PQ_SCRIPT_SET_CLIENT_ENCODING(1), - HRN_PQ_SCRIPT_VALIDATE_QUERY(1, PG_VERSION_93, TEST_PATH "/pg", NULL, NULL), + HRN_PQ_SCRIPT_VALIDATE_QUERY(1, PG_VERSION_94, TEST_PATH "/pg", NULL, NULL), HRN_PQ_SCRIPT_SET_APPLICATION_NAME(1), HRN_PQ_SCRIPT_IS_STANDBY_QUERY(1, false), HRN_PQ_SCRIPT_CREATE_RESTORE_POINT(1, "2/3"), @@ -130,7 +130,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdBackup, argList); // Create control file - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_94); // Create client ProtocolClient *client = NULL; @@ -206,7 +206,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdBackup, argList); // Create control file - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93, .checkpoint = pgLsnFromStr(STRDEF("1/1"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_94, .checkpoint = pgLsnFromStr(STRDEF("1/1"))); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("error when unable to select any pg_settings"); @@ -262,7 +262,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("PostgreSQL 9.5 start/stop backup"); - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93, .checkpoint = pgLsnFromStr(STRDEF("2/3"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_95, .checkpoint = pgLsnFromStr(STRDEF("2/3"))); HRN_PQ_SCRIPT_SET( // Connect to primary @@ -317,7 +317,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("PostgreSQL 9.5 start/stop backup where backup is in progress"); - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93, .checkpoint = pgLsnFromStr(STRDEF("2/5"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_95, .checkpoint = pgLsnFromStr(STRDEF("2/5"))); HRN_PQ_SCRIPT_SET( // Connect to primary @@ -354,7 +354,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("PostgreSQL 9.6 start/stop backup"); - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93, .checkpoint = pgLsnFromStr(STRDEF("3/3"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_96, .checkpoint = pgLsnFromStr(STRDEF("3/3"))); HRN_PQ_SCRIPT_SET( // Connect to primary @@ -414,8 +414,8 @@ testRun(void) HRN_CFG_LOAD(cfgCmdBackup, argList); // Create control file - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/4"))); - HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_93, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/4"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_95, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/4"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_95, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/4"))); HRN_PQ_SCRIPT_SET( // Connect to primary @@ -475,8 +475,8 @@ testRun(void) TEST_TITLE("PostgreSQL 10 start/stop backup from standby"); // Update control file - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/5"))); - HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_93, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/5"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_10, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/5"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_10, .timeline = 5, .checkpoint = pgLsnFromStr(STRDEF("5/5"))); HRN_PQ_SCRIPT_SET( // Connect to primary @@ -583,7 +583,7 @@ testRun(void) TEST_RESULT_VOID(dbReplayWait(db.standby, STRDEF("5/5"), dbPgControl(db.primary).timeline, 1000), "sync standby"); // Update timeline to demonstrate that it is reloaded in dbReplayWait() - HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_93, .timeline = 6, .checkpoint = pgLsnFromStr(STRDEF("5/5"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_10, .timeline = 6, .checkpoint = pgLsnFromStr(STRDEF("5/5"))); TEST_ERROR( dbReplayWait(db.standby, STRDEF("5/5"), 77, 1000), DbMismatchError, "standby is on timeline 6 but expected 77"); @@ -681,7 +681,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdBackup, argList); // Create control file - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_93); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_94); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("error connecting to primary"); @@ -736,7 +736,7 @@ testRun(void) HRN_PQ_SCRIPT_SET( HRN_PQ_SCRIPT_OPEN_GE_93( - 1, "dbname='postgres' port=5432 user='bob'", PG_VERSION_93, TEST_PATH "/pg1", false, NULL, NULL), + 1, "dbname='postgres' port=5432 user='bob'", PG_VERSION_94, TEST_PATH "/pg1", false, NULL, NULL), HRN_PQ_SCRIPT_CLOSE(1)); TEST_ASSIGN(result, dbGet(true, true, false), "get primary only"); @@ -745,7 +745,7 @@ testRun(void) TEST_RESULT_BOOL(result.primary != NULL, true, "check primary"); TEST_RESULT_INT(result.standbyIdx, 0, "check standby id"); TEST_RESULT_BOOL(result.standby == NULL, true, "check standby"); - TEST_RESULT_INT(dbPgVersion(result.primary), PG_VERSION_93, "version set"); + TEST_RESULT_INT(dbPgVersion(result.primary), PG_VERSION_94, "version set"); TEST_RESULT_STR_Z(dbPgDataPath(result.primary), TEST_PATH "/pg1", "path set"); TEST_RESULT_VOID(dbFree(result.primary), "free primary"); @@ -762,7 +762,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdBackup, argList); // Create control file - HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_93); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_95); HRN_PQ_SCRIPT_SET( HRN_PQ_SCRIPT_OPEN_GE_93(1, "dbname='postgres' port=5432", PG_VERSION_95, TEST_PATH "/pg1", false, NULL, NULL), diff --git a/test/src/module/info/manifestTest.c b/test/src/module/info/manifestTest.c index 1f802854a..b6d44be45 100644 --- a/test/src/module/info/manifestTest.c +++ b/test/src/module/info/manifestTest.c @@ -67,15 +67,6 @@ testRun(void) "backup-timestamp-stop=0\n" \ "backup-type=\"full\"\n" - #define TEST_MANIFEST_DB_93 \ - "\n" \ - "[backup:db]\n" \ - "db-catalog-version=201306121\n" \ - "db-control-version=937\n" \ - "db-id=0\n" \ - "db-system-id=0\n" \ - "db-version=\"9.3\"\n" - #define TEST_MANIFEST_DB_94 \ "\n" \ "[backup:db]\n" \ @@ -171,10 +162,10 @@ testRun(void) Storage *storagePgWrite = storagePosixNewP(STRDEF(TEST_PATH "/pg"), .write = true); // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("manifest with all features - 9.3"); + TEST_TITLE("manifest with all features - 9.4"); // Version - HRN_STORAGE_PUT_Z(storagePgWrite, PG_FILE_PGVERSION, "9.3\n", .modeFile = 0600, .timeModified = 1565282100); + HRN_STORAGE_PUT_Z(storagePgWrite, PG_FILE_PGVERSION, "9.4\n", .modeFile = 0600, .timeModified = 1565282100); // base/1 directory HRN_STORAGE_PATH_CREATE(storagePgWrite, PG_PATH_BASE, .mode = 0700); @@ -276,13 +267,13 @@ testRun(void) storagePgWrite, "pg_xlog/archive_status/" BOGUS_STR, "TESTDATA", .modeFile = 0600, .timeModified = 1565282120); // Tablespace 1 - HRN_STORAGE_PATH_CREATE(storageTest, "ts/1/PG_9.3_201306121/1", .mode = 0700); + HRN_STORAGE_PATH_CREATE(storageTest, "ts/1/PG_9.4_201409291/1", .mode = 0700); HRN_STORAGE_PATH_CREATE(storagePgWrite, MANIFEST_TARGET_PGTBLSPC, .mode = 0700); THROW_ON_SYS_ERROR(symlink("../../ts/1", TEST_PATH "/pg/pg_tblspc/1") == -1, FileOpenError, "unable to create symlink"); HRN_STORAGE_PUT_Z( - storagePgWrite,"pg_tblspc/1/PG_9.3_201306121/1/16384", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); + storagePgWrite,"pg_tblspc/1/PG_9.4_201409291/1/16384", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); HRN_STORAGE_PUT_Z( - storagePgWrite,"pg_tblspc/1/PG_9.3_201306121/1/t123_123_fsm", "IGNORE_TEMP_RELATION", .modeFile = 0600, + storagePgWrite,"pg_tblspc/1/PG_9.4_201409291/1/t123_123_fsm", "IGNORE_TEMP_RELATION", .modeFile = 0600, .timeModified = 1565282115); // Add tablespaceList with error (no name) @@ -297,7 +288,7 @@ testRun(void) // Test tablespace error TEST_ERROR( manifestNewBuild( - storagePg, PG_VERSION_93, hrnPgCatalogVersion(PG_VERSION_93), 0, false, false, false, false, NULL, exclusionList, + storagePg, PG_VERSION_94, hrnPgCatalogVersion(PG_VERSION_94), 0, false, false, false, false, NULL, exclusionList, pckWriteResult(tablespaceList)), AssertError, "tablespace with oid 1 not found in tablespace map\n" @@ -322,7 +313,7 @@ testRun(void) TEST_ASSIGN( manifest, manifestNewBuild( - storagePg, PG_VERSION_93, hrnPgCatalogVersion(PG_VERSION_93), 0, false, false, false, false, NULL, NULL, + storagePg, PG_VERSION_94, hrnPgCatalogVersion(PG_VERSION_94), 0, false, false, false, false, NULL, NULL, pckWriteResult(tablespaceList)), "build manifest"); TEST_RESULT_VOID(manifestBackupLabelSet(manifest, STRDEF("20190818-084502F")), "backup label set"); @@ -335,7 +326,7 @@ testRun(void) strNewBuf( harnessInfoChecksumZ( TEST_MANIFEST_HEADER_LABEL - TEST_MANIFEST_DB_93 + TEST_MANIFEST_DB_94 TEST_MANIFEST_OPTION_ALL "\n" "[backup:target]\n" @@ -352,13 +343,11 @@ testRun(void) "pg_data/base/1/555_init.1={\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_vm.1_vm={\"size\":0,\"timestamp\":1565282114}\n" "pg_data/global/pg_internal.init.allow={\"size\":0,\"timestamp\":1565282114}\n" - "pg_data/pg_dynshmem/BOGUS={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/pg_hba.conf={\"size\":9,\"timestamp\":1565282117}\n" - "pg_data/pg_replslot/BOGUS={\"size\":0,\"timestamp\":1565282103}\n" "pg_data/pg_xlog/BOGUS={\"size\":0,\"timestamp\":1565282108}\n" "pg_data/pg_xlog/archive_status/BOGUS={\"size\":8,\"timestamp\":1565282120}\n" "pg_data/postgresql.conf={\"size\":14,\"timestamp\":1565282116}\n" - "pg_tblspc/1/PG_9.3_201306121/1/16384={\"size\":8,\"timestamp\":1565282115}\n" + "pg_tblspc/1/PG_9.4_201409291/1/16384={\"size\":8,\"timestamp\":1565282115}\n" TEST_MANIFEST_FILE_DEFAULT_PRIMARY_TRUE "\n" "[target:link]\n" @@ -385,8 +374,8 @@ testRun(void) "pg_data/pg_xlog/archive_status={\"mode\":\"0777\"}\n" "pg_tblspc={}\n" "pg_tblspc/1={}\n" - "pg_tblspc/1/PG_9.3_201306121={}\n" - "pg_tblspc/1/PG_9.3_201306121/1={}\n" + "pg_tblspc/1/PG_9.4_201409291={}\n" + "pg_tblspc/1/PG_9.4_201409291/1={}\n" TEST_MANIFEST_PATH_DEFAULT)), "check manifest"); @@ -401,10 +390,10 @@ testRun(void) // Remove symlinks and directories THROW_ON_SYS_ERROR(unlink(TEST_PATH "/pg/pg_tblspc/1") == -1, FileRemoveError, "unable to remove symlink"); - HRN_STORAGE_PATH_REMOVE(storageTest,"ts/1/PG_9.3_201306121", .recurse = true); + HRN_STORAGE_PATH_REMOVE(storageTest,"ts/1/PG_9.4_201409291", .recurse = true); // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("manifest with all features - 9.3, online"); + TEST_TITLE("manifest with all features - 9.4, online"); // Create a path other than archive_status under pg_xlog for code coverage HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_xlog/somepath", .mode = 0700); @@ -421,7 +410,7 @@ testRun(void) TEST_ASSIGN( manifest, manifestNewBuild( - storagePg, PG_VERSION_93, hrnPgCatalogVersion(PG_VERSION_93), 0, true, false, false, false, NULL, NULL, NULL), + storagePg, PG_VERSION_94, hrnPgCatalogVersion(PG_VERSION_94), 0, true, false, false, false, NULL, NULL, NULL), "build manifest"); contentSave = bufNew(0); @@ -431,7 +420,7 @@ testRun(void) strNewBuf( harnessInfoChecksumZ( TEST_MANIFEST_HEADER - TEST_MANIFEST_DB_93 + TEST_MANIFEST_DB_94 TEST_MANIFEST_OPTION_ARCHIVE TEST_MANIFEST_OPTION_CHECKSUM_PAGE_FALSE TEST_MANIFEST_OPTION_ONLINE_TRUE @@ -448,11 +437,8 @@ testRun(void) "pg_data/base/1/555_init.1={\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_vm.1_vm={\"size\":0,\"timestamp\":1565282114}\n" "pg_data/global/pg_internal.init.allow={\"size\":0,\"timestamp\":1565282114}\n" - "pg_data/pg_dynshmem/BOGUS={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/pg_hba.conf={\"size\":9,\"timestamp\":1565282117}\n" - "pg_data/pg_replslot/BOGUS={\"size\":0,\"timestamp\":1565282103}\n" "pg_data/pg_wal/000000010000000000000001={\"size\":7,\"timestamp\":1565282120}\n" - "pg_data/postgresql.auto.conf.tmp={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/postgresql.conf={\"size\":14,\"timestamp\":1565282116}\n" TEST_MANIFEST_FILE_DEFAULT_PRIMARY_TRUE "\n" diff --git a/test/src/module/postgres/interfaceTest.c b/test/src/module/postgres/interfaceTest.c index c0c286cdf..bf12ae3aa 100644 --- a/test/src/module/postgres/interfaceTest.c +++ b/test/src/module/postgres/interfaceTest.c @@ -18,7 +18,7 @@ testRun(void) // ***************************************************************************************************************************** if (testBegin("pgVersionFromStr() and pgVersionToStr()")) { - TEST_ERROR(pgVersionFromStr(STRDEF("9.3.4")), AssertError, "version 9.3.4 format is invalid"); + TEST_ERROR(pgVersionFromStr(STRDEF("9.4.4")), AssertError, "version 9.4.4 format is invalid"); TEST_ERROR(pgVersionFromStr(STRDEF("abc")), AssertError, "version abc format is invalid"); TEST_ERROR(pgVersionFromStr(NULL), AssertError, "assertion 'version != NULL' failed"); @@ -28,7 +28,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_RESULT_STR_Z(pgVersionToStr(PG_VERSION_11), "11", "infoPgVersionToString 11"); TEST_RESULT_STR_Z(pgVersionToStr(PG_VERSION_96), "9.6", "infoPgVersionToString 9.6"); - TEST_RESULT_STR_Z(pgVersionToStr(93456), "9.34", "infoPgVersionToString 93456"); + TEST_RESULT_STR_Z(pgVersionToStr(94456), "9.44", "infoPgVersionToString 94456"); } // ***************************************************************************************************************************** @@ -53,7 +53,7 @@ testRun(void) pgControlVersion(70300), VersionNotSupportedError, "invalid PostgreSQL version 70300\n" "HINT: is this version of PostgreSQL supported?"); - TEST_RESULT_UINT(pgControlVersion(PG_VERSION_93), 937, "9.3 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"); } @@ -115,7 +115,7 @@ testRun(void) TEST_RESULT_UINT(info.timeline, 47, "check timeline"); // ------------------------------------------------------------------------------------------------------------------------- - HRN_PG_CONTROL_PUT(storageTest, PG_VERSION_93, .walSegmentSize = 1024 * 1024); + HRN_PG_CONTROL_PUT(storageTest, PG_VERSION_94, .walSegmentSize = 1024 * 1024); TEST_ERROR( pgControlFromFile(storageTest, NULL), FormatError, @@ -128,13 +128,13 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- HRN_PG_CONTROL_PUT( - storageTest, PG_VERSION_93, .systemId = 0xEFEFEFEFEF, .catalogVersion = hrnPgCatalogVersion(PG_VERSION_93), + storageTest, PG_VERSION_94, .systemId = 0xEFEFEFEFEF, .catalogVersion = hrnPgCatalogVersion(PG_VERSION_94), .checkpoint = 0xAABBAABBEEFFEEFF, .timeline = 88); TEST_ASSIGN(info, pgControlFromFile(storageTest, NULL), "get control info v90"); TEST_RESULT_UINT(info.systemId, 0xEFEFEFEFEF, " check system id"); - TEST_RESULT_UINT(info.version, PG_VERSION_93, " check version"); - TEST_RESULT_UINT(info.catalogVersion, 201306121, " check catalog version"); + TEST_RESULT_UINT(info.version, PG_VERSION_94, " check version"); + TEST_RESULT_UINT(info.catalogVersion, 201409291, " check catalog version"); TEST_RESULT_UINT(info.checkpoint, 0xAABBAABBEEFFEEFF, "check checkpoint"); TEST_RESULT_UINT(info.timeline, 88, "check timeline"); @@ -219,8 +219,8 @@ testRun(void) TEST_RESULT_STR_Z(pgLsnName(PG_VERSION_96), "location", "check location name"); TEST_RESULT_STR_Z(pgLsnName(PG_VERSION_10), "lsn", "check lsn name"); - TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_93, 201306121), "PG_9.3_201306121", "check 9.3 tablespace id"); - TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_94, 999999999), "PG_9.4_999999999", "check 9.4 tablespace id"); + TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_94, 201306121), "PG_9.4_201306121", "check 9.4 tablespace id"); + TEST_RESULT_STR_Z(pgTablespaceId(PG_VERSION_16, 999999999), "PG_16_999999999", "check 16 tablespace id"); TEST_RESULT_STR_Z(pgWalName(PG_VERSION_96), "xlog", "check xlog name"); TEST_RESULT_STR_Z(pgWalName(PG_VERSION_10), "wal", "check wal name"); @@ -287,12 +287,12 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- memset(bufPtr(result), 0, bufSize(result)); - HRN_PG_WAL_TO_BUFFER(result, PG_VERSION_93, .systemId = 0xEAEAEAEA, .size = PG_WAL_SEGMENT_SIZE_DEFAULT); + HRN_PG_WAL_TO_BUFFER(result, PG_VERSION_94, .systemId = 0xEAEAEAEA, .size = PG_WAL_SEGMENT_SIZE_DEFAULT); storagePutP(storageNewWriteP(storageTest, walFile), result); - TEST_ASSIGN(info, pgWalFromFile(walFile, storageTest, NULL), "get wal info v9.3"); + TEST_ASSIGN(info, pgWalFromFile(walFile, storageTest, NULL), "get wal info v9.4"); TEST_RESULT_UINT(info.systemId, 0xEAEAEAEA, " check system id"); - TEST_RESULT_UINT(info.version, PG_VERSION_93, " check version"); + TEST_RESULT_UINT(info.version, PG_VERSION_94, " check version"); TEST_RESULT_UINT(info.size, PG_WAL_SEGMENT_SIZE_DEFAULT, " check size"); // ------------------------------------------------------------------------------------------------------------------------- diff --git a/test/test.pl b/test/test.pl index 0381fef8b..12376cd40 100755 --- a/test/test.pl +++ b/test/test.pl @@ -100,7 +100,7 @@ test.pl [options] --coverage-only only run coverage tests (as a subset of selected tests) for the documentation Configuration Options: - --psql-bin path to the psql executables (e.g. /usr/lib/postgresql/9.3/bin/) + --psql-bin path to the psql executables (e.g. /usr/lib/postgresql/16/bin/) --test-path path where tests are executed (defaults to ./test) --log-level log level to use for test harness (and Perl tests) (defaults to INFO) --log-level-test log level to use for C tests (defaults to OFF)