pg.ddx.io  pgbackrest/pgbackrest GitHub issues and pull requests  
help / color / mirror / Atom feed
[pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
10+ messages / 2 participants
[nested] [flat]

* [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-16 15:41 "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  0 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-16 15:41 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

Per our policy to support five EOL versions of PostgreSQL, 9.6 is no longer supported by pgBackRest. This removes all logic associated with 9.6 and updates the tests.

All supported versions use the wal/lsn names introduced in PostgreSQL 10, so PG_VERSION_WAL_RENAME, pgLsnName(), pgWalName(), pgWalPath(), and pgXactPath() have been removed. The paths are now the PG_PATH_PGWAL and PG_PATH_PGXACT defines and the queries use the wal/lsn function names directly. The pg_read_all_settings hint no longer qualifies the role as being for PostgreSQL >= 10.

inline patch 1: CONTRIBUTING.md, build/postgres.yaml, doc/xml/contributing.xml and 32 more (+507/-912 lines) download inline-1.patchdiff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b8e1a5d06..802cb19073 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -789,8 +789,8 @@ A PostgreSQL libpq shim is provided to simulate interactions with PostgreSQL. Be ``` // Set up two standbys but no primary HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_96, "/pgdata", true, NULL, NULL), - HRN_PQ_SCRIPT_OPEN(8, "dbname='postgres' port=5433", PG_VERSION_96, "/pgdata", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_18, "/pgdata", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN(8, "dbname='postgres' port=5433", PG_VERSION_18, "/pgdata", true, NULL, NULL), // Close the "inner" session first (8) then the outer (1) HRN_PQ_SCRIPT_CLOSE(8), diff --git a/build/postgres.yaml b/build/postgres.yaml index 3a012ee918..ebbf1c0952 100644 --- a/build/postgres.yaml +++ b/build/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.6 - 10 - 11 - 12 diff --git a/doc/xml/contributing.xml b/doc/xml/contributing.xml index 014e3a1ed4..2bdc09daae 100644 --- a/doc/xml/contributing.xml +++ b/doc/xml/contributing.xml @@ -937,8 +937,8 @@ HRN_FORK_END(); <code-block> // Set up two standbys but no primary HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_96, "/pgdata", true, NULL, NULL), - HRN_PQ_SCRIPT_OPEN(8, "dbname='postgres' port=5433", PG_VERSION_96, "/pgdata", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_18, "/pgdata", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN(8, "dbname='postgres' port=5433", PG_VERSION_18, "/pgdata", true, NULL, NULL), // Close the "inner" session first (8) then the outer (1) HRN_PQ_SCRIPT_CLOSE(8), diff --git a/src/command/archive/push/push.c b/src/command/archive/push/push.c index 7cee580a1c..c89d2dd3a1 100644 --- a/src/command/archive/push/push.c +++ b/src/command/archive/push/push.c @@ -437,7 +437,7 @@ cmdArchivePush(void) /**********************************************************************************************************************************/ typedef struct ArchivePushAsyncData { - const String *walPath; // Path to pg_wal/pg_xlog + const String *walPath; // Path to pg_wal StringList *walFileList; // List of wal files to process unsigned int walFileIdx; // Current index in the list to be processed CompressType compressType; // Type of compression for WAL segments diff --git a/src/command/backup/complete.c.inc b/src/command/backup/complete.c.inc index 28e79d3087..aee584a708 100644 --- a/src/command/backup/complete.c.inc +++ b/src/command/backup/complete.c.inc @@ -126,7 +126,7 @@ backupArchiveCheckCopy(const BackupData *const backupData, Manifest *const manif // Copy the file const String *const manifestName = strNewFmt( - MANIFEST_TARGET_PGDATA "/%s/%s", strZ(pgWalPath(manifestData(manifest)->pgVersion)), strZ(walSegment)); + MANIFEST_TARGET_PGDATA "/" PG_PATH_PGWAL "/%s", strZ(walSegment)); storageCopyP( read, diff --git a/src/command/backup/process.c.inc b/src/command/backup/process.c.inc index 0feababa36..4a2359f594 100644 --- a/src/command/backup/process.c.inc +++ b/src/command/backup/process.c.inc @@ -816,10 +816,9 @@ backupProcess(const BackupData *const backupData, Manifest *const manifest, cons // Build expression to identify files that can be copied from the standby when standby backup is supported .standbyExp = regExpNew( - strNewFmt( - "^((" MANIFEST_TARGET_PGDATA "/(" PG_PATH_BASE "|" PG_PATH_GLOBAL "|%s|" PG_PATH_PGMULTIXACT "))" - "|" MANIFEST_TARGET_PGTBLSPC ")/", - strZ(pgXactPath(backupData->version)))), + STRDEF( + "^((" MANIFEST_TARGET_PGDATA "/(" PG_PATH_BASE "|" PG_PATH_GLOBAL "|" PG_PATH_PGXACT "|" + PG_PATH_PGMULTIXACT "))|" MANIFEST_TARGET_PGTBLSPC ")/")), }; if (jobData.bundle) diff --git a/src/db/db.c b/src/db/db.c index 24b2891586..458d27005f 100644 --- a/src/db/db.c +++ b/src/db/db.c @@ -278,7 +278,7 @@ dbOpen(Db *const this) DbQueryError, "unable to select some rows from pg_settings\n" "HINT: is the backup running as the postgres user?\n" - "HINT: is the pg_read_all_settings role assigned for " PG_NAME " >= " PG_VERSION_10_Z "?"); + "HINT: is the pg_read_all_settings role assigned?"); } } @@ -304,8 +304,7 @@ dbOpen(Db *const this) // Set application name to help identify the backup session dbExec(this, strNewFmt("set application_name = '%s'", strZ(this->applicationName))); - // There is no need to have parallelism enabled in a backup session. In particular, 9.6 marks pg_stop_backup() as - // parallel-safe but an error will be thrown if pg_stop_backup() is run in a worker. + // There is no need to have parallelism enabled in a backup session dbExec(this, STRDEF("set max_parallel_workers_per_gather = 0")); // Is the cluster a standby? @@ -333,9 +332,9 @@ dbBackupStartQuery(const unsigned int pgVersion, const bool startFast) String *result = strCatFmt( strNew(), "select lsn::text as lsn,\n" - " pg_catalog.pg_%sfile_name(lsn)::text as wal_segment_name\n" + " pg_catalog.pg_walfile_name(lsn)::text as wal_segment_name\n" " from pg_catalog.pg_%s('" PROJECT_NAME " backup started at ' || current_timestamp::text", - strZ(pgWalName(pgVersion)), pgVersion >= PG_VERSION_15 ? "backup_start" : "start_backup"); + pgVersion >= PG_VERSION_15 ? "backup_start" : "start_backup"); // Start backup after immediate checkpoint if (startFast) @@ -389,12 +388,7 @@ dbBackupStart(Db *const this, const bool startFast, const bool archiveCheck) if (archiveCheck) { walSegmentCheck = pckReadStrP( - dbQueryColumn( - this, - strNewFmt( - "select pg_catalog.pg_%sfile_name(pg_catalog.pg_current_%s_insert_%s())::text", - strZ(pgWalName(dbPgVersion(this))), strZ(pgWalName(dbPgVersion(this))), - strZ(pgLsnName(dbPgVersion(this)))))); + dbQueryColumn(this, STRDEF("select pg_catalog.pg_walfile_name(pg_catalog.pg_current_wal_insert_lsn())::text"))); } // Start backup @@ -455,24 +449,21 @@ dbBackupStopQuery(const unsigned int pgVersion) String *const result = strCatFmt( strNew(), "select lsn::text as lsn,\n" - " pg_catalog.pg_%sfile_name(lsn)::text as wal_segment_name,\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_%s(", - strZ(pgWalName(pgVersion)), pgVersion >= PG_VERSION_15 ? "backup_stop" : "stop_backup"); + pgVersion >= PG_VERSION_15 ? "backup_stop" : "stop_backup"); // Use non-exclusive backup mode when available if (pgVersion <= PG_VERSION_14) strCatZ(result, FALSE_Z); // Disable archive checking since we do this elsewhere - if (pgVersion >= PG_VERSION_10) - { - if (pgVersion <= PG_VERSION_14) - strCatZ(result, ", "); + if (pgVersion <= PG_VERSION_14) + strCatZ(result, ", "); - strCatZ(result, FALSE_Z); - } + strCatZ(result, FALSE_Z); // Complete query strCatZ(result, ")"); @@ -570,9 +561,7 @@ dbReplayWait(Db *const this, const String *const targetLsn, const uint32_t targe // Loop until lsn has been reached or timeout Wait *wait = waitNew(timeout); bool targetReached = false; - const char *const lsnName = strZ(pgLsnName(dbPgVersion(this))); - const String *const replayLsnFunction = strNewFmt( - "pg_catalog.pg_last_%s_replay_%s()", strZ(pgWalName(dbPgVersion(this))), lsnName); + const String *const replayLsnFunction = STRDEF("pg_catalog.pg_last_wal_replay_lsn()"); const String *replayLsn = NULL; do @@ -647,10 +636,10 @@ dbReplayWait(Db *const this, const String *const targetLsn, const uint32_t targe { // Build the query const String *const query = strNewFmt( - "select (checkpoint_%s >= '%s')::bool as targetReached,\n" - " checkpoint_%s::text as checkpointLsn\n" + "select (checkpoint_lsn >= '%s')::bool as targetReached,\n" + " checkpoint_lsn::text as checkpointLsn\n" " from pg_catalog.pg_control_checkpoint()", - lsnName, strZ(targetLsn), lsnName); + strZ(targetLsn)); // Execute the query and get checkpointLsn PackRead *const read = dbQueryRow(this, query); @@ -774,9 +763,8 @@ dbWalSwitch(Db *const this) dbQueryColumn(this, STRDEF("select pg_catalog.pg_create_restore_point('" PROJECT_NAME " Archive Check')::text")); // Request a WAL segment switch - const char *const walName = strZ(pgWalName(dbPgVersion(this))); const String *const walFileName = pckReadStrP( - dbQueryColumn(this, strNewFmt("select pg_catalog.pg_%sfile_name(pg_catalog.pg_switch_%s())::text", walName, walName))); + dbQueryColumn(this, STRDEF("select pg_catalog.pg_walfile_name(pg_catalog.pg_switch_wal())::text"))); // Copy WAL segment name to the prior context MEM_CONTEXT_PRIOR_BEGIN() diff --git a/src/info/manifest/build.c.inc b/src/info/manifest/build.c.inc index 105a1e8bdb..9bba2c148e 100644 --- a/src/info/manifest/build.c.inc +++ b/src/info/manifest/build.c.inc @@ -8,7 +8,6 @@ typedef struct ManifestBuildData const String *tablespaceId; // Tablespace id if PostgreSQL version has one bool online; // Is this an online backup? bool checksumPage; // Are page checksums being checked? - const String *manifestWalName; // Wal manifest name for this version of PostgreSQL RegExp *dbPathExp; // Identify paths containing relations RegExp *tempRelationExp; // Identify temp relations const Pack *tablespaceList; // List of tablespaces in the database @@ -207,7 +206,7 @@ manifestBuildInfo( } // Skip the contents of archive_status when online - if (buildData->online && strEq(manifestParentName, buildData->manifestWalName) && + if (buildData->online && strEq(manifestParentName, STRDEF(MANIFEST_TARGET_PGDATA "/" PG_PATH_PGWAL)) && strEqZ(info->name, PG_PATH_ARCHIVE_STATUS)) { FUNCTION_TEST_RETURN_VOID(); @@ -284,7 +283,7 @@ manifestBuildInfo( // Skip the contents of the wal path when online. WAL will be restored from the archive or stored in the wal directory // at the end of the backup if the archive-copy option is set. - if (buildData->online && strEq(manifestParentName, buildData->manifestWalName)) + if (buildData->online && strEq(manifestParentName, STRDEF(MANIFEST_TARGET_PGDATA "/" PG_PATH_PGWAL))) FUNCTION_TEST_RETURN_VOID(); // Skip temp relations in db paths diff --git a/src/info/manifest/manifest.c b/src/info/manifest/manifest.c index ebd3ea1678..2e7263265b 100644 --- a/src/info/manifest/manifest.c +++ b/src/info/manifest/manifest.c @@ -129,7 +129,6 @@ manifestNewBuild( .checksumPage = checksumPage, .tablespaceList = tablespaceList, .linkCheck = &linkCheck, - .manifestWalName = strNewFmt(MANIFEST_TARGET_PGDATA "/%s", strZ(pgWalPath(pgVersion))), .blockIncrMap = blockIncrMap, }; diff --git a/src/postgres/interface.c b/src/postgres/interface.c index 070ad0ea14..7952ca5057 100644 --- a/src/postgres/interface.c +++ b/src/postgres/interface.c @@ -29,21 +29,6 @@ STRING_EXTERN(PG_FILE_STANDBYSIGNAL_STR, PG_FILE_STAN STRING_EXTERN(PG_PATH_GLOBAL_STR, PG_PATH_GLOBAL); -STRING_EXTERN(PG_NAME_WAL_STR, PG_NAME_WAL); -STRING_EXTERN(PG_NAME_XLOG_STR, PG_NAME_XLOG); - -// Wal path names depending on version -STRING_STATIC(PG_PATH_PGWAL_STR, "pg_wal"); -STRING_STATIC(PG_PATH_PGXLOG_STR, "pg_xlog"); - -// Transaction commit log path names depending on version -STRING_STATIC(PG_PATH_PGCLOG_STR, "pg_clog"); -STRING_STATIC(PG_PATH_PGXACT_STR, "pg_xact"); - -// Lsn name used in functions depending on version -STRING_STATIC(PG_NAME_LSN_STR, "lsn"); -STRING_STATIC(PG_NAME_LOCATION_STR, "location"); - /*********************************************************************************************************************************** The control file is 8192 bytes but only the first 512 bytes are used to prevent torn pages even on really old storage with 512-byte sectors. This is true across all versions of PostgreSQL. Unfortunately, this is not sufficient to prevent torn pages during @@ -693,52 +678,6 @@ pgLsnRangeToWalSegmentList( FUNCTION_TEST_RETURN(STRING_LIST, result); } -/**********************************************************************************************************************************/ -FN_EXTERN const String * -pgLsnName(const unsigned int pgVersion) -{ - FUNCTION_TEST_BEGIN(); - FUNCTION_TEST_PARAM(UINT, pgVersion); - FUNCTION_TEST_END(); - - FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_NAME_LSN_STR : PG_NAME_LOCATION_STR); -} - -/*********************************************************************************************************************************** -Get WAL name (wal/xlog) for a PostgreSQL version -***********************************************************************************************************************************/ -FN_EXTERN const String * -pgWalName(const unsigned int pgVersion) -{ - FUNCTION_TEST_BEGIN(); - FUNCTION_TEST_PARAM(UINT, pgVersion); - FUNCTION_TEST_END(); - - FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_NAME_WAL_STR : PG_NAME_XLOG_STR); -} - -/**********************************************************************************************************************************/ -FN_EXTERN const String * -pgWalPath(const unsigned int pgVersion) -{ - FUNCTION_TEST_BEGIN(); - FUNCTION_TEST_PARAM(UINT, pgVersion); - FUNCTION_TEST_END(); - - FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_PATH_PGWAL_STR : PG_PATH_PGXLOG_STR); -} - -/**********************************************************************************************************************************/ -FN_EXTERN const String * -pgXactPath(const unsigned int pgVersion) -{ - FUNCTION_TEST_BEGIN(); - FUNCTION_TEST_PARAM(UINT, pgVersion); - FUNCTION_TEST_END(); - - FUNCTION_TEST_RETURN_CONST(STRING, pgVersion >= PG_VERSION_WAL_RENAME ? PG_PATH_PGXACT_STR : PG_PATH_PGCLOG_STR); -} - /**********************************************************************************************************************************/ FN_EXTERN unsigned int pgVersionFromStr(const String *const version) diff --git a/src/postgres/interface.h b/src/postgres/interface.h index 3674e5dd1c..ced51968fd 100644 --- a/src/postgres/interface.h +++ b/src/postgres/interface.h @@ -52,14 +52,11 @@ STRING_DECLARE(PG_PATH_GLOBAL_STR); #define PG_PATH_PGSTATTMP "pg_stat_tmp" #define PG_PATH_PGSUBTRANS "pg_subtrans" #define PG_PATH_PGTBLSPC "pg_tblspc" +#define PG_PATH_PGWAL "pg_wal" +#define PG_PATH_PGXACT "pg_xact" #define PG_PREFIX_PGSQLTMP "pgsql_tmp" -#define PG_NAME_WAL "wal" -STRING_DECLARE(PG_NAME_WAL_STR); -#define PG_NAME_XLOG "xlog" -STRING_DECLARE(PG_NAME_XLOG_STR); - /*********************************************************************************************************************************** Define allowed page sizes ***********************************************************************************************************************************/ @@ -160,9 +157,6 @@ FN_EXTERN uint32_t pgTimelineFromWalSegment(const String *walSegment); FN_EXTERN StringList *pgLsnRangeToWalSegmentList( uint32_t timeline, uint64_t lsnStart, uint64_t lsnStop, unsigned int walSegmentSize); -// Get name used for lsn in functions (this was changed in PostgreSQL 10 for consistency since lots of names were changing) -FN_EXTERN const String *pgLsnName(unsigned int pgVersion); - // Calculate the checksum for a page. Page cannot be const because the page header is temporarily modified during processing. FN_EXTERN uint16_t pgPageChecksum(uint8_t *page, uint32_t blockNo, PgPageSize pageSize); @@ -172,14 +166,6 @@ FN_EXTERN bool pgPageSizeValid(PgPageSize pageSize); // Throws an error if page size is not valid FN_EXTERN void pgPageSizeCheck(PgPageSize pageSize); -FN_EXTERN const String *pgWalName(unsigned int pgVersion); - -// Get wal path (this was changed in PostgreSQL 10 to avoid including "log" in the name) -FN_EXTERN const String *pgWalPath(unsigned int pgVersion); - -// Get transaction commit log path (this was changed in PostgreSQL 10 to avoid including "log" in the name) -FN_EXTERN const String *pgXactPath(unsigned int pgVersion); - /*********************************************************************************************************************************** Macros for function logging ***********************************************************************************************************************************/ diff --git a/src/postgres/interface/version.vendor.h b/src/postgres/interface/version.vendor.h index c585a55f72..8f3e6203cf 100644 --- a/src/postgres/interface/version.vendor.h +++ b/src/postgres/interface/version.vendor.h @@ -47,7 +47,7 @@ typedef TransactionId MultiXactId; typedef uint64 MultiXactOffset; -#elif PG_VERSION >= PG_VERSION_96 +#elif PG_VERSION >= PG_VERSION_10 typedef uint32 MultiXactOffset; @@ -248,19 +248,6 @@ Types from src/include/catalog/catversion.h /* yyyymmddN */ #define CATALOG_VERSION_NO 201707211 -#elif PG_VERSION >= PG_VERSION_96 - -/* - * 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 201608131 - #endif /*********************************************************************************************************************************** @@ -328,11 +315,6 @@ Types from src/include/catalog/pg_control.h /* Version identifier for this pg_control format */ #define PG_CONTROL_VERSION 1002 -#elif PG_VERSION >= PG_VERSION_96 - -/* Version identifier for this pg_control format */ -#define PG_CONTROL_VERSION 960 - #endif // MOCK_AUTH_NONCE_LEN define @@ -505,7 +487,7 @@ typedef struct CheckPoint TransactionId oldestActiveXid; } CheckPoint; -#elif PG_VERSION >= PG_VERSION_96 +#elif PG_VERSION >= PG_VERSION_10 /* * Body of CheckPoint XLOG records. This is declared here because we keep @@ -1552,146 +1534,6 @@ typedef struct ControlFileData pg_crc32c crc; } ControlFileData; -#elif PG_VERSION >= PG_VERSION_96 - -/* - * 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; - bool wal_log_hints; - int MaxConnections; - int max_worker_processes; - 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 */ - - /* 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_crc32c crc; -} ControlFileData; - #endif /*********************************************************************************************************************************** @@ -1742,10 +1584,6 @@ Types from src/include/access/xlog_internal.h #define XLOG_PAGE_MAGIC 0xD097 /* can be used as WAL version indicator */ -#elif PG_VERSION >= PG_VERSION_96 - -#define XLOG_PAGE_MAGIC 0xD093 /* can be used as WAL version indicator */ - #endif // XLogPageHeaderData type @@ -1773,7 +1611,7 @@ typedef struct XLogPageHeaderData uint32 xlp_rem_len; /* total len of remaining data for record */ } XLogPageHeaderData; -#elif PG_VERSION >= PG_VERSION_96 +#elif PG_VERSION >= PG_VERSION_10 /* * Each page of XLOG file has a header like this: diff --git a/src/postgres/version.auto.h b/src/postgres/version.auto.h index bd707d6c6f..3602a98a9b 100644 --- a/src/postgres/version.auto.h +++ b/src/postgres/version.auto.h @@ -9,7 +9,6 @@ Automatically generated by 'build.py postgres-version' -- do not modify directly /*********************************************************************************************************************************** PostgreSQL version constants ***********************************************************************************************************************************/ -#define PG_VERSION_96 90600 #define PG_VERSION_10 100000 #define PG_VERSION_11 110000 #define PG_VERSION_12 120000 @@ -26,7 +25,6 @@ PostgreSQL version constants /*********************************************************************************************************************************** PostgreSQL version string constants for use in error messages ***********************************************************************************************************************************/ -#define PG_VERSION_96_Z "9.6" #define PG_VERSION_10_Z "10" #define PG_VERSION_11_Z "11" #define PG_VERSION_12_Z "12" diff --git a/src/postgres/version.h b/src/postgres/version.h index 40e0a6fee8..6af41b9518 100644 --- a/src/postgres/version.h +++ b/src/postgres/version.h @@ -14,9 +14,6 @@ PostgreSQL name /*********************************************************************************************************************************** Version where various PostgreSQL capabilities were introduced ***********************************************************************************************************************************/ -// xlog was renamed to wal -#define PG_VERSION_WAL_RENAME PG_VERSION_10 - // recovery settings are implemented as GUCs (recovery.conf is no longer valid) #define PG_VERSION_RECOVERY_GUC PG_VERSION_12 diff --git a/test/container.yaml b/test/container.yaml index 862b6bc01b..60b73f1c52 100644 --- a/test/container.yaml +++ b/test/container.yaml @@ -131,14 +131,12 @@ vm: os-base: debian image: ubuntu:22.04 db: - - 9.6 - 10 - 11 - 12 - 13 - 14 db-test: - - 9.6 - 11 coverage-c: true ssh-rsa: true @@ -149,7 +147,6 @@ vm: os-base: debian image: ubuntu:24.04 db: - - 9.6 - 10 - 11 - 12 diff --git a/test/src/harness/backup.c b/test/src/harness/backup.c index 37069bc4db..e8415c625e 100644 --- a/test/src/harness/backup.c +++ b/test/src/harness/backup.c @@ -289,24 +289,18 @@ hrnBackupPqScript(const unsigned int pgVersion, const time_t backupTimeStart, Hr { const char *const walSegment = param.walSwitch ? walSegmentStart : walSegmentPrior; - if (pgVersion <= PG_VERSION_96) - HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_CURRENT_WAL_LE_96(1, walSegment)); - else - HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_CURRENT_WAL_GE_10(1, walSegment)); + HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_CURRENT_WAL(1, walSegment)); } // Start backup - if (pgVersion == PG_VERSION_96) - HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_START_BACKUP_96(1, param.startFast, lsnStartStr, walSegmentStart)); - else - HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_START_BACKUP_GE_10(1, param.startFast, lsnStartStr, walSegmentStart)); + HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_START_BACKUP_GE_10(1, param.startFast, lsnStartStr, walSegmentStart)); // Switch WAL segment so it can be checked if (param.walSwitch) { HRN_PQ_SCRIPT_ADD( HRN_PQ_SCRIPT_CREATE_RESTORE_POINT(1, "X/X"), - HRN_PQ_SCRIPT_WAL_SWITCH(1, "wal", walSegmentStart)); + HRN_PQ_SCRIPT_WAL_SWITCH(1, walSegmentStart)); } // Get database list @@ -320,7 +314,7 @@ hrnBackupPqScript(const unsigned int pgVersion, const time_t backupTimeStart, Hr // Wait for standby to sync if (param.backupStandby) - HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_REPLAY_WAIT_96(2, lsnStartStr)); + HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_REPLAY_WAIT(2, lsnStartStr)); // Continue if WAL check succeeds if (!param.noPriorWal) @@ -348,10 +342,7 @@ hrnBackupPqScript(const unsigned int pgVersion, const time_t backupTimeStart, Hr HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_IS_STANDBY_QUERY(2, true)); // Stop backup - if (pgVersion == PG_VERSION_96) - HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_STOP_BACKUP_96(1, lsnStopStr, walSegmentStop, tablespace)); - else - HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_STOP_BACKUP_GE_10(1, lsnStopStr, walSegmentStop, tablespace)); + HRN_PQ_SCRIPT_ADD(HRN_PQ_SCRIPT_STOP_BACKUP_GE_10(1, lsnStopStr, walSegmentStop, tablespace)); // Get stop time HRN_PQ_SCRIPT_ADD( diff --git a/test/src/harness/host.c b/test/src/harness/host.c index 0c186e5521..f0d9c410cb 100644 --- a/test/src/harness/host.c +++ b/test/src/harness/host.c @@ -344,19 +344,15 @@ hrnHostPgConf(HrnHost *const this) strCatZ(config, "log_rotation_size = 0\n"); strCatZ(config, "log_error_verbosity = verbose\n"); - // Force parallel mode on to make sure we are disabling it and there are no issues. This is important for testing that 9.6 - // works since pg_stop_backup() is marked parallel safe and will error if run in a worker. - if (hrnHostPgVersion() >= PG_VERSION_96) - { - strCatZ(config, "\n"); + // Force parallel mode on to make sure we are disabling it and there are no issues + strCatZ(config, "\n"); - if (hrnHostPgVersion() >= PG_VERSION_16) - strCatZ(config, "debug_parallel_query = on\n"); - else - strCatZ(config, "force_parallel_mode = on\n"); + if (hrnHostPgVersion() >= PG_VERSION_16) + strCatZ(config, "debug_parallel_query = on\n"); + else + strCatZ(config, "force_parallel_mode = on\n"); - strCatZ(config, "max_parallel_workers_per_gather = 2\n"); - } + strCatZ(config, "max_parallel_workers_per_gather = 2\n"); // Write postgresql.conf storagePutP( diff --git a/test/src/harness/host.h b/test/src/harness/host.h index a0c3862c9c..4ef4fca1ae 100644 --- a/test/src/harness/host.h +++ b/test/src/harness/host.h @@ -429,7 +429,7 @@ hrnHostSqlCommit(HrnHost *const this) // Switch WAL segment #define HRN_HOST_WAL_SWITCH(this) \ - HRN_HOST_SQL_EXEC(this, zNewFmt("select pg_switch_%s()::text", strZ(pgWalName(hrnHostPgVersion())))) + HRN_HOST_SQL_EXEC(this, "select pg_switch_wal()::text") /*********************************************************************************************************************************** Helper functions diff --git a/test/src/harness/postgres.h b/test/src/harness/postgres.h index 09b60738ce..c5b27b7115 100644 --- a/test/src/harness/postgres.h +++ b/test/src/harness/postgres.h @@ -29,9 +29,6 @@ System id constants by version Generated by 'build.py postgres-harness' -- do not modify directly. ***********************************************************************************************************************************/ -#define HRN_PG_SYSTEMID_96 (10000000000000000000ULL + (uint64_t)PG_VERSION_96) -#define HRN_PG_SYSTEMID_96_Z "10000000000000090600" -#define HRN_PG_SYSTEMID_96_1_Z "10000000000000090601" #define HRN_PG_SYSTEMID_10 (10000000000000000000ULL + (uint64_t)PG_VERSION_10) #define HRN_PG_SYSTEMID_10_Z "10000000000000100000" #define HRN_PG_SYSTEMID_10_1_Z "10000000000000100001" diff --git a/test/src/harness/pq.h b/test/src/harness/pq.h index 8af67eb403..620c87b726 100644 --- a/test/src/harness/pq.h +++ b/test/src/harness/pq.h @@ -152,22 +152,7 @@ Macros for defining groups of functions that implement various queries and comma {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define HRN_PQ_SCRIPT_CURRENT_WAL_LE_96(sessionParam, walSegmentParam) \ - {.session = sessionParam, \ - .function = HRN_PQ_SENDQUERY, \ - .param = "[\"select pg_catalog.pg_xlogfile_name(pg_catalog.pg_current_xlog_insert_location())::text\"]", .resultInt = 1}, \ - {.session = sessionParam, .function = HRN_PQ_CONSUMEINPUT}, \ - {.session = sessionParam, .function = HRN_PQ_ISBUSY}, \ - {.session = sessionParam, .function = HRN_PQ_GETRESULT}, \ - {.session = sessionParam, .function = HRN_PQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ - {.session = sessionParam, .function = HRN_PQ_NTUPLES, .resultInt = 1}, \ - {.session = sessionParam, .function = HRN_PQ_NFIELDS, .resultInt = 1}, \ - {.session = sessionParam, .function = HRN_PQ_FTYPE, .param = "[0]", .resultInt = HRN_PQ_TYPE_TEXT}, \ - {.session = sessionParam, .function = HRN_PQ_GETVALUE, .param = "[0,0]", .resultZ = walSegmentParam}, \ - {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ - {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} - -#define HRN_PQ_SCRIPT_CURRENT_WAL_GE_10(sessionParam, walSegmentParam) \ +#define HRN_PQ_SCRIPT_CURRENT_WAL(sessionParam, walSegmentParam) \ {.session = sessionParam, \ .function = HRN_PQ_SENDQUERY, \ .param = "[\"select pg_catalog.pg_walfile_name(pg_catalog.pg_current_wal_insert_lsn())::text\"]", .resultInt = 1}, \ @@ -182,9 +167,9 @@ Macros for defining groups of functions that implement various queries and comma {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define HRN_PQ_SCRIPT_WAL_SWITCH(sessionParam, walNameParam, walFileNameParam) \ +#define HRN_PQ_SCRIPT_WAL_SWITCH(sessionParam, walFileNameParam) \ {.session = sessionParam, .function = HRN_PQ_SENDQUERY, \ - .param = "[\"select pg_catalog.pg_" walNameParam "file_name(pg_catalog.pg_switch_" walNameParam "())::text\"]", \ + .param = "[\"select pg_catalog.pg_walfile_name(pg_catalog.pg_switch_wal())::text\"]", \ .resultInt = 1}, \ {.session = sessionParam, .function = HRN_PQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRN_PQ_ISBUSY}, \ @@ -213,28 +198,6 @@ Macros for defining groups of functions that implement various queries and comma {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define HRN_PQ_SCRIPT_START_BACKUP_96(sessionParam, startFastParam, lsnParam, walSegmentNameParam) \ - {.session = sessionParam, \ - .function = HRN_PQ_SENDQUERY, \ - .param = zNewFmt( \ - "[\"select lsn::text as lsn,\\n" \ - " pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name\\n" \ - " from pg_catalog.pg_start_backup('pgBackRest backup started at ' || current_timestamp::text, %s, false) as lsn\"]", \ - cvtBoolToConstZ(startFastParam)), \ - .resultInt = 1}, \ - {.session = sessionParam, .function = HRN_PQ_CONSUMEINPUT}, \ - {.session = sessionParam, .function = HRN_PQ_ISBUSY}, \ - {.session = sessionParam, .function = HRN_PQ_GETRESULT}, \ - {.session = sessionParam, .function = HRN_PQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ - {.session = sessionParam, .function = HRN_PQ_NTUPLES, .resultInt = 1}, \ - {.session = sessionParam, .function = HRN_PQ_NFIELDS, .resultInt = 2}, \ - {.session = sessionParam, .function = HRN_PQ_FTYPE, .param = "[0]", .resultInt = HRN_PQ_TYPE_TEXT}, \ - {.session = sessionParam, .function = HRN_PQ_FTYPE, .param = "[1]", .resultInt = HRN_PQ_TYPE_TEXT}, \ - {.session = sessionParam, .function = HRN_PQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ - {.session = sessionParam, .function = HRN_PQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ - {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ - {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} - #define HRN_PQ_SCRIPT_START_BACKUP_GE_10(sessionParam, startFastParam, lsnParam, walSegmentNameParam) \ {.session = sessionParam, \ .function = HRN_PQ_SENDQUERY, \ @@ -279,34 +242,6 @@ Macros for defining groups of functions that implement various queries and comma {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define HRN_PQ_SCRIPT_STOP_BACKUP_96(sessionParam, lsnParam, walSegmentNameParam, tablespaceMapParam) \ - {.session = sessionParam, \ - .function = HRN_PQ_SENDQUERY, \ - .param = \ - "[\"select lsn::text as lsn,\\n" \ - " pg_catalog.pg_xlogfile_name(lsn)::text as wal_segment_name,\\n" \ - " labelfile::text as backuplabel_file,\\n" \ - " spcmapfile::text as tablespacemap_file\\n" \ - " from pg_catalog.pg_stop_backup(false)\"]", \ - .resultInt = 1}, \ - {.session = sessionParam, .function = HRN_PQ_CONSUMEINPUT}, \ - {.session = sessionParam, .function = HRN_PQ_ISBUSY}, \ - {.session = sessionParam, .function = HRN_PQ_GETRESULT}, \ - {.session = sessionParam, .function = HRN_PQ_RESULTSTATUS, .resultInt = PGRES_TUPLES_OK}, \ - {.session = sessionParam, .function = HRN_PQ_NTUPLES, .resultInt = 1}, \ - {.session = sessionParam, .function = HRN_PQ_NFIELDS, .resultInt = 4}, \ - {.session = sessionParam, .function = HRN_PQ_FTYPE, .param = "[0]", .resultInt = HRN_PQ_TYPE_TEXT}, \ - {.session = sessionParam, .function = HRN_PQ_FTYPE, .param = "[1]", .resultInt = HRN_PQ_TYPE_TEXT}, \ - {.session = sessionParam, .function = HRN_PQ_FTYPE, .param = "[2]", .resultInt = HRN_PQ_TYPE_TEXT}, \ - {.session = sessionParam, .function = HRN_PQ_FTYPE, .param = "[3]", .resultInt = HRN_PQ_TYPE_TEXT}, \ - {.session = sessionParam, .function = HRN_PQ_GETVALUE, .param = "[0,0]", .resultZ = lsnParam}, \ - {.session = sessionParam, .function = HRN_PQ_GETVALUE, .param = "[0,1]", .resultZ = walSegmentNameParam}, \ - {.session = sessionParam, .function = HRN_PQ_GETVALUE, .param = "[0,2]", .resultZ = "BACKUP_LABEL_DATA"}, \ - {.session = sessionParam, .function = HRN_PQ_GETVALUE, .param = "[0,3]", \ - .resultZ = tablespaceMapParam ? "TABLESPACE_MAP_DATA" : "\n"}, \ - {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ - {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} - #define HRN_PQ_SCRIPT_STOP_BACKUP_GE_10(sessionParam, lsnParam, walSegmentNameParam, tablespaceMapParam) \ {.session = sessionParam, \ .function = HRN_PQ_SENDQUERY, \ @@ -426,15 +361,13 @@ Macros for defining groups of functions that implement various queries and comma {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define \ - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED( \ - sessionParam, walNameParam, lsnNameParam, targetLsnParam, targetReachedParam, replayLsnParam) \ +#define HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(sessionParam, targetLsnParam, targetReachedParam, replayLsnParam) \ {.session = sessionParam, \ .function = HRN_PQ_SENDQUERY, \ .param = zNewFmt( \ "[\"select replayLsn::text,\\n" \ " (replayLsn > '%s')::bool as targetReached\\n" \ - " from pg_catalog.pg_last_" walNameParam "_replay_" lsnNameParam "() as replayLsn\"]", targetLsnParam), \ + " from pg_catalog.pg_last_wal_replay_lsn() as replayLsn\"]", targetLsnParam), \ .resultInt = 1}, \ {.session = sessionParam, .function = HRN_PQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRN_PQ_ISBUSY}, \ @@ -449,20 +382,14 @@ Macros for defining groups of functions that implement various queries and comma {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_LE_96(sessionParam, targetLsnParam, targetReachedParam, reachedLsnParam) \ - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(sessionParam, "xlog", "location", targetLsnParam, targetReachedParam, reachedLsnParam) - -#define HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_GE_10(sessionParam, targetLsnParam, targetReachedParam, reachedLsnParam) \ - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(sessionParam, "wal", "lsn", targetLsnParam, targetReachedParam, reachedLsnParam) - #define \ HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED( \ - sessionParam, lsnNameParam, targetLsnParam, targetReachedParam, checkpointLsnParam, sleepParam) \ + sessionParam, targetLsnParam, targetReachedParam, checkpointLsnParam, sleepParam) \ {.session = sessionParam, \ .function = HRN_PQ_SENDQUERY, \ .param = zNewFmt( \ - "[\"select (checkpoint_" lsnNameParam " >= '%s')::bool as targetReached,\\n" \ - " checkpoint_" lsnNameParam "::text as checkpointLsn\\n" \ + "[\"select (checkpoint_lsn >= '%s')::bool as targetReached,\\n" \ + " checkpoint_lsn::text as checkpointLsn\\n" \ " from pg_catalog.pg_control_checkpoint()\"]", targetLsnParam), \ .resultInt = 1, .sleep = sleepParam}, \ {.session = sessionParam, .function = HRN_PQ_CONSUMEINPUT}, \ @@ -478,27 +405,10 @@ Macros for defining groups of functions that implement various queries and comma {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define \ - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_96( \ - sessionParam, targetLsnParam, targetReachedParam, checkpointLsnParam, sleepParam) \ - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED( \ - sessionParam, "location", targetLsnParam, targetReachedParam, checkpointLsnParam, sleepParam) - -#define \ - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_GE_10( \ - sessionParam, targetLsnParam, targetReachedParam, checkpointLsnParam, sleepParam) \ - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED( \ - sessionParam, "lsn", targetLsnParam, targetReachedParam, checkpointLsnParam, sleepParam) - -#define HRN_PQ_SCRIPT_REPLAY_WAIT_96(sessionParam, targetLsnParam) \ - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_LE_96(sessionParam, targetLsnParam, true, "X/X"), \ - HRN_PQ_SCRIPT_CHECKPOINT(sessionParam), \ - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_96(sessionParam, targetLsnParam, true, "X/X", 0) - -#define HRN_PQ_SCRIPT_REPLAY_WAIT_GE_10(sessionParam, targetLsnParam) \ - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_GE_10(sessionParam, targetLsnParam, true, "X/X"), \ +#define HRN_PQ_SCRIPT_REPLAY_WAIT(sessionParam, targetLsnParam) \ + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(sessionParam, targetLsnParam, true, "X/X"), \ HRN_PQ_SCRIPT_CHECKPOINT(sessionParam), \ - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_GE_10(sessionParam, targetLsnParam, true, "X/X", 0) + HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED(sessionParam, targetLsnParam, true, "X/X", 0) #define HRN_PQ_SCRIPT_CLOSE(sessionParam) \ {.session = sessionParam, .function = HRN_PQ_FINISH} diff --git a/test/src/module/command/archive/pushTest.c b/test/src/module/command/archive/pushTest.c index 02b07413f6..ebe482a376 100644 --- a/test/src/module/command/archive/pushTest.c +++ b/test/src/module/command/archive/pushTest.c @@ -121,7 +121,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("mismatched pg_control and archive.info - pg version"); - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); // Create incorrect archive info HRN_INFO_PUT( @@ -135,7 +135,7 @@ testRun(void) TEST_ERROR( archivePushCheck(true), RepoInvalidError, "unable to find a valid repository:\n" - "repo1: [ArchiveMismatchError] PostgreSQL version 9.6, system-id " HRN_PG_SYSTEMID_96_Z " do not match repo1 stanza" + "repo1: [ArchiveMismatchError] PostgreSQL version 10, system-id " HRN_PG_SYSTEMID_10_Z " do not match repo1 stanza" " version 15, system-id 5555555555555555555\n" "HINT: are you archiving to the correct stanza?"); @@ -149,13 +149,13 @@ testRun(void) "db-id=1\n" "\n" "[db:history]\n" - "1={\"db-id\":5555555555555555555,\"db-version\":\"9.6\"}\n"); + "1={\"db-id\":5555555555555555555,\"db-version\":\"10\"}\n"); TEST_ERROR( archivePushCheck(true), RepoInvalidError, "unable to find a valid repository:\n" - "repo1: [ArchiveMismatchError] PostgreSQL version 9.6, system-id " HRN_PG_SYSTEMID_96_Z " do not match repo1 stanza" - " version 9.6, system-id 5555555555555555555\n" + "repo1: [ArchiveMismatchError] PostgreSQL version 10, system-id " HRN_PG_SYSTEMID_10_Z " do not match repo1 stanza" + " version 10, system-id 5555555555555555555\n" "HINT: are you archiving to the correct stanza?"); // ------------------------------------------------------------------------------------------------------------------------- @@ -168,17 +168,17 @@ testRun(void) "db-id=1\n" "\n" "[db:history]\n" - "1={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n"); + "1={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n"); ArchivePushCheckResult result = {0}; TEST_ASSIGN(result, archivePushCheck(true), "get archive check result"); - TEST_RESULT_UINT(result.pgVersion, PG_VERSION_96, "check pg version"); - TEST_RESULT_UINT(result.pgSystemId, HRN_PG_SYSTEMID_96, "check pg system id"); + TEST_RESULT_UINT(result.pgVersion, PG_VERSION_10, "check pg version"); + TEST_RESULT_UINT(result.pgSystemId, HRN_PG_SYSTEMID_10, "check pg system id"); ArchivePushFileRepoData *repoData = lstGet(result.repoList, 0); TEST_RESULT_UINT(repoData->repoIdx, 0, "check repo idx"); - TEST_RESULT_STR_Z(repoData->archiveId, "9.6-1", "check archive id"); + TEST_RESULT_STR_Z(repoData->archiveId, "10-1", "check archive id"); TEST_RESULT_UINT(cipherSpecType(repoData->cipherSpecArchive), cipherTypeNone, "check cipher type"); TEST_RESULT_PTR(cipherSpecPass(repoData->cipherSpecArchive), NULL, "check cipher pass (not set in this test)"); @@ -198,7 +198,7 @@ testRun(void) "db-id=1\n" "\n" "[db:history]\n" - "1={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n"); + "1={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n"); // repo4 has incorrect info HRN_INFO_PUT( @@ -211,18 +211,18 @@ testRun(void) TEST_ASSIGN(result, archivePushCheck(false), "get archive check result"); - TEST_RESULT_UINT(result.pgVersion, PG_VERSION_96, "check pg version"); - TEST_RESULT_UINT(result.pgSystemId, HRN_PG_SYSTEMID_96, "check pg system id"); + TEST_RESULT_UINT(result.pgVersion, PG_VERSION_10, "check pg version"); + TEST_RESULT_UINT(result.pgSystemId, HRN_PG_SYSTEMID_10, "check pg system id"); TEST_RESULT_STRLST_Z( result.errorList, - "repo4: [ArchiveMismatchError] repo2 stanza version 9.6, system-id " HRN_PG_SYSTEMID_96_Z " do not match repo4 stanza" + "repo4: [ArchiveMismatchError] repo2 stanza version 10, system-id " HRN_PG_SYSTEMID_10_Z " do not match repo4 stanza" " version 15, system-id 5555555555555555555\n" "HINT: are you archiving to the correct stanza?\n", "check error list"); repoData = lstGet(result.repoList, 0); TEST_RESULT_UINT(repoData->repoIdx, 0, "check repo idx"); - TEST_RESULT_STR_Z(repoData->archiveId, "9.6-1", "check archive id"); + TEST_RESULT_STR_Z(repoData->archiveId, "10-1", "check archive id"); TEST_RESULT_UINT(cipherSpecType(repoData->cipherSpecArchive), cipherTypeNone, "check cipher type"); TEST_RESULT_PTR(cipherSpecPass(repoData->cipherSpecArchive), NULL, "check cipher pass (not set in this test)"); @@ -237,22 +237,22 @@ testRun(void) "\n" "[db:history]\n" "1={\"db-id\":5555555555555555555,\"db-version\":\"16\"}\n" - "2={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n"); + "2={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n"); TEST_ASSIGN(result, archivePushCheck(false), "get archive check result"); - TEST_RESULT_UINT(result.pgVersion, PG_VERSION_96, "check pg version"); - TEST_RESULT_UINT(result.pgSystemId, HRN_PG_SYSTEMID_96, "check pg system id"); + TEST_RESULT_UINT(result.pgVersion, PG_VERSION_10, "check pg version"); + TEST_RESULT_UINT(result.pgSystemId, HRN_PG_SYSTEMID_10, "check pg system id"); repoData = lstGet(result.repoList, 0); TEST_RESULT_UINT(repoData->repoIdx, 0, "check repo idx"); - TEST_RESULT_STR_Z(repoData->archiveId, "9.6-1", "check repo2 archive id"); + TEST_RESULT_STR_Z(repoData->archiveId, "10-1", "check repo2 archive id"); TEST_RESULT_UINT(cipherSpecType(repoData->cipherSpecArchive), cipherTypeNone, "check repo2 cipher pass"); TEST_RESULT_PTR(cipherSpecPass(repoData->cipherSpecArchive), NULL, "check repo2 cipher pass (not set in this test)"); repoData = lstGet(result.repoList, 1); TEST_RESULT_UINT(repoData->repoIdx, 1, "check repo idx"); - TEST_RESULT_STR_Z(repoData->archiveId, "9.6-2", "check repo4 archive id"); + TEST_RESULT_STR_Z(repoData->archiveId, "10-2", "check repo4 archive id"); TEST_RESULT_UINT(cipherSpecType(repoData->cipherSpecArchive), cipherTypeNone, "check repo4 cipher type"); TEST_RESULT_PTR(cipherSpecPass(repoData->cipherSpecArchive), NULL, "check repo4 cipher pass (not set in this test)"); } @@ -736,7 +736,7 @@ testRun(void) hrnCfgArgRawBool(argList, cfgOptArchiveAsync, true); hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); - strLstAddZ(argList, TEST_PATH "/pg/pg_xlog/000000010000000100000001"); + strLstAddZ(argList, TEST_PATH "/pg/pg_wal/000000010000000100000001"); HRN_CFG_LOAD(cfgCmdArchivePush, argList); // Make the spool path read-only so the foreground fails to create the spool out path and reports the error directly instead @@ -799,10 +799,10 @@ testRun(void) // Write out an error file that will be ignored on the first pass, then the async process will write a new one StringList *argListTemp = strLstDup(argList); - strLstAddZ(argListTemp, TEST_PATH "/pg/pg_xlog/000000010000000100000001"); + strLstAddZ(argListTemp, TEST_PATH "/pg/pg_wal/000000010000000100000001"); HRN_CFG_LOAD(cfgCmdArchivePush, argListTemp); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); HRN_STORAGE_PUT_Z(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT "/000000010000000100000001.error", "25\nbogus error"); @@ -815,7 +815,7 @@ testRun(void) // Acquire a lock so the async process will not be able to run -- this will result in a timeout argListTemp = strLstDup(argList); - strLstAddZ(argListTemp, TEST_PATH "/pg/pg_xlog/000000010000000100000001"); + strLstAddZ(argListTemp, TEST_PATH "/pg/pg_wal/000000010000000100000001"); hrnCfgArgRawZ(argListTemp, cfgOptArchiveTimeout, "1"); HRN_CFG_LOAD(cfgCmdArchivePush, argListTemp); @@ -860,10 +860,10 @@ testRun(void) // Actually push a WAL file argListTemp = strLstDup(argList); - strLstAddZ(argListTemp, TEST_PATH "/pg/pg_xlog/000000010000000100000001"); + strLstAddZ(argListTemp, TEST_PATH "/pg/pg_wal/000000010000000100000001"); HRN_CFG_LOAD(cfgCmdArchivePush, argListTemp); - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/archive_status/000000010000000100000001.ready"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/archive_status/000000010000000100000001.ready"); Buffer *walBuffer1 = bufNew((size_t)16 * 1024 * 1024); bufUsedSet(walBuffer1, bufSize(walBuffer1)); @@ -871,7 +871,7 @@ testRun(void) HRN_PG_WAL_TO_BUFFER(walBuffer1, PG_VERSION_18); const char *walBuffer1Sha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, walBuffer1))); - HRN_STORAGE_PUT(storagePgWrite(),"pg_xlog/000000010000000100000001", walBuffer1); + HRN_STORAGE_PUT(storagePgWrite(),"pg_wal/000000010000000100000001", walBuffer1); TEST_RESULT_VOID(cmdArchivePush(), "push the WAL segment"); TEST_RESULT_LOG("P00 INFO: pushed WAL file '000000010000000100000001' to the archive asynchronously"); @@ -902,10 +902,10 @@ testRun(void) HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); - strLstAddZ(argList, TEST_PATH "/pg/pg_xlog"); + strLstAddZ(argList, TEST_PATH "/pg/pg_wal"); HRN_CFG_LOAD(cfgCmdArchivePush, argList, .role = cfgCmdRoleAsync); TEST_ERROR(cmdArchivePushAsync(), AssertError, "no WAL files to process"); @@ -932,14 +932,14 @@ testRun(void) "1={\"db-id\":" HRN_PG_SYSTEMID_18_Z ",\"db-version\":\"18\"}\n"); // Recreate ready file for WAL 1 - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/archive_status/000000010000000100000001.ready"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/archive_status/000000010000000100000001.ready"); TEST_STORAGE_EXISTS( storageTest, zNewFmt("repo/archive/test/18-1/0000000100000001/000000010000000100000001-%s", walBuffer1Sha1), .comment = "check repo1 for WAL 1 file"); // Create a ready file for WAL 2 but don't create the segment yet -- this will test the file error - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/archive_status/000000010000000100000002.ready"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/archive_status/000000010000000100000002.ready"); TEST_RESULT_VOID(cmdArchivePushAsync(), "push WAL segments"); TEST_RESULT_LOG_FMT( @@ -951,7 +951,7 @@ testRun(void) "[55] raised from local-1 shim protocol: " STORAGE_ERROR_READ_MISSING "\n" " [RETRY DETAIL OMITTED]\n" "P00 WARN: stopped archive-push after an error, remaining WAL will be processed on the next run", - TEST_PATH "/pg/pg_xlog/000000010000000100000002"); + TEST_PATH "/pg/pg_wal/000000010000000100000002"); TEST_STORAGE_EXISTS( storageTest, zNewFmt("repo/archive/test/18-1/0000000100000001/000000010000000100000001-%s", walBuffer1Sha1), @@ -977,7 +977,7 @@ testRun(void) HRN_PG_WAL_TO_BUFFER(walBuffer2, PG_VERSION_18); const char *walBuffer2Sha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, walBuffer2))); - HRN_STORAGE_PUT(storagePgWrite(), "pg_xlog/000000010000000100000002", walBuffer2); + HRN_STORAGE_PUT(storagePgWrite(), "pg_wal/000000010000000100000002", walBuffer2); argListTemp = strLstDup(argList); hrnCfgArgRawZ(argListTemp, cfgOptArchivePushQueueMax, "1gb"); @@ -1026,10 +1026,10 @@ testRun(void) HRN_PG_WAL_TO_BUFFER(walBuffer3, PG_VERSION_18); const char *walBuffer3Sha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, walBuffer3))); - HRN_STORAGE_PUT(storagePgWrite(), "pg_xlog/000000010000000100000003", walBuffer3); + HRN_STORAGE_PUT(storagePgWrite(), "pg_wal/000000010000000100000003", walBuffer3); // Create ready file - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/archive_status/000000010000000100000003.ready"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/archive_status/000000010000000100000003.ready"); TEST_RESULT_VOID(cmdArchivePushAsync(), "push WAL segment"); TEST_RESULT_LOG( @@ -1044,7 +1044,7 @@ testRun(void) .comment = "check repo3 for WAL 3 file"); // Remove the ready file to prevent WAL 3 from being considered for the next test - HRN_STORAGE_REMOVE(storagePgWrite(), "pg_xlog/archive_status/000000010000000100000003.ready", .errorOnMissing = true); + HRN_STORAGE_REMOVE(storagePgWrite(), "pg_wal/archive_status/000000010000000100000003.ready", .errorOnMissing = true); // Check that drop functionality works // ------------------------------------------------------------------------------------------------------------------------- @@ -1082,8 +1082,8 @@ testRun(void) // Remove status and ready files to get a clean state HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); // Create two valid WAL segments and ready files for four segments. With the batch size set to two segments (32MiB) only the // first two are pushed and the last two are left for the next run. @@ -1093,11 +1093,11 @@ testRun(void) HRN_PG_WAL_TO_BUFFER(walBufferBatch, PG_VERSION_18); const char *walBufferBatchSha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, walBufferBatch))); - HRN_STORAGE_PUT(storagePgWrite(), "pg_xlog/000000010000000100000010", walBufferBatch); - HRN_STORAGE_PUT(storagePgWrite(), "pg_xlog/000000010000000100000011", walBufferBatch); + HRN_STORAGE_PUT(storagePgWrite(), "pg_wal/000000010000000100000010", walBufferBatch); + HRN_STORAGE_PUT(storagePgWrite(), "pg_wal/000000010000000100000011", walBufferBatch); for (unsigned int walIdx = 16; walIdx <= 19; walIdx++) - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_xlog/archive_status/0000000100000001%08X.ready", walIdx)); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_wal/archive_status/0000000100000001%08X.ready", walIdx)); argListTemp = strLstDup(argList); hrnCfgArgRawZ(argListTemp, cfgOptArchivePushBatchSize, "32MiB"); @@ -1122,15 +1122,15 @@ testRun(void) // Remove status and ready files to get a clean state HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); // Create one valid WAL segment and ready files for two segments. A batch size smaller than a single segment still pushes // one segment so that progress is always made. - HRN_STORAGE_PUT(storagePgWrite(), "pg_xlog/000000010000000100000014", walBufferBatch); + HRN_STORAGE_PUT(storagePgWrite(), "pg_wal/000000010000000100000014", walBufferBatch); for (unsigned int walIdx = 20; walIdx <= 21; walIdx++) - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_xlog/archive_status/0000000100000001%08X.ready", walIdx)); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_wal/archive_status/0000000100000001%08X.ready", walIdx)); argListTemp = strLstDup(argList); hrnCfgArgRawZ(argListTemp, cfgOptArchivePushBatchSize, "1MiB"); @@ -1151,15 +1151,15 @@ testRun(void) // Remove status and ready files to get a clean state HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); // Create ready files for two segments with a zero-size first segment. A ready WAL segment should never be zero size, so the // command errors immediately instead of applying the batch size. - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/000000010000000100000016"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/000000010000000100000016"); for (unsigned int walIdx = 22; walIdx <= 23; walIdx++) - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_xlog/archive_status/0000000100000001%08X.ready", walIdx)); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_wal/archive_status/0000000100000001%08X.ready", walIdx)); argListTemp = strLstDup(argList); hrnCfgArgRawZ(argListTemp, cfgOptArchivePushBatchSize, "1MiB"); @@ -1173,13 +1173,13 @@ testRun(void) HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/000000010000000100000018.00000028.backup"); - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/archive_status/000000010000000100000018.00000028.backup.ready"); - HRN_STORAGE_PUT(storagePgWrite(), "pg_xlog/000000010000000100000019", walBufferBatch); - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/archive_status/000000010000000100000019.ready"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/000000010000000100000018.00000028.backup"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/archive_status/000000010000000100000018.00000028.backup.ready"); + HRN_STORAGE_PUT(storagePgWrite(), "pg_wal/000000010000000100000019", walBufferBatch); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/archive_status/000000010000000100000019.ready"); HRN_CFG_LOAD(cfgCmdArchivePush, argList, .role = cfgCmdRoleAsync); @@ -1200,11 +1200,11 @@ testRun(void) HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/00000002.history"); - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_xlog/archive_status/00000002.history.ready"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/00000002.history"); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), "pg_wal/archive_status/00000002.history.ready"); TEST_RESULT_VOID(cmdArchivePushAsync(), "push history file"); TEST_RESULT_LOG( @@ -1219,14 +1219,14 @@ testRun(void) // Remove status and ready files to get a clean state HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); // Create the first segment (used to size the queue) and ready files for four segments - HRN_STORAGE_PUT(storagePgWrite(), "pg_xlog/000000010000000100000010", walBufferBatch); + HRN_STORAGE_PUT(storagePgWrite(), "pg_wal/000000010000000100000010", walBufferBatch); for (unsigned int walIdx = 16; walIdx <= 19; walIdx++) - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_xlog/archive_status/0000000100000001%08X.ready", walIdx)); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_wal/archive_status/0000000100000001%08X.ready", walIdx)); // The batch size (two segments = 32MiB) is under the queue-max but the full queue (four segments = 64MiB) exceeds it, so // the entire queue is dropped rather than truncated to the batch @@ -1257,15 +1257,15 @@ testRun(void) // Remove status and ready files to get a clean state HRN_STORAGE_PATH_REMOVE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT, .recurse = true); HRN_STORAGE_PATH_CREATE(storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_OUT); - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog/archive_status", .recurse = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog/archive_status"); + HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal/archive_status", .recurse = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_wal/archive_status"); // Create WAL segments and ready files for six segments. There are more segments than will be processed to prove that // processing stops after an error and leaves the remaining WAL for the next run. for (unsigned int walIdx = 4; walIdx <= 9; walIdx++) { - HRN_STORAGE_PUT(storagePgWrite(), zNewFmt("pg_xlog/00000001000000010000000%u", walIdx), walBufferBatch); - HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_xlog/archive_status/00000001000000010000000%u.ready", walIdx)); + HRN_STORAGE_PUT(storagePgWrite(), zNewFmt("pg_wal/00000001000000010000000%u", walIdx), walBufferBatch); + HRN_STORAGE_PUT_EMPTY(storagePgWrite(), zNewFmt("pg_wal/archive_status/00000001000000010000000%u.ready", walIdx)); } // Make the repo archive path read-only so each push errors when it writes, simulating an unavailable repository diff --git a/test/src/module/command/backupTest.c b/test/src/module/command/backupTest.c index 8a76513c3d..8e05e08697 100644 --- a/test/src/module/command/backupTest.c +++ b/test/src/module/command/backupTest.c @@ -240,8 +240,7 @@ testBackupValidateFile( // the test output. // ------------------------------------------------------------------------------------------------------------- if (strEqZ(file.name, MANIFEST_TARGET_PGDATA "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL) || - strBeginsWith( - file.name, strNewFmt(MANIFEST_TARGET_PGDATA "/%s/", strZ(pgWalPath(manifestData->pgVersion))))) + strBeginsWith(file.name, STRDEF(MANIFEST_TARGET_PGDATA "/" PG_PATH_PGWAL "/"))) { file.checksumSha1 = NULL; } @@ -1517,7 +1516,7 @@ testRun(void) TEST_TITLE("warn and reset when backup from standby used in offline mode"); // Create pg_control - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); StringList *argList = strLstNew(); hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); @@ -1531,7 +1530,7 @@ testRun(void) TEST_RESULT_VOID( backupInit( infoBackupNew( - PG_VERSION_96, HRN_PG_SYSTEMID_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, NULL)), + PG_VERSION_10, HRN_PG_SYSTEMID_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, NULL)), "backup init"); TEST_RESULT_LOG( @@ -2312,7 +2311,7 @@ testRun(void) // Add files HRN_STORAGE_PUT_Z(storagePgWrite(), "postgresql.conf", "CONFIGSTUFF", .timeModified = backupTimeStart); HRN_STORAGE_PUT_Z(storagePgWrite(), PG_FILE_PGVERSION, PG_VERSION_14_Z, .timeModified = backupTimeStart); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), strZ(pgWalPath(PG_VERSION_14)), .noParentCreate = true); + HRN_STORAGE_PATH_CREATE(storagePgWrite(), PG_PATH_PGWAL, .noParentCreate = true); // Create a backup manifest that looks like a halted backup manifest Manifest *manifestResume = manifestNewBuild( @@ -2718,20 +2717,17 @@ testRun(void) "P00 INFO: full backup size = [SIZE], file total = 4"); } - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_wal", .errorOnMissing = true); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), "pg_xlog"); - // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("online 9.6 backup-standby full backup"); + TEST_TITLE("online 10 backup-standby full backup"); backupTimeStart = BACKUP_EPOCH + 1200000; { // Update pg_control - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); // Update version - HRN_STORAGE_PUT_Z(storagePgWrite(), PG_FILE_PGVERSION, PG_VERSION_96_Z, .timeModified = backupTimeStart); + HRN_STORAGE_PUT_Z(storagePgWrite(), PG_FILE_PGVERSION, PG_VERSION_10_Z, .timeModified = backupTimeStart); // Upgrade stanza StringList *argList = strLstNew(); @@ -2759,7 +2755,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdBackup, argList); // Add pg_control to standby - HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_10); // Create file to copy from the standby. This file will be zero-length on the primary and non-zero-length on the standby // but no bytes will be copied. @@ -2786,7 +2782,7 @@ testRun(void) // Run backup but error on first archive check hrnBackupPqScriptP( - PG_VERSION_96, backupTimeStart, .noPriorWal = true, .backupStandby = true, .walCompressType = compressTypeGz, + PG_VERSION_10, backupTimeStart, .noPriorWal = true, .backupStandby = true, .walCompressType = compressTypeGz, .startFast = true); TEST_ERROR( hrnCmdBackup(), ArchiveTimeoutError, @@ -2797,7 +2793,7 @@ testRun(void) // Run backup but error on archive check hrnBackupPqScriptP( - PG_VERSION_96, backupTimeStart, .noWal = true, .backupStandby = true, .walCompressType = compressTypeGz, + PG_VERSION_10, backupTimeStart, .noWal = true, .backupStandby = true, .walCompressType = compressTypeGz, .startFast = true); TEST_ERROR( hrnCmdBackup(), ArchiveTimeoutError, @@ -2819,7 +2815,7 @@ testRun(void) // Run backup hrnBackupPqScriptP( - PG_VERSION_96, backupTimeStart, .backupStandby = true, .walCompressType = compressTypeGz, .startFast = true); + PG_VERSION_10, backupTimeStart, .backupStandby = true, .walCompressType = compressTypeGz, .startFast = true); TEST_RESULT_VOID(hrnCmdBackup(), "backup"); // Check archive.info/copy timestamp was updated but contents were not @@ -2839,13 +2835,13 @@ testRun(void) TEST_RESULT_STR_Z( testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), ".> {d=20191016-042640F}\n" - "pg_data/PG_VERSION {s=3}\n" + "pg_data/PG_VERSION {s=2}\n" "pg_data/backup_label {s=17, ts=+2}\n" "pg_data/base/1/1 {s=0}\n" "pg_data/base/1/2 {s=2}\n" "pg_data/base/1/3 {s=3, so=4}\n" "pg_data/global/pg_control {s=8192}\n" - "pg_data/pg_xlog/0000000105DA69C000000000 {s=16777216, ts=+2}\n" + "pg_data/pg_wal/0000000105DA69C000000000 {s=16777216, ts=+2}\n" "pg_data/postgresql.conf {s=11, ts=-1200000}\n" "--------\n" "[backup:target]\n" @@ -2858,7 +2854,7 @@ testRun(void) } // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("online 9.6 backup-standby full backup with block incremental"); + TEST_TITLE("online 10 backup-standby full backup with block incremental"); backupTimeStart = BACKUP_EPOCH + 1600000; @@ -2905,7 +2901,7 @@ testRun(void) harnessLogLevelSet(logLevelWarn); // Run backup - hrnBackupPqScriptP(PG_VERSION_96, backupTimeStart, .backupStandby = true, .startFast = true); + hrnBackupPqScriptP(PG_VERSION_10, backupTimeStart, .backupStandby = true, .startFast = true); TEST_RESULT_VOID(hrnCmdBackup(), "backup"); // Set log level back to detail @@ -2914,7 +2910,7 @@ testRun(void) TEST_RESULT_STR_Z( testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), ".> {d=20191020-193320F}\n" - "bundle/1/pg_data/PG_VERSION {s=3, ts=-400000}\n" + "bundle/1/pg_data/PG_VERSION {s=2, ts=-400000}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n" "bundle/1/pg_data/postgresql.conf {s=11, ts=-1600000}\n" "bundle/2/pg_data/base/1/3 {s=24576, so=40960, m=0:{0,1,2}}\n" @@ -2927,7 +2923,7 @@ testRun(void) } // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("online 9.6 backup-standby incr backup with block incremental"); + TEST_TITLE("online 10 backup-standby incr backup with block incremental"); backupTimeStart = BACKUP_EPOCH + 1700000; @@ -2960,7 +2956,7 @@ testRun(void) harnessLogLevelSet(logLevelWarn); // Run backup - hrnBackupPqScriptP(PG_VERSION_96, backupTimeStart, .backupStandby = true, .startFast = true); + hrnBackupPqScriptP(PG_VERSION_10, backupTimeStart, .backupStandby = true, .startFast = true); TEST_RESULT_VOID(hrnCmdBackup(), "backup"); // Set log level back to detail @@ -2972,7 +2968,7 @@ testRun(void) "bundle/1/pg_data/global/pg_control {s=8192}\n" "bundle/2/pg_data/base/1/3 {s=32768, so=40960, m=0:{0,1,2},1:{0}, ts=-100000}\n" "pg_data/backup_label {s=17, ts=+2}\n" - "20191020-193320F/bundle/1/pg_data/PG_VERSION {s=3, ts=-500000}\n" + "20191020-193320F/bundle/1/pg_data/PG_VERSION {s=2, ts=-500000}\n" "20191020-193320F/bundle/2/pg_data/base/1/4 {s=32768, so=40960, m=0:{0,1,2,3}, ts=-100000}\n" "20191020-193320F/bundle/1/pg_data/postgresql.conf {s=11, ts=-1700000}\n" "--------\n" @@ -2982,7 +2978,7 @@ testRun(void) } // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("online 9.6 backup-standby (prefer) incr backup with block incremental"); + TEST_TITLE("online 10 backup-standby (prefer) incr backup with block incremental"); backupTimeStart = BACKUP_EPOCH + 1800000; @@ -3005,7 +3001,7 @@ testRun(void) // Run backup hrnBackupPqScriptP( - PG_VERSION_96, backupTimeStart, .backupStandby = true, .backupStandbyError = true, .startFast = true); + PG_VERSION_10, backupTimeStart, .backupStandby = true, .backupStandbyError = true, .startFast = true); TEST_RESULT_VOID(hrnCmdBackup(), "backup"); TEST_RESULT_LOG( @@ -3034,14 +3030,12 @@ testRun(void) "bundle/1/pg_data/base/1/4 {s=40960, m=0:{0,1,2,3},2:{0}, ts=-200000}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n" "pg_data/backup_label {s=17, ts=+2}\n" - "20191020-193320F/bundle/1/pg_data/PG_VERSION {s=3, ts=-600000}\n" + "20191020-193320F/bundle/1/pg_data/PG_VERSION {s=2, ts=-600000}\n" "20191020-193320F/bundle/1/pg_data/postgresql.conf {s=11, ts=-1800000}\n" "--------\n" "[backup:target]\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n", "compare file list"); - - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), "pg_xlog", .errorOnMissing = true); } // ------------------------------------------------------------------------------------------------------------------------- @@ -3057,10 +3051,6 @@ testRun(void) // Update version HRN_STORAGE_PUT_Z(storagePgWrite(), PG_FILE_PGVERSION, PG_VERSION_11_Z, .timeModified = backupTimeStart); - // Update wal path - HRN_STORAGE_PATH_REMOVE(storagePgWrite(), strZ(pgWalPath(PG_VERSION_14))); - HRN_STORAGE_PATH_CREATE(storagePgWrite(), strZ(pgWalPath(PG_VERSION_11)), .noParentCreate = true); - // Upgrade stanza to format 6 StringList *argList = strLstNew(); hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); diff --git a/test/src/module/command/checkTest.c b/test/src/module/command/checkTest.c index 0455757888..a3324d38b3 100644 --- a/test/src/module/command/checkTest.c +++ b/test/src/module/command/checkTest.c @@ -242,10 +242,10 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("standby only, repo local - fail to find primary database"); - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_96, TEST_PATH "/pg", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_10, TEST_PATH "/pg", true, NULL, NULL), HRN_PQ_SCRIPT_CLOSE(1)); TEST_ERROR(cmdCheck(), ConfigError, "primary database not found\nHINT: check indexed pg-path/pg-host configurations"); @@ -263,7 +263,7 @@ testRun(void) hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, "500ms"); HRN_CFG_LOAD(cfgCmdCheck, argList); - HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_10); // Two standbys found but no primary HRN_PQ_SCRIPT_SET( @@ -287,13 +287,13 @@ testRun(void) HRN_CFG_LOAD(cfgCmdCheck, argList); HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_96, "/pgdata", true, NULL, NULL), + HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_10, "/pgdata", true, NULL, NULL), HRN_PQ_SCRIPT_CLOSE(1)); // Only confirming we get passed the check for repoIsLocal || more than one pg-path configured TEST_ERROR( cmdCheck(), DbMismatchError, - "version '9.6' and path '/pgdata' queried from cluster do not match version '9.6' and '" TEST_PATH "/pg' read from" + "version '10' and path '/pgdata' queried from cluster do not match version '10' and '" TEST_PATH "/pg' read from" " '" TEST_PATH "/pg/global/pg_control'\n" "HINT: the pg1-path and pg1-port settings likely reference different clusters."); @@ -310,7 +310,7 @@ testRun(void) // Primary database connection ok HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_96, TEST_PATH "/pg", false, NULL, NULL), + HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_10, TEST_PATH "/pg", false, NULL, NULL), HRN_PQ_SCRIPT_CLOSE(1)); TEST_ERROR( @@ -477,7 +477,7 @@ testRun(void) HRN_PQ_SCRIPT_SET( HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_15, TEST_PATH "/pg", false, NULL, NULL), HRN_PQ_SCRIPT_CREATE_RESTORE_POINT(1, "1/1"), - HRN_PQ_SCRIPT_WAL_SWITCH(1, "wal", "000000010000000100000001"), + HRN_PQ_SCRIPT_WAL_SWITCH(1, "000000010000000100000001"), HRN_PQ_SCRIPT_CLOSE(1)); TEST_ERROR( @@ -526,7 +526,7 @@ testRun(void) HRN_PQ_SCRIPT_SET( HRN_PQ_SCRIPT_OPEN(1, "dbname='postgres' port=5432", PG_VERSION_15, TEST_PATH "/pg", false, NULL, NULL), HRN_PQ_SCRIPT_CREATE_RESTORE_POINT(1, "1/1"), - HRN_PQ_SCRIPT_WAL_SWITCH(1, "wal", "000000010000000100000001"), + HRN_PQ_SCRIPT_WAL_SWITCH(1, "000000010000000100000001"), HRN_PQ_SCRIPT_CLOSE(1)); HRN_STORAGE_PUT( @@ -627,9 +627,9 @@ testRun(void) TEST_TITLE("checkDbConfig() version mismatch"); TEST_ERROR( - checkDbConfig(PG_VERSION_96, db.primaryIdx, db.primary, false), DbMismatchError, + checkDbConfig(PG_VERSION_10, db.primaryIdx, db.primary, false), DbMismatchError, "version '" PG_VERSION_11_Z "' and path '" TEST_PATH "/pg' queried from cluster do not match version '" - PG_VERSION_96_Z "' and '" TEST_PATH "/pg' read from '" TEST_PATH "/pg/global/pg_control'\n" + PG_VERSION_10_Z "' and '" TEST_PATH "/pg' read from '" TEST_PATH "/pg/global/pg_control'\n" "HINT: the pg1-path and pg1-port settings likely reference different clusters."); // ------------------------------------------------------------------------------------------------------------------------- @@ -701,9 +701,9 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("checkStanzaInfo() - files match"); - InfoArchive *archiveInfo = infoArchiveNew(PG_VERSION_96, 6569239123849665679, REPOSITORY_FORMAT_DEFAULT, NULL); + InfoArchive *archiveInfo = infoArchiveNew(PG_VERSION_10, 6569239123849665679, REPOSITORY_FORMAT_DEFAULT, NULL); InfoBackup *backupInfo = infoBackupNew( - PG_VERSION_96, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, NULL); + PG_VERSION_10, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, NULL); TEST_RESULT_VOID(checkStanzaInfo(0, infoArchivePg(archiveInfo), infoBackupPg(backupInfo)), "stanza info files match"); @@ -711,13 +711,13 @@ testRun(void) TEST_TITLE("checkStanzaInfo() - corrupted backup file: system id"); backupInfo = infoBackupNew( - PG_VERSION_96, 6569239123849665999, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, NULL); + PG_VERSION_10, 6569239123849665999, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, NULL); TEST_ERROR( checkStanzaInfo(0, infoArchivePg(archiveInfo), infoBackupPg(backupInfo)), FileInvalidError, "backup info file and archive info file do not match\n" - "archive: id = 1, version = 9.6, system-id = 6569239123849665679\n" - "backup : id = 1, version = 9.6, system-id = 6569239123849665999\n" + "archive: id = 1, version = 10, system-id = 6569239123849665679\n" + "backup : id = 1, version = 10, system-id = 6569239123849665999\n" "HINT: this may be a symptom of repository corruption!"); // ------------------------------------------------------------------------------------------------------------------------- @@ -729,7 +729,7 @@ testRun(void) TEST_ERROR( checkStanzaInfo(0, infoArchivePg(archiveInfo), infoBackupPg(backupInfo)), FileInvalidError, "backup info file and archive info file do not match\n" - "archive: id = 1, version = 9.6, system-id = 6569239123849665679\n" + "archive: id = 1, version = 10, system-id = 6569239123849665679\n" "backup : id = 1, version = 18, system-id = 6569239123849665999\n" "HINT: this may be a symptom of repository corruption!"); @@ -742,27 +742,27 @@ testRun(void) TEST_ERROR( checkStanzaInfo(0, infoArchivePg(archiveInfo), infoBackupPg(backupInfo)), FileInvalidError, "backup info file and archive info file do not match\n" - "archive: id = 1, version = 9.6, system-id = 6569239123849665679\n" + "archive: id = 1, version = 10, system-id = 6569239123849665679\n" "backup : id = 1, version = 18, system-id = 6569239123849665679\n" "HINT: this may be a symptom of repository corruption!"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("checkStanzaInfo() - corrupted backup file: db id"); - infoBackupPgSet(backupInfo, PG_VERSION_96, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_96)); + infoBackupPgSet(backupInfo, PG_VERSION_10, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_10)); TEST_ERROR( checkStanzaInfo(0, infoArchivePg(archiveInfo), infoBackupPg(backupInfo)), FileInvalidError, "backup info file and archive info file do not match\n" - "archive: id = 1, version = 9.6, system-id = 6569239123849665679\n" - "backup : id = 2, version = 9.6, system-id = 6569239123849665679\n" + "archive: id = 1, version = 10, system-id = 6569239123849665679\n" + "backup : id = 2, version = 10, system-id = 6569239123849665679\n" "HINT: this may be a symptom of repository corruption!"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("checkStanzaInfo() - info files at different repository formats"); backupInfo = infoBackupNew( - PG_VERSION_96, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, NULL); + PG_VERSION_10, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, NULL); infoArchiveFormatSet(archiveInfo, REPOSITORY_FORMAT_6); TEST_ERROR( @@ -806,7 +806,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); // Create pg_control - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_10); // Create info files TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - encryption"); @@ -824,7 +824,7 @@ testRun(void) // SystemId mismatch TEST_ERROR( - checkStanzaInfoPg(0, PG_VERSION_96, 6569239123849665699), FileInvalidError, + checkStanzaInfoPg(0, PG_VERSION_10, 6569239123849665699), FileInvalidError, "backup and archive info files exist but do not match the database\n" "HINT: is this the correct stanza?\n" "HINT: did an error occur during stanza-upgrade?"); diff --git a/test/src/module/command/restoreTest.c b/test/src/module/command/restoreTest.c index 8aefb4039b..60466dd7c2 100644 --- a/test/src/module/command/restoreTest.c +++ b/test/src/module/command/restoreTest.c @@ -1018,7 +1018,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("owner is not root and all ownership is good"); - Manifest *manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_96, pgPath); + Manifest *manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_10, pgPath); const String *rootReplaceUser = NULL; const String *rootReplaceGroup = NULL; @@ -1027,7 +1027,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("owner is not root but has no user name"); - manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275I"), PG_VERSION_96, pgPath); + manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275I"), PG_VERSION_10, pgPath); userLocalData.groupName = NULL; userLocalData.userName = NULL; @@ -1046,7 +1046,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("owner is not root and some ownership is bad"); - manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_96, pgPath); + manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_10, pgPath); ManifestPath path = {.name = STRDEF("pg_data/bogus_path"), .user = STRDEF("path-user-bogus")}; manifestPathAdd(manifest, &path); @@ -1076,7 +1076,7 @@ testRun(void) hrnCfgArgRaw(argList, cfgOptPgPath, pgPath); HRN_CFG_LOAD(cfgCmdRestore, argList); - manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_96, pgPath); + manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_10, pgPath); userLocalData.userRoot = true; HRN_STORAGE_PATH_CREATE(storagePgWrite(), NULL, .mode = 0700); @@ -1101,7 +1101,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("owner is root and group is bad"); - manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_96, pgPath); + manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_10, pgPath); manifestFileAdd(manifest, &file); manifestLinkAdd(manifest, &link); @@ -1119,7 +1119,7 @@ testRun(void) #ifdef TEST_CONTAINER_REQUIRED TEST_TITLE("owner is root and ownership of pg_data is bad"); - manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_96, pgPath); + manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_10, pgPath); manifestPathAdd(manifest, &path); manifestFileAdd(manifest, &file); @@ -1179,7 +1179,7 @@ testRun(void) const String *pgPath = STRDEF(TEST_PATH "/pg"); const String *repoPath = STRDEF(TEST_PATH "/repo"); - Manifest *manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_96, pgPath); + Manifest *manifest = testManifestMinimal(STRDEF("20161219-212741F_20161219-21275D"), PG_VERSION_10, pgPath); StringList *argList = strLstNew(); hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); @@ -2717,7 +2717,7 @@ testRun(void) // PG_VERSION HRN_MANIFEST_FILE_ADD( manifest, .name = TEST_PGDATA PG_FILE_PGVERSION, .size = 3, .sizeRepo = 3, .timestamp = 1482182860, - .bundleId = 1, .checksumSha1 = "f5b7e6d36dc0113f61b36c700817d42b96f7b037"); + .bundleId = 1, .checksumSha1 = "4143d3a341877154d6e95211464e1df1015b74bd"); HRN_MANIFEST_FILE_ADD( manifest, .name = TEST_PGDATA "yyy", .size = 3, .sizeRepo = 3, .timestamp = 1482182860, .bundleId = 1, @@ -2734,7 +2734,7 @@ testRun(void) .bundleId = 1, .bundleOffset = 17, .checksumSha1 = "d7dacae2c968388960bf8970080a980ed5c5dcb7"); HRN_STORAGE_PUT_Z( storageRepoWrite(), STORAGE_REPO_BACKUP "/" TEST_LABEL "/bundle/1", - PG_VERSION_96_Z "\n" PG_VERSION_96_Z "\nyyyxxxxxAzzA"); + PG_VERSION_10_Z "\n\n" PG_VERSION_10_Z "\n\nyyyxxxxxAzzA"); // base directory HRN_MANIFEST_PATH_ADD(manifest, .name = TEST_PGDATA PG_PATH_BASE); @@ -2746,7 +2746,7 @@ testRun(void) HRN_MANIFEST_FILE_ADD( manifest, .name = TEST_PGDATA "base/1/" PG_FILE_PGVERSION, .size = 3, .sizeRepo = 3, .timestamp = 1482182860, .bundleId = 1, .bundleOffset = 4, - .checksumSha1 = "f5b7e6d36dc0113f61b36c700817d42b96f7b037"); + .checksumSha1 = "4143d3a341877154d6e95211464e1df1015b74bd"); // base/1/2 fileBuffer = bufNew(8192); @@ -3022,9 +3022,9 @@ testRun(void) "P01 DETAIL: restore file " TEST_PATH "/pg/base/1/10 (bundle 20161219-212741F/1/1, 8KB, [PCT])" " checksum 28757c756c03c37aca13692cb719c18d1510c190\n" "P01 DETAIL: restore file " TEST_PATH "/pg/PG_VERSION (bundle 1/0, 3B, [PCT]) checksum" - " f5b7e6d36dc0113f61b36c700817d42b96f7b037\n" + " 4143d3a341877154d6e95211464e1df1015b74bd\n" "P01 DETAIL: restore file " TEST_PATH "/pg/base/1/PG_VERSION (bundle 1/4, 3B, [PCT]) checksum" - " f5b7e6d36dc0113f61b36c700817d42b96f7b037\n" + " 4143d3a341877154d6e95211464e1df1015b74bd\n" "P01 DETAIL: restore file " TEST_PATH "/pg/yyy - exists and matches backup (bundle 1/8, 3B, [PCT]) checksum" " 186154712b2d5f6791d85b9a0987b98fa231779c\n" "P01 DETAIL: restore file " TEST_PATH "/pg/xxxxx (bundle 1/11, 5B, [PCT]) checksum" @@ -3216,9 +3216,9 @@ testRun(void) "P01 DETAIL: restore file " TEST_PATH "/pg/base/1/10 - exists and matches backup (bundle 20161219-212741F/1/1, 8KB," " [PCT]) checksum 28757c756c03c37aca13692cb719c18d1510c190\n" "P01 DETAIL: restore file " TEST_PATH "/pg/PG_VERSION - exists and matches backup (bundle 1/0, 3B, [PCT])" - " checksum f5b7e6d36dc0113f61b36c700817d42b96f7b037\n" + " checksum 4143d3a341877154d6e95211464e1df1015b74bd\n" "P01 DETAIL: restore file " TEST_PATH "/pg/base/1/PG_VERSION - exists and matches backup (bundle 1/4, 3B, [PCT])" - " checksum f5b7e6d36dc0113f61b36c700817d42b96f7b037\n" + " checksum 4143d3a341877154d6e95211464e1df1015b74bd\n" "P01 DETAIL: restore file " TEST_PATH "/pg/yyy - exists and matches backup (bundle 1/8, 3B, [PCT]) checksum" " 186154712b2d5f6791d85b9a0987b98fa231779c\n" "P01 DETAIL: restore file " TEST_PATH "/pg/xxxxx - exists and matches backup (bundle 1/11, 5B, [PCT]) checksum" diff --git a/test/src/module/command/stanzaTest.c b/test/src/module/command/stanzaTest.c index 0299f68cd6..a3084e3993 100644 --- a/test/src/module/command/stanzaTest.c +++ b/test/src/module/command/stanzaTest.c @@ -72,7 +72,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); // Create pg_control - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - one repo, no files exist"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1"); @@ -81,11 +81,11 @@ testRun(void) storageHrn, "test.info", "[db]\n" "db-id=1\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n", + "1={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n", .comment = "put archive info to test file"); TEST_RESULT_BOOL( @@ -100,15 +100,15 @@ testRun(void) HRN_INFO_PUT( storageHrn, "test.info", "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z - ",\"db-version\":\"9.6\"}\n", + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z + ",\"db-version\":\"10\"}\n", .comment = "put backup info to test file"); TEST_RESULT_BOOL( @@ -429,7 +429,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdStanzaDelete, argListDelete); HRN_STORAGE_PATH_CREATE( - storageRepoIdxWrite(2), STORAGE_REPO_ARCHIVE "/9.6-1/1234567812345678", .comment = "create archive sub directory"); + storageRepoIdxWrite(2), STORAGE_REPO_ARCHIVE "/10-1/1234567812345678", .comment = "create archive sub directory"); HRN_STORAGE_PATH_CREATE( storageRepoIdxWrite(2), STORAGE_REPO_BACKUP "/20190708-154306F", .comment = "create backup sub directory"); HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file"); @@ -514,11 +514,11 @@ testRun(void) storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, "[db]\n" "db-id=1\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n", + "1={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n", .comment = "put archive info to file repo1"); TEST_STORAGE_EXISTS( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE INFO_COPY_EXT, .remove = true, @@ -544,22 +544,22 @@ testRun(void) HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "2={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z - ",\"db-version\":\"9.6\"}\n", + "2={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z + ",\"db-version\":\"10\"}\n", .comment = "put backup info to file - bad db-id"); TEST_ERROR( cmdStanzaCreate(), FileInvalidError, "backup info file and archive info file do not match\n" - "archive: id = 1, version = 9.6, system-id = " HRN_PG_SYSTEMID_96_Z "\n" - "backup : id = 2, version = 9.6, system-id = " HRN_PG_SYSTEMID_96_Z "\n" + "archive: id = 1, version = 10, system-id = " HRN_PG_SYSTEMID_10_Z "\n" + "backup : id = 2, version = 10, system-id = " HRN_PG_SYSTEMID_10_Z "\n" "HINT: this may be a symptom of repository corruption!"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1"); @@ -610,23 +610,23 @@ testRun(void) "[db]\n" "db-id=1\n" "db-system-id=6569239123849665999\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n"); + "1={\"db-id\":6569239123849665999,\"db-version\":\"10\"}\n"); HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=6569239123849665999\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665999" - ",\"db-version\":\"9.6\"}\n"); + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665999" + ",\"db-version\":\"10\"}\n"); TEST_ERROR( cmdStanzaCreate(), FileInvalidError, @@ -825,7 +825,7 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- // Create pg_control for the rest of the tests - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("stanza-upgrade - info file mismatch: db-id"); @@ -834,32 +834,32 @@ testRun(void) HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z - ",\"db-version\":\"9.6\"}\n"); + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z + ",\"db-version\":\"10\"}\n"); // backup info up to date but archive info db-id mismatch HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, "[db]\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "2={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n"); + "2={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n"); TEST_ERROR( cmdStanzaUpgrade(), FileInvalidError, "backup info file and archive info file do not match\n" - "archive: id = 2, version = 9.6, system-id = " HRN_PG_SYSTEMID_96_Z "\n" - "backup : id = 1, version = 9.6, system-id = " HRN_PG_SYSTEMID_96_Z "\n" + "archive: id = 2, version = 10, system-id = " HRN_PG_SYSTEMID_10_Z "\n" + "backup : id = 1, version = 10, system-id = " HRN_PG_SYSTEMID_10_Z "\n" "HINT: this may be a symptom of repository corruption!"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1"); @@ -870,17 +870,17 @@ testRun(void) HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" "1={\"db-catalog-version\":202506291,\"db-control-version\":1800,\"db-system-id\":6569239123849665999" ",\"db-version\":\"18\"}\n" - "2={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z - ",\"db-version\":\"9.6\"}\n"); + "2={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z + ",\"db-version\":\"10\"}\n"); HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, "[db]\n" @@ -898,12 +898,12 @@ testRun(void) storageHrn, "test.info", "[db]\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" "1={\"db-id\":" HRN_PG_SYSTEMID_17_Z ",\"db-version\":\"18\"}\n" - "2={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n", + "2={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n", .comment = "put archive info to test file"); TEST_RESULT_BOOL( @@ -938,17 +938,17 @@ testRun(void) HRN_INFO_PUT( storageHrn, "test.info", "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" "1={\"db-catalog-version\":202506291,\"db-control-version\":1800,\"db-system-id\":" HRN_PG_SYSTEMID_17_Z ",\"db-version\":\"18\"}\n" - "2={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z - ",\"db-version\":\"9.6\"}\n", + "2={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z + ",\"db-version\":\"10\"}\n", .comment = "put backup info to test file"); TEST_RESULT_BOOL( @@ -967,26 +967,26 @@ testRun(void) HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" "1={\"db-catalog-version\":202506291,\"db-control-version\":1800,\"db-system-id\":6569239123849665999" ",\"db-version\":\"18\"}\n" - "2={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z - ",\"db-version\":\"9.6\"}\n"); + "2={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z + ",\"db-version\":\"10\"}\n"); HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, "[db]\n" "db-id=1\n" "db-system-id=6569239123849665999\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n"); + "1={\"db-id\":6569239123849665999,\"db-version\":\"10\"}\n"); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - archive.info file upgraded - system-id"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1"); @@ -995,12 +995,12 @@ testRun(void) storageHrn, "test.info", "[db]\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n" - "2={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n", + "1={\"db-id\":6569239123849665999,\"db-version\":\"10\"}\n" + "2={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n", .comment = "put archive info to test file"); TEST_RESULT_BOOL( @@ -1019,15 +1019,15 @@ testRun(void) HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=6569239123849665999\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665999" - ",\"db-version\":\"9.6\"}\n"); + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665999" + ",\"db-version\":\"10\"}\n"); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - backup.info file upgraded - system-id"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1"); @@ -1035,17 +1035,17 @@ testRun(void) HRN_INFO_PUT( storageHrn, "test.info", "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=2\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665999" - ",\"db-version\":\"9.6\"}\n" - "2={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z - ",\"db-version\":\"9.6\"}\n", + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665999" + ",\"db-version\":\"10\"}\n" + "2={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z + ",\"db-version\":\"10\"}\n", .comment = "put backup info to test file"); TEST_RESULT_BOOL( bufEq( @@ -1068,25 +1068,25 @@ testRun(void) HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=6569239123849665999\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665999" - ",\"db-version\":\"9.6\"}\n"); + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665999" + ",\"db-version\":\"10\"}\n"); HRN_INFO_PUT( storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, "[db]\n" "db-id=1\n" "db-system-id=6569239123849665999\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n"); + "1={\"db-id\":6569239123849665999,\"db-version\":\"10\"}\n"); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - forcing another PG version"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1"); @@ -1099,7 +1099,7 @@ testRun(void) "db-version=\"15\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n" + "1={\"db-id\":6569239123849665999,\"db-version\":\"10\"}\n" "2={\"db-id\":" HRN_PG_SYSTEMID_15_Z ",\"db-version\":\"15\"}\n", .comment = "put archive info to test file"); @@ -1119,8 +1119,8 @@ testRun(void) "db-version=\"15\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665999" - ",\"db-version\":\"9.6\"}\n" + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665999" + ",\"db-version\":\"10\"}\n" "2={\"db-catalog-version\":202211111,\"db-control-version\":1300,\"db-system-id\":" HRN_PG_SYSTEMID_15_Z ",\"db-version\":\"15\"}\n", .comment = "put backup info to test file, control version for PG 15, catalog version forced from pg_control"); @@ -1210,8 +1210,8 @@ testRun(void) "db-version=\"15\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665999" - ",\"db-version\":\"9.6\"}\n" + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665999" + ",\"db-version\":\"10\"}\n" "2={\"db-catalog-version\":202211111,\"db-control-version\":1300,\"db-system-id\":" HRN_PG_SYSTEMID_15_Z ",\"db-version\":\"15\"}\n", .comment = "put backup info at prior format to simulate an interrupted upgrade"); @@ -1437,7 +1437,7 @@ testRun(void) HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); // Create pg_control for stanza-create - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); TEST_RESULT_VOID(cmdStanzaCreate(), "create a stanza that will not be deleted"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'otherstanza' on repo1"); @@ -1595,7 +1595,7 @@ testRun(void) hrnCfgEnvKeyRawZ(cfgOptRepoCipherPass, 3, "12345678"); HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); - HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_96); + HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_10); TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create"); TEST_RESULT_LOG( diff --git a/test/src/module/command/verifyTest.c b/test/src/module/command/verifyTest.c index 45a1451c27..d0ab19f91b 100644 --- a/test/src/module/command/verifyTest.c +++ b/test/src/module/command/verifyTest.c @@ -45,12 +45,12 @@ testRun(void) uint64_t fileSize = 7; const Buffer *fileChecksum = bufNewDecode(encodingHex, STRDEF("d1cd8a7d11daa26814b93eb604e1d49ab4b43770")); - #define TEST_BACKUP_DB1_96 \ - "db-catalog-version=201608131\n" \ - "db-control-version=960\n" \ + #define TEST_BACKUP_DB1_10 \ + "db-catalog-version=201707211\n" \ + "db-control-version=1002\n" \ "db-id=1\n" \ - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" \ - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" \ + "db-version=\"10\"\n" #define TEST_BACKUP_DB2_11 \ "db-catalog-version=201707211\n" \ @@ -89,8 +89,8 @@ testRun(void) "\"option-checksum-page\":true,\"option-compress\":true,\"option-hardlink\":false,\"option-online\":true}\n" #define TEST_BACKUP_DB1_HISTORY \ - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":" HRN_PG_SYSTEMID_96_Z "," \ - "\"db-version\":\"9.6\"}" + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":" HRN_PG_SYSTEMID_10_Z "," \ + "\"db-version\":\"10\"}" #define TEST_BACKUP_DB2_HISTORY \ "2={\"db-catalog-version\":201707211,\"db-control-version\":1100,\"db-system-id\":" HRN_PG_SYSTEMID_11_Z "," \ @@ -122,11 +122,11 @@ testRun(void) #define TEST_ARCHIVE_INFO_BASE \ "[db]\n" \ "db-id=1\n" \ - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" \ - "db-version=\"9.6\"\n" \ + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" \ + "db-version=\"10\"\n" \ "\n" \ "[db:history]\n" \ - "1={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}" + "1={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}" #define TEST_ARCHIVE_INFO_MULTI_HISTORY_BASE \ "[db]\n" \ @@ -135,7 +135,7 @@ testRun(void) "db-version=\"11\"\n" \ "\n" \ "[db:history]\n" \ - "1={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"9.6\"}\n" \ + "1={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n" \ "2={\"db-id\":" HRN_PG_SYSTEMID_11_Z ",\"db-version\":\"11\"}" #define TEST_MANIFEST_HEADER \ @@ -149,11 +149,11 @@ testRun(void) #define TEST_MANIFEST_DB_94 \ "\n" \ "[backup:db]\n" \ - "db-catalog-version=201608131\n" \ - "db-control-version=960\n" \ + "db-catalog-version=201707211\n" \ + "db-control-version=1002\n" \ "db-id=1\n" \ - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" \ - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" \ + "db-version=\"10\"\n" #define TEST_MANIFEST_OPTION_ALL \ "\n" \ @@ -243,7 +243,7 @@ testRun(void) "infoPg from archive.info"); const InfoBackup *const infoBackup = infoBackupNew( - PG_VERSION_96, HRN_PG_SYSTEMID_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, NULL); + PG_VERSION_10, HRN_PG_SYSTEMID_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, NULL); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("manifest.copy exists, no manifest main, manifest db version not in history, not current db"); @@ -253,11 +253,11 @@ testRun(void) TEST_MANIFEST_HEADER "\n" "[backup:db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"10\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"11\"\n" TEST_MANIFEST_OPTION_ALL TEST_MANIFEST_TARGET TEST_MANIFEST_DB @@ -279,8 +279,8 @@ 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 10, system-id" - " " HRN_PG_SYSTEMID_96_Z ") is not in the backup.info history, skipping"); + "P00 INFO: '20181119-152138F' may not be recoverable - PG data (id 1, version 11, system-id" + " " HRN_PG_SYSTEMID_10_Z ") is not in the backup.info history, skipping"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("rerun test with db-system-id invalid and no main"); @@ -291,11 +291,11 @@ testRun(void) TEST_MANIFEST_HEADER "\n" "[backup:db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=0\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" TEST_MANIFEST_OPTION_ALL TEST_MANIFEST_TARGET TEST_MANIFEST_DB @@ -315,7 +315,7 @@ testRun(void) TEST_RESULT_LOG( "P00 DETAIL: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152138F/backup.manifest' for read\n" "P00 DETAIL: 20181119-152138F/backup.manifest is missing or unusable, using copy\n" - "P00 INFO: '20181119-152138F' may not be recoverable - PG data (id 1, version 9.6, system-id 0) is not in the" + "P00 INFO: '20181119-152138F' may not be recoverable - PG data (id 1, version 10, system-id 0) is not in the" " backup.info history, skipping"); // ------------------------------------------------------------------------------------------------------------------------- @@ -326,11 +326,11 @@ testRun(void) TEST_MANIFEST_HEADER "\n" "[backup:db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=0\n" - "db-system-id=" HRN_PG_SYSTEMID_96_Z "\n" - "db-version=\"9.6\"\n" + "db-system-id=" HRN_PG_SYSTEMID_10_Z "\n" + "db-version=\"10\"\n" TEST_MANIFEST_OPTION_ALL TEST_MANIFEST_TARGET TEST_MANIFEST_DB @@ -350,8 +350,8 @@ testRun(void) TEST_RESULT_LOG( "P00 DETAIL: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152138F/backup.manifest' for read\n" "P00 DETAIL: 20181119-152138F/backup.manifest is missing or unusable, using copy\n" - "P00 INFO: '20181119-152138F' may not be recoverable - PG data (id 0, version 9.6, system-id" - " " HRN_PG_SYSTEMID_96_Z ") is not in the backup.info history, skipping"); + "P00 INFO: '20181119-152138F' may not be recoverable - PG data (id 0, version 10, system-id" + " " HRN_PG_SYSTEMID_10_Z ") is not in the backup.info history, skipping"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("missing main manifest, errored copy"); @@ -414,7 +414,7 @@ testRun(void) TEST_TITLE("no key for the backup set"); InfoBackup *const infoBackupKey = infoBackupNew( - PG_VERSION_96, HRN_PG_SYSTEMID_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_6, NULL); + PG_VERSION_10, HRN_PG_SYSTEMID_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_6, NULL); infoBackupCipherSpecAdd( infoBackupKey, STRDEF("20181119-152000F"), cipherSpecNewP(cipherTypeAes256Cbc, BUFSTRDEF("setkey"), .digest = hashTypeSha256)); @@ -447,7 +447,7 @@ testRun(void) VerifyArchiveResult archiveResult = { - .archiveId = strNewZ("9.6-1"), + .archiveId = strNewZ("10-1"), .walRangeList = lstNewP(sizeof(VerifyWalRange), .comparator = lstComparatorStr), }; List *archiveIdResultList = lstNewP(sizeof(VerifyArchiveResult), .comparator = archiveIdComparator); @@ -483,7 +483,7 @@ testRun(void) TEST_RESULT_UINT(errTotal, 1, "duplicate WAL error"); TEST_RESULT_UINT(strLstSize(walFileList), 0, "all WAL removed from WAL file list"); TEST_RESULT_UINT(lstSize(archiveIdResult->walRangeList), 0, "no range"); - TEST_RESULT_LOG("P00 INFO: duplicate WAL '000000020000000200000000' for '9.6-1' exists, skipping"); + TEST_RESULT_LOG("P00 INFO: duplicate WAL '000000020000000200000000' for '10-1' exists, skipping"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("duplicates at beginning and end of list are removed"); @@ -510,8 +510,8 @@ testRun(void) TEST_RESULT_STR_Z(walRangeResult->start, "0000000200000001000000FD", "start range"); TEST_RESULT_STR_Z(walRangeResult->stop, "000000020000000200000000", "stop range"); TEST_RESULT_LOG( - "P00 INFO: duplicate WAL '000000020000000100000000' for '9.6-1' exists, skipping\n" - "P00 INFO: duplicate WAL '000000020000000200000001' for '9.6-1' exists, skipping"); + "P00 INFO: duplicate WAL '000000020000000100000000' for '10-1' exists, skipping\n" + "P00 INFO: duplicate WAL '000000020000000200000001' for '10-1' exists, skipping"); } // ***************************************************************************************************************************** @@ -561,7 +561,7 @@ testRun(void) "db-version=\"11\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6625592122879095777,\"db-version\":\"9.6\"}\n" + "1={\"db-id\":6625592122879095777,\"db-version\":\"10\"}\n" "2={\"db-id\":" HRN_PG_SYSTEMID_11_Z ",\"db-version\":\"11\"}")), cipherSpecNewNone()), "archive.info history system id mismatch"); @@ -583,7 +583,7 @@ testRun(void) "db-version=\"11\"\n" "\n" "[db:history]\n" - "1={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"18\"}\n" + "1={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"18\"}\n" "2={\"db-id\":" HRN_PG_SYSTEMID_11_Z ",\"db-version\":\"11\"}")), cipherSpecNewNone()), "archive.info history version mismatch"); @@ -605,7 +605,7 @@ testRun(void) "db-version=\"11\"\n" "\n" "[db:history]\n" - "3={\"db-id\":" HRN_PG_SYSTEMID_96_Z ",\"db-version\":\"10\"}\n" + "3={\"db-id\":" HRN_PG_SYSTEMID_10_Z ",\"db-version\":\"10\"}\n" "2={\"db-id\":" HRN_PG_SYSTEMID_11_Z ",\"db-version\":\"11\"}")), cipherSpecNewNone()), "archive.info history id mismatch"); @@ -636,7 +636,7 @@ testRun(void) strLstAddZ(backupList, "20181119-152138F"); strLstAddZ(backupList, "20181119-152900F"); StringList *archiveIdList = strLstComparatorSet(strLstNew(), archiveIdComparator); - strLstAddZ(archiveIdList, "9.6-1"); + strLstAddZ(archiveIdList, "10-1"); strLstAddZ(archiveIdList, "11-2"); unsigned int errTotal = 0; @@ -675,7 +675,7 @@ testRun(void) VerifyArchiveResult archiveIdResult = { - .archiveId = strNewZ("9.6-1"), + .archiveId = strNewZ("10-1"), .totalWalFile = 1, .walRangeList = lstNewP(sizeof(VerifyWalRange), .comparator = lstComparatorStr), }; @@ -692,7 +692,7 @@ testRun(void) TEST_RESULT_STR_Z( verifyRender(archiveIdResultList, backupResultList, cfgOptionBool(cfgOptVerbose)), "\n" - " archiveId: 9.6-1, total WAL checked: 1, total valid WAL: 0", "archive: no invalid file list"); + " archiveId: 10-1, total WAL checked: 1, total valid WAL: 0", "archive: no invalid file list"); VerifyInvalidFile invalidFile = { @@ -714,7 +714,7 @@ testRun(void) TEST_RESULT_STR_Z( verifyRender(archiveIdResultList, backupResultList, cfgOptionBool(cfgOptVerbose)), "\n" - " archiveId: 9.6-1, total WAL checked: 1, total valid WAL: 0\n" + " archiveId: 10-1, total WAL checked: 1, total valid WAL: 0\n" " missing: 1\n" " backup: test-backup-label, status: invalid, total files checked: 1, total valid files: 0\n" " missing: 1", "archive file missing, backup file missing, no text, no verbose"); @@ -777,7 +777,7 @@ testRun(void) TEST_BACKUP_DB1_CURRENT_FULL1 "\n" "[db]\n" - TEST_BACKUP_DB1_96 + TEST_BACKUP_DB1_10 "\n" "[db:history]\n" TEST_BACKUP_DB1_HISTORY, @@ -838,7 +838,7 @@ testRun(void) "P00 INFO: stanza: db\n" " status: error\n" " backup info file and archive info file do not match\n" - " archive: id = 1, version = 9.6, system-id = 10000000000000090600\n" + " archive: id = 1, version = 10, system-id = 10000000000000100000\n" " backup : id = 2, version = 11, system-id = 10000000000000110000\n" " HINT: this may be a symptom of repository corruption!"); @@ -1112,7 +1112,7 @@ testRun(void) .comment = "remove duplicate WAL"); HRN_STORAGE_PATH_CREATE( - storageRepoIdxWrite(0), STORAGE_REPO_ARCHIVE "/9.6-1", .comment = "empty path for old archiveId"); + storageRepoIdxWrite(0), STORAGE_REPO_ARCHIVE "/10-1", .comment = "empty path for old archiveId"); HRN_STORAGE_PATH_CREATE( storageRepoIdxWrite(0), STORAGE_REPO_ARCHIVE "/11-2/0000000100000000", .comment = "empty timeline path"); @@ -1143,7 +1143,7 @@ testRun(void) " checksum invalid: 1, size invalid: 1", "verifyProcess() no text, no verbose"); TEST_RESULT_LOG( "P00 DETAIL: no backups exist in the repo\n" - "P00 DETAIL: archive path '9.6-1' is empty\n" + "P00 DETAIL: archive path '10-1' is empty\n" "P00 DETAIL: path '11-2/0000000100000000' does not contain any valid WAL to be processed\n" "P01 INFO: invalid checksum" " '11-2/0000000200000007/000000020000000700000FFD-a6e1a64f0813352bc2e97f116a1800377e17d2e4.gz'\n" @@ -1164,7 +1164,7 @@ testRun(void) verifyProcess(cfgOptionBool(cfgOptVerbose)), "stanza: db\n" "status: error\n" - " archiveId: 9.6-1, total WAL checked: 0, total valid WAL: 0\n" + " archiveId: 10-1, total WAL checked: 0, total valid WAL: 0\n" " archiveId: 11-2, total WAL checked: 4, total valid WAL: 2\n" " missing: 0, checksum invalid: 1, size invalid: 1, other: 0\n" " backup: none found", @@ -1186,7 +1186,7 @@ testRun(void) verifyProcess(cfgOptionBool(cfgOptVerbose)), "stanza: db\n" "status: error\n" - " archiveId: 9.6-1, total WAL checked: 0, total valid WAL: 0\n" + " archiveId: 10-1, total WAL checked: 0, total valid WAL: 0\n" " archiveId: 11-2, total WAL checked: 4, total valid WAL: 2\n" " missing: 0, checksum invalid: 1, size invalid: 1, other: 0\n" " backup: none found", "verify text output, verbose, with verify failures"); @@ -1442,7 +1442,7 @@ testRun(void) TEST_RESULT_LOG( "P00 WARN: backup '20181119-153000F' found in the repository but not in backup.info\n" "P00 WARN: backup '20181119-152138F' found in backup.info but not in the repository\n" - "P00 DETAIL: archive path '9.6-1' is empty\n" + "P00 DETAIL: archive path '10-1' is empty\n" "P00 DETAIL: path '11-2/0000000100000000' does not contain any valid WAL to be processed\n" "P01 INFO: invalid checksum" " '11-2/0000000200000007/000000020000000700000FFD-a6e1a64f0813352bc2e97f116a1800377e17d2e4.gz'\n" diff --git a/test/src/module/db/dbTest.c b/test/src/module/db/dbTest.c index 5c82335e73..ca500204dc 100644 --- a/test/src/module/db/dbTest.c +++ b/test/src/module/db/dbTest.c @@ -18,15 +18,14 @@ Macro to check that replay is making progress -- this does not seem useful enoug ***********************************************************************************************************************************/ #define \ HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS( \ - sessionParam, walNameParam, lsnNameParam, targetLsnParam, targetReachedParam, replayLsnParam, replayLastLsnParam, \ - replayProgressParam, sleepParam) \ + sessionParam, targetLsnParam, targetReachedParam, replayLsnParam, replayLastLsnParam, replayProgressParam, sleepParam) \ {.session = sessionParam, \ .function = HRN_PQ_SENDQUERY, \ .param = \ "[\"select replayLsn::text,\\n" \ " (replayLsn > '" targetLsnParam "')::bool as targetReached,\\n" \ " (replayLsn > '" replayLastLsnParam "')::bool as replayProgress\\n" \ - " from pg_catalog.pg_last_" walNameParam "_replay_" lsnNameParam "() as replayLsn\"]", \ + " from pg_catalog.pg_last_wal_replay_lsn() as replayLsn\"]", \ .resultInt = 1, .sleep = sleepParam}, \ {.session = sessionParam, .function = HRN_PQ_CONSUMEINPUT}, \ {.session = sessionParam, .function = HRN_PQ_ISBUSY}, \ @@ -43,13 +42,6 @@ Macro to check that replay is making progress -- this does not seem useful enoug {.session = sessionParam, .function = HRN_PQ_CLEAR}, \ {.session = sessionParam, .function = HRN_PQ_GETRESULT, .resultNull = true} -#define \ - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10( \ - sessionParam, targetLsnParam, targetReachedParam, replayLsnParam, replayLastLsnParam, replayProgressParam, sleepParam) \ - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS( \ - sessionParam, "wal", "lsn", targetLsnParam, targetReachedParam, replayLsnParam, replayLastLsnParam, replayProgressParam, \ - sleepParam) - /*********************************************************************************************************************************** Test Run ***********************************************************************************************************************************/ @@ -85,7 +77,7 @@ testRun(void) HRN_PQ_SCRIPT_OPEN(1, "dbname='testdb' port=5432", PG_VERSION_15, TEST_PATH "/pg", false, NULL, NULL), HRN_PQ_SCRIPT_CREATE_RESTORE_POINT(1, "2/3"), - HRN_PQ_SCRIPT_WAL_SWITCH(1, "wal", "000000030000000200000003"), + HRN_PQ_SCRIPT_WAL_SWITCH(1, "000000030000000200000003"), HRN_PQ_SCRIPT_CLOSE(1)); // Create server @@ -244,16 +236,16 @@ testRun(void) TEST_RESULT_LOG( "P00 WARN: unable to check pg1: [DbQueryError] unable to select some rows from pg_settings\n" " HINT: is the backup running as the postgres user?\n" - " HINT: is the pg_read_all_settings role assigned for PostgreSQL >= 10?"); + " HINT: is the pg_read_all_settings role assigned?"); // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("PostgreSQL 9.6 start/stop backup"); + TEST_TITLE("PostgreSQL 10 start/stop backup"); - HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_96, .checkpoint = pgLsnFromStr(STRDEF("3/3"))); + HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_10, .checkpoint = pgLsnFromStr(STRDEF("3/3"))); // Connect to primary HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_OPEN(1, "dbname='backupdb' port=5432", PG_VERSION_96, TEST_PATH "/pg1", false, NULL, NULL)); + HRN_PQ_SCRIPT_OPEN(1, "dbname='backupdb' port=5432", PG_VERSION_10, TEST_PATH "/pg1", false, NULL, NULL)); DbGetResult db = {0}; TEST_ASSIGN(db, dbGet(true, true, CFGOPTVAL_BACKUP_STANDBY_N), "get primary"); @@ -264,16 +256,16 @@ testRun(void) // Start backup with timeline error HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_CURRENT_WAL_LE_96(1, "000000020000000300000002"), - HRN_PQ_SCRIPT_START_BACKUP_96(1, false, "3/3", "000000020000000300000003")); + HRN_PQ_SCRIPT_CURRENT_WAL(1, "000000020000000300000002"), + HRN_PQ_SCRIPT_START_BACKUP_GE_10(1, false, "3/3", "000000020000000300000003")); TEST_ERROR( dbBackupStart(db.primary, false, true), DbMismatchError, "WAL timeline 2 does not match pg_control timeline 1"); // Start backup with checkpoint error HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_CURRENT_WAL_LE_96(1, "000000010000000400000003"), - HRN_PQ_SCRIPT_START_BACKUP_96(1, false, "4/4", "000000010000000400000004")); + HRN_PQ_SCRIPT_CURRENT_WAL(1, "000000010000000400000003"), + HRN_PQ_SCRIPT_START_BACKUP_GE_10(1, false, "4/4", "000000010000000400000004")); TEST_ERROR( dbBackupStart(db.primary, false, true), DbMismatchError, @@ -281,8 +273,8 @@ testRun(void) // Start backup HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_CURRENT_WAL_LE_96(1, "000000010000000300000002"), - HRN_PQ_SCRIPT_START_BACKUP_96(1, false, "3/3", "000000010000000300000003")); + HRN_PQ_SCRIPT_CURRENT_WAL(1, "000000010000000300000002"), + HRN_PQ_SCRIPT_START_BACKUP_GE_10(1, false, "3/3", "000000010000000300000003")); DbBackupStartResult backupStartResult = {0}; TEST_ASSIGN(backupStartResult, dbBackupStart(db.primary, false, true), "start backup"); @@ -299,7 +291,7 @@ testRun(void) TEST_RESULT_STR_Z(hrnPackToStr(dbTablespaceList(db.primary)), "", "check tablespace list"); // Stop backup - HRN_PQ_SCRIPT_SET(HRN_PQ_SCRIPT_STOP_BACKUP_96(1, "3/4", "000000010000000300000004", false)); + HRN_PQ_SCRIPT_SET(HRN_PQ_SCRIPT_STOP_BACKUP_GE_10(1, "3/4", "000000010000000300000004", false)); DbBackupStopResult backupStopResult = {.lsn = NULL}; TEST_ASSIGN(backupStopResult, dbBackupStop(db.primary), "stop backup"); @@ -341,7 +333,7 @@ testRun(void) TEST_RESULT_STR_Z(dbBackupStart(db.primary, true, false).lsn, "5/4", "start backup"); // Wait for standby to sync - HRN_PQ_SCRIPT_SET(HRN_PQ_SCRIPT_REPLAY_WAIT_GE_10(2, "5/4")); + HRN_PQ_SCRIPT_SET(HRN_PQ_SCRIPT_REPLAY_WAIT(2, "5/4")); TEST_RESULT_VOID(dbReplayWait(db.standby, STRDEF("5/4"), dbPgControl(db.primary).timeline, 1000), "sync standby"); @@ -399,12 +391,12 @@ testRun(void) // Start backup HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_CURRENT_WAL_GE_10(1, "000000050000000500000005"), + HRN_PQ_SCRIPT_CURRENT_WAL(1, "000000050000000500000005"), HRN_PQ_SCRIPT_START_BACKUP_GE_10(1, false, "5/5", "000000050000000500000005"), // Switch WAL segment so it can be checked HRN_PQ_SCRIPT_CREATE_RESTORE_POINT(1, "5/5"), - HRN_PQ_SCRIPT_WAL_SWITCH(1, "wal", "000000050000000500000005")); + HRN_PQ_SCRIPT_WAL_SWITCH(1, "000000050000000500000005")); TEST_ASSIGN(backupStartResult, dbBackupStart(db.primary, false, true), "start backup"); TEST_RESULT_STR_Z(backupStartResult.lsn, "5/5", "check lsn"); @@ -443,9 +435,9 @@ testRun(void) // Timeout waiting for sync HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_GE_10(2, "5/5", false, "5/3"), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", false, "5/3", "5/3", false, 100), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", false, "5/3", "5/3", false, 100)); + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(2, "5/5", false, "5/3"), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", false, "5/3", "5/3", false, 100), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", false, "5/3", "5/3", false, 100)); TEST_ERROR( dbReplayWait(db.standby, STRDEF("5/5"), dbPgControl(db.primary).timeline, 200), ArchiveTimeoutError, @@ -455,11 +447,11 @@ testRun(void) // Checkpoint target timeout waiting for sync HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_GE_10(2, "5/5", true, "5/5"), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(2, "5/5", true, "5/5"), HRN_PQ_SCRIPT_CHECKPOINT(2), - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_GE_10(2, "5/5", false, "5/4", 100), - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_GE_10(2, "5/5", false, "5/4", 100), - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_GE_10(2, "5/5", false, "5/4", 100)); + HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED(2, "5/5", false, "5/4", 100), + HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED(2, "5/5", false, "5/4", 100), + HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED(2, "5/5", false, "5/4", 100)); TEST_ERROR( dbReplayWait(db.standby, STRDEF("5/5"), dbPgControl(db.primary).timeline, 200), ArchiveTimeoutError, @@ -467,12 +459,12 @@ testRun(void) // Wait for standby to sync HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_GE_10(2, "5/5", false, "5/3"), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", false, "5/3", "5/3", false, 0), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", false, "5/4", "5/3", true, 0), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", true, "5/5", "5/4", true, 0), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(2, "5/5", false, "5/3"), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", false, "5/3", "5/3", false, 0), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", false, "5/4", "5/3", true, 0), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", true, "5/5", "5/4", true, 0), HRN_PQ_SCRIPT_CHECKPOINT(2), - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_GE_10(2, "5/5", true, "X/X", 0)); + HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED(2, "5/5", true, "X/X", 0)); TEST_RESULT_VOID(dbReplayWait(db.standby, STRDEF("5/5"), dbPgControl(db.primary).timeline, 1000), "sync standby"); @@ -481,12 +473,12 @@ testRun(void) // Fail on timeline mismatch HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_GE_10(2, "5/5", false, "5/3"), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", false, "5/3", "5/3", false, 0), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", false, "5/4", "5/3", true, 0), - HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS_GE_10(2, "5/5", true, "5/5", "5/4", true, 0), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED(2, "5/5", false, "5/3"), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", false, "5/3", "5/3", false, 0), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", false, "5/4", "5/3", true, 0), + HRN_PQ_SCRIPT_REPLAY_TARGET_REACHED_PROGRESS(2, "5/5", true, "5/5", "5/4", true, 0), HRN_PQ_SCRIPT_CHECKPOINT(2), - HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED_GE_10(2, "5/5", true, "X/X", 0)); + HRN_PQ_SCRIPT_CHECKPOINT_TARGET_REACHED(2, "5/5", true, "X/X", 0)); TEST_ERROR( dbReplayWait(db.standby, STRDEF("5/5"), 77, 1000), DbMismatchError, "standby is on timeline 6 but expected 77"); @@ -522,7 +514,7 @@ testRun(void) // Start backup HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_CURRENT_WAL_GE_10(1, "000000050000000500000004"), + HRN_PQ_SCRIPT_CURRENT_WAL(1, "000000050000000500000004"), HRN_PQ_SCRIPT_START_BACKUP_GE_10(1, false, "5/5", "000000050000000500000005")); TEST_ASSIGN(backupStartResult, dbBackupStart(db.primary, false, true), "start backup"); @@ -554,7 +546,7 @@ testRun(void) // Start backup HRN_PQ_SCRIPT_SET( - HRN_PQ_SCRIPT_CURRENT_WAL_GE_10(1, "000000060000000600000005"), + HRN_PQ_SCRIPT_CURRENT_WAL(1, "000000060000000600000005"), HRN_PQ_SCRIPT_START_BACKUP_GE_15(1, false, "6/6", "000000060000000600000006")); TEST_ASSIGN(backupStartResult, dbBackupStart(db.primary, false, true), "start backup"); @@ -735,7 +727,7 @@ testRun(void) HRN_PQ_SCRIPT_OPEN(8, "dbname='postgres' port=5434", PG_VERSION_12, TEST_PATH "/pg8", false, NULL, NULL), HRN_PQ_SCRIPT_CREATE_RESTORE_POINT(8, "2/3"), - HRN_PQ_SCRIPT_WAL_SWITCH(8, "wal", "000000010000000200000003"), + HRN_PQ_SCRIPT_WAL_SWITCH(8, "000000010000000200000003"), HRN_PQ_SCRIPT_CLOSE(8), HRN_PQ_SCRIPT_CLOSE(1)); diff --git a/test/src/module/info/infoArchiveTest.c b/test/src/module/info/infoArchiveTest.c index 86b651213b..e1fcc28801 100644 --- a/test/src/module/info/infoArchiveTest.c +++ b/test/src/module/info/infoArchiveTest.c @@ -28,10 +28,10 @@ testRun(void) "[db]\n" "db-id=1\n" "db-system-id=6569239123849665679\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-id\":6569239123849665679,\"db-version\":\"9.6\"}\n"); + "1={\"db-id\":6569239123849665679,\"db-version\":\"10\"}\n"); InfoArchive *info = NULL; @@ -43,7 +43,7 @@ testRun(void) } MEM_CONTEXT_TEMP_END(); - TEST_RESULT_STR_Z(infoArchiveId(info), "9.6-1", "archiveId set"); + TEST_RESULT_STR_Z(infoArchiveId(info), "10-1", "archiveId set"); TEST_RESULT_PTR(infoArchivePg(info), info->pub.infoPg, "infoPg set"); TEST_RESULT_UINT(cipherSpecType(infoArchiveCipherSpec(info)), cipherTypeNone, "no cipher sub"); @@ -62,8 +62,8 @@ testRun(void) // Create the same content by creating a new object TEST_ASSIGN( info, infoArchiveNew( - PG_VERSION_96, 6569239123849665679, REPOSITORY_FORMAT_DEFAULT, NULL), "infoArchiveNew() - no sub cipher"); - TEST_RESULT_STR_Z(infoArchiveId(info), "9.6-1", "archiveId set"); + PG_VERSION_10, 6569239123849665679, REPOSITORY_FORMAT_DEFAULT, NULL), "infoArchiveNew() - no sub cipher"); + TEST_RESULT_STR_Z(infoArchiveId(info), "10-1", "archiveId set"); TEST_RESULT_PTR(infoArchivePg(info), info->pub.infoPg, "infoPg set"); TEST_RESULT_UINT(cipherSpecType(infoArchiveCipherSpec(info)), cipherTypeNone, "no cipher sub"); TEST_RESULT_INT(infoPgDataTotal(infoArchivePg(info)), 1, "history set"); @@ -121,10 +121,10 @@ testRun(void) TEST_TITLE("increment history"); InfoPgData infoPgData = {0}; - TEST_RESULT_VOID(infoArchivePgSet(info, PG_VERSION_96, 6569239123849665679), "add another infoPg"); + TEST_RESULT_VOID(infoArchivePgSet(info, PG_VERSION_11, 6569239123849665679), "add another infoPg"); TEST_RESULT_INT(infoPgDataTotal(infoArchivePg(info)), 2, "history incremented"); TEST_ASSIGN(infoPgData, infoPgDataCurrent(infoArchivePg(info)), "get current infoPgData"); - TEST_RESULT_INT(infoPgData.version, PG_VERSION_96, "version set"); + TEST_RESULT_INT(infoPgData.version, PG_VERSION_11, "version set"); TEST_RESULT_UINT(infoPgData.systemId, 6569239123849665679, "systemId set"); // ------------------------------------------------------------------------------------------------------------------------- diff --git a/test/src/module/info/infoBackupTest.c b/test/src/module/info/infoBackupTest.c index 9a09dc9bc6..2927306c27 100644 --- a/test/src/module/info/infoBackupTest.c +++ b/test/src/module/info/infoBackupTest.c @@ -28,18 +28,18 @@ testRun(void) // File with section to ignore const Buffer *contentLoad = harnessInfoChecksumZ( "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=6569239123849665679\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[ignore-section]\n" "key1=\"value1\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665679" - ",\"db-version\":\"9.6\"}\n"); + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665679" + ",\"db-version\":\"10\"}\n"); InfoBackup *infoBackup = NULL; @@ -64,7 +64,7 @@ testRun(void) TEST_ASSIGN( infoBackup, infoBackupNew( - PG_VERSION_96, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, NULL), + PG_VERSION_10, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, NULL), "infoBackupNew() - no cipher sub"); TEST_RESULT_VOID(infoBackupSave(infoBackup, ioBufferWriteNew(contentCompare)), "save backup info from new"); TEST_RESULT_STR(strNewBuf(contentCompare), strNewBuf(contentSave), "check save"); @@ -143,13 +143,13 @@ testRun(void) InfoPgData infoPgData = {0}; TEST_RESULT_VOID( - infoBackupPgSet(infoBackup, PG_VERSION_96, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_96)), + infoBackupPgSet(infoBackup, PG_VERSION_11, 6569239123849665679, hrnPgCatalogVersion(PG_VERSION_11)), "add another infoPg"); TEST_RESULT_INT(infoPgDataTotal(infoBackupPg(infoBackup)), 2, "history incremented"); TEST_ASSIGN(infoPgData, infoPgDataCurrent(infoBackupPg(infoBackup)), "get current infoPgData"); - TEST_RESULT_INT(infoPgData.version, PG_VERSION_96, "version set"); + TEST_RESULT_INT(infoPgData.version, PG_VERSION_11, "version set"); TEST_RESULT_UINT(infoPgData.systemId, 6569239123849665679, "systemId set"); - TEST_RESULT_UINT(infoPgData.catalogVersion, 201608131, "catalogVersion set"); + TEST_RESULT_UINT(infoPgData.catalogVersion, 201809051, "catalogVersion set"); // ------------------------------------------------------------------------------------------------------------------------- TEST_TITLE("object free"); @@ -188,15 +188,15 @@ testRun(void) "\"option-checksum-page\":false,\"option-compress\":true,\"option-hardlink\":false,\"option-online\":true}\n" "\n" "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=6569239123849665679\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665679" - ",\"db-version\":\"9.6\"}\n"); + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665679" + ",\"db-version\":\"10\"}\n"); TEST_ASSIGN(infoBackup, infoBackupNewLoad(ioBufferReadNew(contentLoad), cipherSpecNewNone()), "new backup info"); @@ -309,11 +309,11 @@ testRun(void) #define TEST_MANIFEST_BACKUPDB \ "\n" \ "[backup:db]\n" \ - "db-catalog-version=201608131\n" \ - "db-control-version=960\n" \ + "db-catalog-version=201707211\n" \ + "db-control-version=1002\n" \ "db-id=1\n" \ "db-system-id=6569239123849665679\n" \ - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" #define TEST_MANIFEST_FILE_DEFAULT \ "\n" \ @@ -1046,15 +1046,15 @@ testRun(void) "\"option-online\":true}\n" "\n" "[db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=6569239123849665679\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[db:history]\n" - "1={\"db-catalog-version\":201608131,\"db-control-version\":960,\"db-system-id\":6569239123849665679" - ",\"db-version\":\"9.6\"}\n"); + "1={\"db-catalog-version\":201707211,\"db-control-version\":1002,\"db-system-id\":6569239123849665679" + ",\"db-version\":\"10\"}\n"); InfoBackup *infoBackup; StringList *dependencyList; diff --git a/test/src/module/info/infoPgTest.c b/test/src/module/info/infoPgTest.c index d39f66a765..e1f2db38e0 100644 --- a/test/src/module/info/infoPgTest.c +++ b/test/src/module/info/infoPgTest.c @@ -202,14 +202,14 @@ testRun(void) // infoPgAdd // ------------------------------------------------------------------------------------------------------------------------- pgData.id = 3; - pgData.version = PG_VERSION_96; - pgData.systemId = HRN_PG_SYSTEMID_96; + pgData.version = PG_VERSION_10; + pgData.systemId = HRN_PG_SYSTEMID_10; TEST_RESULT_VOID(infoPgAdd(infoPg, &pgData), "infoPgAdd"); InfoPgData pgDataTest = infoPgDataCurrent(infoPg); TEST_RESULT_INT(pgDataTest.id, 3, " id set"); - TEST_RESULT_INT(pgDataTest.version, PG_VERSION_96, " version set"); - TEST_RESULT_UINT(pgDataTest.systemId, HRN_PG_SYSTEMID_96, " system-id set"); + TEST_RESULT_INT(pgDataTest.version, PG_VERSION_10, " version set"); + TEST_RESULT_UINT(pgDataTest.systemId, HRN_PG_SYSTEMID_10, " system-id set"); // infoPgDataToLog // ------------------------------------------------------------------------------------------------------------------------- diff --git a/test/src/module/info/manifestTest.c b/test/src/module/info/manifestTest.c index b9f232f829..da83a1a37c 100644 --- a/test/src/module/info/manifestTest.c +++ b/test/src/module/info/manifestTest.c @@ -71,11 +71,11 @@ testRun(void) #define TEST_MANIFEST_DB_94 \ "\n" \ "[backup:db]\n" \ - "db-catalog-version=201608131\n" \ - "db-control-version=960\n" \ + "db-catalog-version=201707211\n" \ + "db-control-version=1002\n" \ "db-id=0\n" \ "db-system-id=0\n" \ - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" #define TEST_MANIFEST_DB_12 \ "\n" \ @@ -163,10 +163,10 @@ testRun(void) Storage *storagePgWrite = storagePosixNewP(STRDEF(TEST_PATH "/pg"), .write = true); // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("manifest with all features - 9.6"); + TEST_TITLE("manifest with all features - 10"); // Version - HRN_STORAGE_PUT_Z(storagePgWrite, PG_FILE_PGVERSION, "9.6\n", .modeFile = 0600, .timeModified = 1565282100); + HRN_STORAGE_PUT_Z(storagePgWrite, PG_FILE_PGVERSION, "10\n", .modeFile = 0600, .timeModified = 1565282100); // base/1 directory HRN_STORAGE_PATH_CREATE(storagePgWrite, PG_PATH_BASE, .mode = 0700); @@ -238,10 +238,10 @@ testRun(void) HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_PATH_PGSUBTRANS "/" BOGUS_STR, .modeFile = 0600, .timeModified = 1565282107); // WAL directory not ignored when offline - HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_xlog", .mode = 0700); - HRN_STORAGE_PUT_EMPTY(storagePgWrite, "pg_xlog/" BOGUS_STR, .modeFile = 0600, .timeModified = 1565282108); - HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_xlog/archive_status", .mode = 0700); - HRN_STORAGE_PUT_EMPTY(storagePgWrite, "pg_xlog/archive_status/" BOGUS_STR, .modeFile = 0600, .timeModified = 1565282108); + HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_wal", .mode = 0700); + HRN_STORAGE_PUT_EMPTY(storagePgWrite, "pg_wal/" BOGUS_STR, .modeFile = 0600, .timeModified = 1565282108); + HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_wal/archive_status", .mode = 0700); + HRN_STORAGE_PUT_EMPTY(storagePgWrite, "pg_wal/archive_status/" BOGUS_STR, .modeFile = 0600, .timeModified = 1565282108); // global directory HRN_STORAGE_PATH_CREATE(storagePgWrite, PG_PATH_GLOBAL, .mode = 0700); @@ -257,24 +257,24 @@ testRun(void) strLstAddZ(exclusionList, PG_PATH_BASE "/"); strLstAddZ(exclusionList, "bogus/"); - // Make 'pg_xlog/archive_status' a link (if other links in the pg_xlog dir (should not be), they will be followed and added - // when online but archive_status (and pg_xlog), whether a link of not, will will only be followed if offline) - HRN_STORAGE_PATH_REMOVE(storagePgWrite, "pg_xlog/archive_status", .recurse = true); + // Make 'pg_wal/archive_status' a link (if other links in the pg_wal dir (should not be), they will be followed and added + // when online but archive_status (and pg_wal), whether a link of not, will will only be followed if offline) + HRN_STORAGE_PATH_REMOVE(storagePgWrite, "pg_wal/archive_status", .recurse = true); HRN_STORAGE_PATH_CREATE(storageTest, "archivestatus", .mode = 0777); THROW_ON_SYS_ERROR( - symlink("../../archivestatus", TEST_PATH "/pg/pg_xlog/archive_status") == -1, FileOpenError, + symlink("../../archivestatus", TEST_PATH "/pg/pg_wal/archive_status") == -1, FileOpenError, "unable to create symlink"); HRN_STORAGE_PUT_Z( - storagePgWrite, "pg_xlog/archive_status/" BOGUS_STR, "TESTDATA", .modeFile = 0600, .timeModified = 1565282120); + storagePgWrite, "pg_wal/archive_status/" BOGUS_STR, "TESTDATA", .modeFile = 0600, .timeModified = 1565282120); // Tablespace 1 - HRN_STORAGE_PATH_CREATE(storageTest, "ts/1/PG_9.6_201608131/1", .mode = 0700); + HRN_STORAGE_PATH_CREATE(storageTest, "ts/1/PG_10_201707211/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.6_201608131/1/16384", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); + storagePgWrite,"pg_tblspc/1/PG_10_201707211/1/16384", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); HRN_STORAGE_PUT_Z( - storagePgWrite,"pg_tblspc/1/PG_9.6_201608131/1/t123_123_fsm", "IGNORE_TEMP_RELATION", .modeFile = 0600, + storagePgWrite,"pg_tblspc/1/PG_10_201707211/1/t123_123_fsm", "IGNORE_TEMP_RELATION", .modeFile = 0600, .timeModified = 1565282115); // Add tablespaceList with error (no name) @@ -289,7 +289,7 @@ testRun(void) // Test tablespace error TEST_ERROR( manifestNewBuild( - storagePg, PG_VERSION_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, 1565282120, false, false, + storagePg, PG_VERSION_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, 1565282120, false, false, false, false, NULL, exclusionList, pckWriteResult(tablespaceList)), AssertError, "tablespace with oid 1 not found in tablespace map\n" @@ -314,7 +314,7 @@ testRun(void) TEST_ASSIGN( manifest, manifestNewBuild( - storagePg, PG_VERSION_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, 1565282120, false, false, + storagePg, PG_VERSION_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, 1565282120, false, false, false, false, NULL, NULL, pckWriteResult(tablespaceList)), "build manifest"); TEST_RESULT_VOID(manifestBackupLabelSet(manifest, STRDEF("20190818-084502F")), "backup label set"); @@ -333,28 +333,28 @@ testRun(void) "[backup:target]\n" "pg_data={\"path\":\"" TEST_PATH "/pg\",\"type\":\"path\"}\n" "pg_data/pg_hba.conf={\"file\":\"pg_hba.conf\",\"path\":\"../config\",\"type\":\"link\"}\n" - "pg_data/pg_xlog/archive_status={\"path\":\"../../archivestatus\",\"type\":\"link\"}\n" + "pg_data/pg_wal/archive_status={\"path\":\"../../archivestatus\",\"type\":\"link\"}\n" "pg_data/postgresql.conf={\"file\":\"postgresql.conf\",\"path\":\"../config\",\"type\":\"link\"}\n" "pg_tblspc/1={\"path\":\"../../ts/1\",\"tablespace-id\":\"1\",\"tablespace-name\":\"tblspc1\"" ",\"type\":\"link\"}\n" "\n" "[target:file]\n" - "pg_data/PG_VERSION={\"size\":4,\"timestamp\":1565282100}\n" + "pg_data/PG_VERSION={\"size\":3,\"timestamp\":1565282100}\n" "pg_data/base/1/555_init={\"size\":0,\"timestamp\":1565282114}\n" "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_hba.conf={\"size\":9,\"timestamp\":1565282117}\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/pg_wal/BOGUS={\"size\":0,\"timestamp\":1565282108}\n" + "pg_data/pg_wal/archive_status/BOGUS={\"size\":8,\"timestamp\":1565282120}\n" "pg_data/postgresql.conf={\"size\":14,\"timestamp\":1565282116}\n" - "pg_tblspc/1/PG_9.6_201608131/1/16384={\"size\":8,\"timestamp\":1565282115}\n" + "pg_tblspc/1/PG_10_201707211/1/16384={\"size\":8,\"timestamp\":1565282115}\n" TEST_MANIFEST_FILE_DEFAULT_PRIMARY_TRUE "\n" "[target:link]\n" "pg_data/pg_hba.conf={\"destination\":\"../config/pg_hba.conf\"}\n" "pg_data/pg_tblspc/1={\"destination\":\"../../ts/1\"}\n" - "pg_data/pg_xlog/archive_status={\"destination\":\"../../archivestatus\"}\n" + "pg_data/pg_wal/archive_status={\"destination\":\"../../archivestatus\"}\n" "pg_data/postgresql.conf={\"destination\":\"../config/postgresql.conf\"}\n" TEST_MANIFEST_LINK_DEFAULT "\n" @@ -371,12 +371,12 @@ testRun(void) "pg_data/pg_stat_tmp={\"mode\":\"0750\"}\n" "pg_data/pg_subtrans={}\n" "pg_data/pg_tblspc={}\n" - "pg_data/pg_xlog={}\n" - "pg_data/pg_xlog/archive_status={\"mode\":\"0777\"}\n" + "pg_data/pg_wal={}\n" + "pg_data/pg_wal/archive_status={\"mode\":\"0777\"}\n" "pg_tblspc={}\n" "pg_tblspc/1={}\n" - "pg_tblspc/1/PG_9.6_201608131={}\n" - "pg_tblspc/1/PG_9.6_201608131/1={}\n" + "pg_tblspc/1/PG_10_201707211={}\n" + "pg_tblspc/1/PG_10_201707211/1={}\n" TEST_MANIFEST_PATH_DEFAULT)), "check manifest"); @@ -391,27 +391,22 @@ 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.6_201608131", .recurse = true); + HRN_STORAGE_PATH_REMOVE(storageTest,"ts/1/PG_10_201707211", .recurse = true); // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("manifest with all features - 9.6, online"); - - // Create a path other than archive_status under pg_xlog for code coverage - HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_xlog/somepath", .mode = 0700); + TEST_TITLE("manifest with all features - 10, online"); - // Add data to pg_wal to ensure it is not ignored (online or offline) until >= pgVersion 10 (file in pg_xlog log is ignored) - HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_wal", .mode = 0700); - HRN_STORAGE_PUT_Z( - storagePgWrite, "pg_wal/000000010000000000000001", "WALDATA", .modeFile = 0600, .timeModified = 1565282120); + // Create a path other than archive_status under pg_wal for code coverage + HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_wal/somepath", .mode = 0700); - // Files to conditionally ignore before 9.6 + // Files that will always be ignored HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_POSTGRESQLAUTOCONFTMP, .modeFile = 0600, .timeModified = 1565282101); - // Test manifest - temp tables, unlogged tables, pg_serial and pg_xlog files ignored + // Test manifest - temp tables, unlogged tables, pg_serial and pg_wal files ignored TEST_ASSIGN( manifest, manifestNewBuild( - storagePg, PG_VERSION_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, 1565282120, true, false, + storagePg, PG_VERSION_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, 1565282120, true, false, false, false, NULL, NULL, NULL), "build manifest"); @@ -430,23 +425,22 @@ testRun(void) "[backup:target]\n" "pg_data={\"path\":\"" TEST_PATH "/pg\",\"type\":\"path\"}\n" "pg_data/pg_hba.conf={\"file\":\"pg_hba.conf\",\"path\":\"../config\",\"type\":\"link\"}\n" - "pg_data/pg_xlog/archive_status={\"path\":\"../../archivestatus\",\"type\":\"link\"}\n" + "pg_data/pg_wal/archive_status={\"path\":\"../../archivestatus\",\"type\":\"link\"}\n" "pg_data/postgresql.conf={\"file\":\"postgresql.conf\",\"path\":\"../config\",\"type\":\"link\"}\n" "\n" "[target:file]\n" - "pg_data/PG_VERSION={\"size\":4,\"timestamp\":1565282100}\n" + "pg_data/PG_VERSION={\"size\":3,\"timestamp\":1565282100}\n" "pg_data/base/1/555_init={\"size\":0,\"timestamp\":1565282114}\n" "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_hba.conf={\"size\":9,\"timestamp\":1565282117}\n" - "pg_data/pg_wal/000000010000000000000001={\"size\":7,\"timestamp\":1565282120}\n" "pg_data/postgresql.conf={\"size\":14,\"timestamp\":1565282116}\n" TEST_MANIFEST_FILE_DEFAULT_PRIMARY_TRUE "\n" "[target:link]\n" "pg_data/pg_hba.conf={\"destination\":\"../config/pg_hba.conf\"}\n" - "pg_data/pg_xlog/archive_status={\"destination\":\"../../archivestatus\"}\n" + "pg_data/pg_wal/archive_status={\"destination\":\"../../archivestatus\"}\n" "pg_data/postgresql.conf={\"destination\":\"../config/postgresql.conf\"}\n" TEST_MANIFEST_LINK_DEFAULT "\n" @@ -464,14 +458,13 @@ testRun(void) "pg_data/pg_subtrans={}\n" "pg_data/pg_tblspc={}\n" "pg_data/pg_wal={}\n" - "pg_data/pg_xlog={}\n" - "pg_data/pg_xlog/archive_status={\"mode\":\"0777\"}\n" - "pg_data/pg_xlog/somepath={}\n" + "pg_data/pg_wal/archive_status={\"mode\":\"0777\"}\n" + "pg_data/pg_wal/somepath={}\n" TEST_MANIFEST_PATH_DEFAULT)), "check manifest"); - // Remove pg_xlog and the directory that archive_status link pointed to - HRN_STORAGE_PATH_REMOVE(storagePgWrite, "pg_xlog", .recurse = true); + // Remove pg_wal and the directory that archive_status link pointed to + HRN_STORAGE_PATH_REMOVE(storagePgWrite, "pg_wal", .recurse = true); HRN_STORAGE_PATH_REMOVE(storageTest, "archivestatus", .recurse = true); // ------------------------------------------------------------------------------------------------------------------------- @@ -485,7 +478,7 @@ testRun(void) TEST_ERROR( manifestNewBuild( - storagePg, PG_VERSION_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, 1, false, false, false, + storagePg, PG_VERSION_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, 1, false, false, false, false, NULL, NULL, NULL), LinkDestinationError, "link 'pg_xlog/wal' (" TEST_PATH "/wal) destination is the same directory as link 'pg_xlog' (" TEST_PATH "/wal)"); @@ -493,15 +486,20 @@ testRun(void) HRN_STORAGE_REMOVE(storageTest, TEST_PATH "/wal/wal"); // ------------------------------------------------------------------------------------------------------------------------- - TEST_TITLE("manifest with all features - 9.6, checksum-page"); + TEST_TITLE("manifest with all features - 10, checksum-page"); // Version - HRN_STORAGE_PUT_Z(storagePgWrite, PG_FILE_PGVERSION, "9.6\n", .modeFile = 0600, .timeModified = 1565282100); + HRN_STORAGE_PUT_Z(storagePgWrite, PG_FILE_PGVERSION, "10\n", .modeFile = 0600, .timeModified = 1565282100); + + // WAL directory not ignored when offline + HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_wal", .mode = 0700); + HRN_STORAGE_PUT_Z( + storagePgWrite, "pg_wal/000000010000000000000001", "WALDATA", .modeFile = 0600, .timeModified = 1565282120); // Put a pgcontrol (always primary:true) HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, .modeFile = 0600, .timeModified = 1565282101); - // pg_clog pgVersion < 10 primary:false (pg_xact pgVersion < 10 primary:true), pg_multixact always primary:false + // pg_xact and pg_multixact are not ignored, pg_clog is just another path HRN_STORAGE_PATH_CREATE(storagePgWrite, PG_PATH_PGMULTIXACT, .mode = 0700); HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_PATH_PGMULTIXACT "/" BOGUS_STR, .modeFile = 0600, .timeModified = 1565282101); HRN_STORAGE_PATH_CREATE(storagePgWrite, "pg_clog", .mode = 0700); @@ -513,16 +511,16 @@ testRun(void) HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_RECOVERYSIGNAL, .modeFile = 0600, .timeModified = 1565282101); HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_STANDBYSIGNAL, .modeFile = 0600, .timeModified = 1565282101); - // Files to capture in version < 9.6 but ignore >= 9.6 (code coverage) + // Files that will always be ignored HRN_STORAGE_PUT_EMPTY(storagePgWrite, PG_FILE_BACKUPLABEL, .modeFile = 0600, .timeModified = 1565282101); // Tablespace 1 - HRN_STORAGE_PATH_CREATE(storageTest, "ts/1/PG_9.6_201608131/1", .mode = 0700); + HRN_STORAGE_PATH_CREATE(storageTest, "ts/1/PG_10_201707211/1", .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.6_201608131/1/16384", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); + storagePgWrite, "pg_tblspc/1/PG_10_201707211/1/16384", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); HRN_STORAGE_PUT_Z( - storagePgWrite, "pg_tblspc/1/PG_9.6_201608131/1/t123_123_fsm", "IGNORE_TEMP_RELATION", .modeFile = 0600, + storagePgWrite, "pg_tblspc/1/PG_10_201707211/1/t123_123_fsm", "IGNORE_TEMP_RELATION", .modeFile = 0600, .timeModified = 1565282115); // Add checksum-page files to exclude from checksum-page validation in database relation directories @@ -530,19 +528,19 @@ testRun(void) HRN_STORAGE_PUT_EMPTY( storagePgWrite, PG_PATH_BASE "/1/" PG_FILE_PGFILENODEMAP, .modeFile = 0600, .timeModified = 1565282120); HRN_STORAGE_PUT_EMPTY( - storagePgWrite, "pg_tblspc/1/PG_9.6_201608131/1/" PG_FILE_PGVERSION, .modeFile = 0600, .timeModified = 1565282120); + storagePgWrite, "pg_tblspc/1/PG_10_201707211/1/" PG_FILE_PGVERSION, .modeFile = 0600, .timeModified = 1565282120); // Tablespace 2 - HRN_STORAGE_PATH_CREATE(storageTest, "ts/2/PG_9.6_201608131/1", .mode = 0700); + HRN_STORAGE_PATH_CREATE(storageTest, "ts/2/PG_10_201707211/1", .mode = 0700); THROW_ON_SYS_ERROR(symlink("../../ts/2", TEST_PATH "/pg/pg_tblspc/2") == -1, FileOpenError, "unable to create symlink"); HRN_STORAGE_PUT_Z( - storagePgWrite, "pg_tblspc/2/PG_9.6_201608131/1/16385", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); + storagePgWrite, "pg_tblspc/2/PG_10_201707211/1/16385", "TESTDATA", .modeFile = 0600, .timeModified = 1565282115); // Test manifest - pg_dynshmem, pg_replslot and postgresql.auto.conf.tmp files ignored TEST_ASSIGN( manifest, manifestNewBuild( - storagePg, PG_VERSION_96, hrnPgCatalogVersion(PG_VERSION_96), REPOSITORY_FORMAT_DEFAULT, 1565282120, false, true, + storagePg, PG_VERSION_10, hrnPgCatalogVersion(PG_VERSION_10), REPOSITORY_FORMAT_DEFAULT, 1565282120, false, true, false, false, NULL, NULL, NULL), "build manifest"); @@ -567,7 +565,7 @@ testRun(void) "pg_tblspc/2={\"path\":\"../../ts/2\",\"tablespace-id\":\"2\",\"tablespace-name\":\"ts2\",\"type\":\"link\"}\n" "\n" "[target:file]\n" - "pg_data/PG_VERSION={\"size\":4,\"timestamp\":1565282100}\n" + "pg_data/PG_VERSION={\"size\":3,\"timestamp\":1565282100}\n" "pg_data/base/1/555_init={\"checksum-page\":true,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_init.1={\"checksum-page\":true,\"size\":0,\"timestamp\":1565282114}\n" "pg_data/base/1/555_vm.1_vm={\"checksum-page\":true,\"size\":0,\"timestamp\":1565282114}\n" @@ -583,9 +581,9 @@ testRun(void) "pg_data/postgresql.conf={\"size\":14,\"timestamp\":1565282116}\n" "pg_data/recovery.signal={\"size\":0,\"timestamp\":1565282101}\n" "pg_data/standby.signal={\"size\":0,\"timestamp\":1565282101}\n" - "pg_tblspc/1/PG_9.6_201608131/1/16384={\"checksum-page\":true,\"size\":8,\"timestamp\":1565282115}\n" - "pg_tblspc/1/PG_9.6_201608131/1/PG_VERSION={\"size\":0,\"timestamp\":1565282120}\n" - "pg_tblspc/2/PG_9.6_201608131/1/16385={\"checksum-page\":true,\"size\":8,\"timestamp\":1565282115}\n" + "pg_tblspc/1/PG_10_201707211/1/16384={\"checksum-page\":true,\"size\":8,\"timestamp\":1565282115}\n" + "pg_tblspc/1/PG_10_201707211/1/PG_VERSION={\"size\":0,\"timestamp\":1565282120}\n" + "pg_tblspc/2/PG_10_201707211/1/16385={\"checksum-page\":true,\"size\":8,\"timestamp\":1565282115}\n" TEST_MANIFEST_FILE_DEFAULT_PRIMARY_FALSE "\n" "[target:link]\n" @@ -616,11 +614,11 @@ testRun(void) "pg_data/pg_xlog={}\n" "pg_tblspc={}\n" "pg_tblspc/1={}\n" - "pg_tblspc/1/PG_9.6_201608131={}\n" - "pg_tblspc/1/PG_9.6_201608131/1={}\n" + "pg_tblspc/1/PG_10_201707211={}\n" + "pg_tblspc/1/PG_10_201707211/1={}\n" "pg_tblspc/2={}\n" - "pg_tblspc/2/PG_9.6_201608131={}\n" - "pg_tblspc/2/PG_9.6_201608131/1={}\n" + "pg_tblspc/2/PG_10_201707211={}\n" + "pg_tblspc/2/PG_10_201707211/1={}\n" TEST_MANIFEST_PATH_DEFAULT)), "check manifest"); @@ -994,11 +992,11 @@ testRun(void) "backup-type=\"incr\"\n" \ "\n" \ "[backup:db]\n" \ - "db-catalog-version=201608131\n" \ - "db-control-version=960\n" \ + "db-catalog-version=201707211\n" \ + "db-control-version=1002\n" \ "db-id=0\n" \ "db-system-id=0\n" \ - "db-version=\"9.6\"\n" \ + "db-version=\"10\"\n" \ "\n" \ "[backup:option]\n" \ "option-archive-check=false\n" \ @@ -1034,8 +1032,8 @@ testRun(void) manifest = manifestNewInternal(); manifest->pub.info = infoNew(REPOSITORY_FORMAT_DEFAULT, NULL); manifest->pub.data.backupTimestampStart = 1482182860; - manifest->pub.data.pgVersion = PG_VERSION_96; - manifest->pub.data.pgCatalogVersion = hrnPgCatalogVersion(PG_VERSION_96); + manifest->pub.data.pgVersion = PG_VERSION_10; + manifest->pub.data.pgCatalogVersion = hrnPgCatalogVersion(PG_VERSION_10); manifest->pub.data.backupOptionDelta = BOOL_FALSE_VAR; HRN_MANIFEST_TARGET_ADD(manifest, .name = MANIFEST_TARGET_PGDATA, .path = "/pg"); @@ -1435,11 +1433,11 @@ testRun(void) "backup-type=\"full\"\n" "\n" "[backup:db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=1\n" "db-system-id=1000000000000000094\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[backup:option]\n" "option-archive-check=true\n" @@ -1528,11 +1526,11 @@ testRun(void) "backup-type=\"full\"\n" \ "\n" \ "[backup:db]\n" \ - "db-catalog-version=201608131\n" \ - "db-control-version=960\n" \ + "db-catalog-version=201707211\n" \ + "db-control-version=1002\n" \ "db-id=1\n" \ "db-system-id=1000000000000000094\n" \ - "db-version=\"9.6\"\n" \ + "db-version=\"10\"\n" \ "\n" \ "[backup:option]\n" \ "option-archive-check=true\n" \ @@ -1584,7 +1582,7 @@ testRun(void) ",\"rck\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"reference\":\"20190818-084502F_20190819-084506D\"" \ ",\"size\":4,\"timestamp\":1565282114}\n" \ "pg_data/base/16384/17000={\"bi\":4,\"bni\":1,\"checksum\":\"e0101dd8ffb910c9c202ca35b5f828bcb9697bed\"" \ - ",\"checksum-page\":false,\"checksum-page-error\":[1],\"repo-size\":4096,\"size\":8192,\"szo\":16384" \ + ",\"checksum-page\":false,\"checksum-page-error\":[1],\"repo-size\":4096,\"size\":8192,\"szo\":16384" \ ",\"timestamp\":1565282114}\n" \ "pg_data/base/16384/PG_VERSION={\"bni\":1,\"bno\":1,\"checksum\":\"184473f470864e067ee3a22e64b47b0a1c356f29\"" \ ",\"group\":\"group2\",\"size\":4,\"timestamp\":1565282115,\"user\":false}\n" \ @@ -1652,11 +1650,11 @@ testRun(void) "backup-type=\"full\"\n" "\n" "[backup:db]\n" - "db-catalog-version=201608131\n" - "db-control-version=960\n" + "db-catalog-version=201707211\n" + "db-control-version=1002\n" "db-id=2\n" "db-system-id=2000000000000000094\n" - "db-version=\"9.6\"\n" + "db-version=\"10\"\n" "\n" "[backup:option]\n" "option-archive-check=false\n" @@ -2003,11 +2001,11 @@ testRun(void) "ignore-key=\"ignore-value\"\n" \ "\n" \ "[backup:db]\n" \ - "db-catalog-version=201608131\n" \ - "db-control-version=960\n" \ + "db-catalog-version=201707211\n" \ + "db-control-version=1002\n" \ "db-id=1\n" \ "db-system-id=1000000000000000094\n" \ - "db-version=\"9.6\"\n" \ + "db-version=\"10\"\n" \ "ignore-key=\"ignore-value\"\n" \ "\n" \ "[backup:option]\n" \ diff --git a/test/src/module/integration/allTest.c b/test/src/module/integration/allTest.c index a4dc0e969d..15a1f28ae8 100644 --- a/test/src/module/integration/allTest.c +++ b/test/src/module/integration/allTest.c @@ -20,17 +20,16 @@ Test definition static HrnHostTestDefine testMatrix[] = { // {uncrustify_off - struct alignment} - {.pg = "9.6", .repo = "repo", .tls = 0, .stg = "azure", .enc = 0, .cmp = "none", .rt = 2, .bnd = 1, .bi = 1}, - {.pg = "10", .repo = "pg2", .tls = 0, .stg = "sftp", .enc = 1, .cmp = "gz", .rt = 1, .bnd = 1, .bi = 0}, - {.pg = "11", .repo = "repo", .tls = 1, .stg = "gcs", .enc = 0, .cmp = "lz4", .rt = 2, .bnd = 0, .bi = 0}, - {.pg = "12", .repo = "repo", .tls = 0, .stg = "s3", .enc = 1, .cmp = "zst", .rt = 1, .bnd = 1, .bi = 1}, - {.pg = "13", .repo = "pg2", .tls = 1, .stg = "azure", .enc = 0, .cmp = "none", .rt = 1, .bnd = 0, .bi = 0}, - {.pg = "14", .repo = "repo", .tls = 0, .stg = "gcs", .enc = 0, .cmp = "bz2", .rt = 1, .bnd = 1, .bi = 0}, - {.pg = "15", .repo = "pg2", .tls = 0, .stg = "posix", .enc = 1, .cmp = "none", .rt = 2, .bnd = 1, .bi = 1}, - {.pg = "16", .repo = "repo", .tls = 0, .stg = "sftp", .enc = 0, .cmp = "zst", .rt = 1, .bnd = 1, .bi = 1}, - {.pg = "17", .repo = "repo", .tls = 0, .stg = "posix", .enc = 0, .cmp = "none", .rt = 1, .bnd = 0, .bi = 0}, - {.pg = "18", .repo = "pg2", .tls = 1, .stg = "s3", .enc = 1, .cmp = "lz4", .rt = 1, .bnd = 1, .bi = 1}, - {.pg = "19", .repo = "repo", .tls = 0, .stg = "posix", .enc = 0, .cmp = "none", .rt = 1, .bnd = 0, .bi = 0}, + {.pg = "10", .repo = "pg2", .tls = 0, .stg = "sftp", .enc = 1, .cmp = "gz", .rt = 2, .bnd = 1, .bi = 0}, + {.pg = "11", .repo = "repo", .tls = 1, .stg = "gcs", .enc = 0, .cmp = "lz4", .rt = 2, .bnd = 0, .bi = 0}, + {.pg = "12", .repo = "repo", .tls = 0, .stg = "s3", .enc = 0, .cmp = "zst", .rt = 2, .bnd = 1, .bi = 0}, + {.pg = "13", .repo = "pg2", .tls = 1, .stg = "azure", .enc = 0, .cmp = "gz", .rt = 1, .bnd = 0, .bi = 0}, + {.pg = "14", .repo = "pg2", .tls = 0, .stg = "gcs", .enc = 1, .cmp = "bz2", .rt = 1, .bnd = 1, .bi = 0}, + {.pg = "15", .repo = "pg2", .tls = 1, .stg = "posix", .enc = 1, .cmp = "zst", .rt = 2, .bnd = 1, .bi = 1}, + {.pg = "16", .repo = "repo", .tls = 1, .stg = "sftp", .enc = 0, .cmp = "bz2", .rt = 1, .bnd = 1, .bi = 1}, + {.pg = "17", .repo = "repo", .tls = 0, .stg = "azure", .enc = 1, .cmp = "none", .rt = 2, .bnd = 1, .bi = 1}, + {.pg = "18", .repo = "pg2", .tls = 1, .stg = "s3", .enc = 1, .cmp = "lz4", .rt = 1, .bnd = 1, .bi = 1}, + {.pg = "19", .repo = "repo", .tls = 0, .stg = "posix", .enc = 0, .cmp = "none", .rt = 1, .bnd = 0, .bi = 0}, // {uncrustify_on} }; @@ -440,11 +439,7 @@ testRun(void) // Store the timeline so it can be used in a later test const char *const xidTimeline = strZ( pckReadStrP( - hrnHostSqlValue( - pg1, - zNewFmt( - "select trim(leading '0' from substring(pg_%sfile_name('1/1'), 1, 8))", - strZ(pgWalName(hrnHostPgVersion())))))); + hrnHostSqlValue(pg1, "select trim(leading '0' from substring(pg_walfile_name('1/1'), 1, 8))"))); TEST_LOG_FMT("xid timeline = %s", xidTimeline); // ------------------------------------------------------------------------------------------------------------------------- diff --git a/test/src/module/postgres/interfaceTest.c b/test/src/module/postgres/interfaceTest.c index 3db39fcda2..91f1dafac5 100644 --- a/test/src/module/postgres/interfaceTest.c +++ b/test/src/module/postgres/interfaceTest.c @@ -33,7 +33,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(90600), "9.6", "infoPgVersionToString 9.6"); TEST_RESULT_STR_Z(pgVersionToStr(96456), "9.64", "infoPgVersionToString 96456"); } @@ -60,7 +60,7 @@ testRun(void) "invalid PostgreSQL version 7.3\n" "HINT: is this version of PostgreSQL supported?\n" "HINT: is pgBackRest up to date on all hosts?"); - TEST_RESULT_UINT(pgControlVersion(PG_VERSION_96), 960, "9.6 control version"); + TEST_RESULT_UINT(pgControlVersion(PG_VERSION_10), 1002, "10 control version"); TEST_RESULT_UINT(pgControlVersion(PG_VERSION_11), 1100, "11 control version"); TEST_RESULT_UINT(pgControlVersion(PG_VERSION_17), 1700, "17 control version"); } @@ -150,7 +150,7 @@ testRun(void) "wal segment size is 2147483648 but must be a power of two between 1048576 and 1073741824 inclusive"); // ------------------------------------------------------------------------------------------------------------------------- - HRN_PG_CONTROL_PUT(storageTest, PG_VERSION_96, .pageSize = 64 * 1024); + HRN_PG_CONTROL_PUT(storageTest, PG_VERSION_10, .pageSize = 64 * 1024); TEST_ERROR( pgControlFromFile(storageTest, NULL), FormatError, @@ -179,13 +179,13 @@ testRun(void) TEST_TITLE("check all valid page sizes"); HRN_PG_CONTROL_PUT( - storageTest, PG_VERSION_96, .systemId = 0xEFEFEFEFEF, .catalogVersion = hrnPgCatalogVersion(PG_VERSION_96), + storageTest, PG_VERSION_10, .systemId = 0xEFEFEFEFEF, .catalogVersion = hrnPgCatalogVersion(PG_VERSION_10), .checkpoint = 0xAABBAABBEEFFEEFF, .timeline = 88, .pageSize = pgPageSize1, .pageChecksumVersion = 1); TEST_ASSIGN(info, pgControlFromFile(storageTest, NULL), "get control info"); TEST_RESULT_UINT(info.systemId, 0xEFEFEFEFEF, " check system id"); - TEST_RESULT_UINT(info.version, PG_VERSION_96, "check version"); - TEST_RESULT_UINT(info.catalogVersion, 201608131, "check catalog version"); + TEST_RESULT_UINT(info.version, PG_VERSION_10, "check version"); + TEST_RESULT_UINT(info.catalogVersion, 201707211, "check catalog version"); TEST_RESULT_UINT(info.checkpoint, 0xAABBAABBEEFFEEFF, "check checkpoint"); TEST_RESULT_UINT(info.timeline, 88, "check timeline"); TEST_RESULT_UINT(info.pageSize, pgPageSize1, "check page size"); @@ -357,22 +357,9 @@ testRun(void) } // ***************************************************************************************************************************** - if (testBegin("pgLsnName(), pgTablespaceId(), pgWalName(), pgWalPath(), and pgXactPath()")) + if (testBegin("pgTablespaceId()")) { - 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_96, 888888888), "PG_9.6_888888888", "check 9.6 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"); - - TEST_RESULT_STR_Z(pgWalPath(PG_VERSION_96), "pg_xlog", "check xlog path"); - TEST_RESULT_STR_Z(pgWalPath(PG_VERSION_10), "pg_wal", "check wal path"); - - TEST_RESULT_STR_Z(pgXactPath(PG_VERSION_96), "pg_clog", "check pg_clog name"); - TEST_RESULT_STR_Z(pgXactPath(PG_VERSION_10), "pg_xact", "check pg_xact name"); } // ***************************************************************************************************************************** @@ -500,12 +487,12 @@ testRun(void) // ------------------------------------------------------------------------------------------------------------------------- memset(bufPtr(result), 0, bufSize(result)); - HRN_PG_WAL_TO_BUFFER(result, PG_VERSION_96, .systemId = 0xEAEAEAEA, .size = HRN_PG_WAL_SEGMENT_SIZE_DEFAULT); + HRN_PG_WAL_TO_BUFFER(result, PG_VERSION_10, .systemId = 0xEAEAEAEA, .size = HRN_PG_WAL_SEGMENT_SIZE_DEFAULT); storagePutP(storageNewWriteP(storageTest, walFile), result); - TEST_ASSIGN(info, pgWalFromFile(walFile, storageTest, NULL), "get wal info v9.6"); + TEST_ASSIGN(info, pgWalFromFile(walFile, storageTest, NULL), "get wal info v10"); TEST_RESULT_UINT(info.systemId, 0xEAEAEAEA, " check system id"); - TEST_RESULT_UINT(info.version, PG_VERSION_96, " check version"); + TEST_RESULT_UINT(info.version, PG_VERSION_10, " check version"); TEST_RESULT_UINT(info.size, HRN_PG_WAL_SEGMENT_SIZE_DEFAULT, " check size"); // ------------------------------------------------------------------------------------------------------------------------- diff --git a/test/src/module/test/command/test/list_test.py b/test/src/module/test/command/test/list_test.py index e4db77614b..973c369c78 100644 --- a/test/src/module/test/command/test/list_test.py +++ b/test/src/module/test/command/test/list_test.py @@ -169,7 +169,7 @@ def test_list_pg_version(): ) # A version the vm does not install selects nothing, since another vm in the same run may well install it - assert_equal(test_list_get(MODULE_LIST, _Config(vm="d12", module=["integration"], pg_version="9.6")), []) + assert_equal(test_list_get(MODULE_LIST, _Config(vm="d12", module=["integration"], pg_version="10")), []) # A version the project does not support is a typo rather than a selection of nothing with assert_raises(ToolError) as error: diff --git a/test/src/module/test/command/vm/build_test.py b/test/src/module/test/command/vm/build_test.py index 517f534f68..beaad46f90 100644 --- a/test/src/module/test/command/vm/build_test.py +++ b/test/src/module/test/command/vm/build_test.py @@ -58,8 +58,8 @@ sed -i 's/^\\#create\\_main\\_cluster.*$/create\\_main\\_cluster \\= false/' /etc/postgresql-common/createcluster.conf && \\ # Install PostgreSQL - apt-get install -y --no-install-recommends postgresql-9.6 postgresql-10 postgresql-11 postgresql-12 postgresql-13 \ -postgresql-14 postgresql-15 postgresql-16 postgresql-17 postgresql-18 postgresql-19 && \\ + apt-get install -y --no-install-recommends postgresql-10 postgresql-11 postgresql-12 postgresql-13 postgresql-14 \ +postgresql-15 postgresql-16 postgresql-17 postgresql-18 postgresql-19 && \\ # Cleanup apt-get autoremove -y && \\
^ permalink raw [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-16 15:42 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

@dwsteele assigned @dwsteele.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-16 15:42 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

@dwsteele applied label "enhancement".

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-16 15:42 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

@dwsteele applied label "module [core]".

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-16 15:42 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

@dwsteele set milestone to "2.61.0".

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921 (approved): Remove support for PostgreSQL 9.6.
@ 2026-11-17 09:22 ` "pgstef (@pgstef)" <noreply+pgstef@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: pgstef (@pgstef) @ 2026-11-17 09:22 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

The PR looks good to me!

I noticed a minor issue during the review. It's not directly related to this PR, since the same behavior already exists for PostgreSQL 9.5 and older, but I thought it might be worth mentioning.

Restoring an older backup fails after cleaning the target data directory. When restoring a retained PostgreSQL 9.6 backup, `manifestSave()` eventually calls `pgControlVersion()`, which throws an "invalid PostgreSQL version 9.6" error. Unfortunately, this happens after `restoreCleanBuild()` has already modified PGDATA (removing `pg_control` and stray files with `--delta`), leaving an empty temporary manifest behind.

Perhaps we should validate the PostgreSQL version earlier, before making any changes to PGDATA?

Since this is a pre-existing issue, I wouldn't suggest fixing it in this PR, but I thought it was worth pointing out while we're touching PostgreSQL version support.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-17 15:10 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-17 15:10 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

> Restoring an older backup fails after cleaning the target data directory.

Good point. I'll submit a PR to improve this.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-17 15:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-17 15:14 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

@dwsteele closed this.

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-17 15:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-17 15:14 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

@dwsteele merged this (commit d43655685c61).

^ permalink  raw  [nested|flat] 10+ messages in thread

* Re: [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6.
@ 2026-11-17 15:21 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
  8 siblings, 0 replies; 10+ messages in thread

From: dwsteele (@dwsteele) @ 2026-11-17 15:21 UTC (permalink / raw)
  To: pgbackrest/pgbackrest <noreply+pgbackrest-pgbackrest@github.com>

> Restoring an older backup fails after cleaning the target data directory.

Opened PR #2925 to improve this.

^ permalink  raw  [nested|flat] 10+ messages in thread


end of thread, other threads:[~2026-11-17 15:21 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 15:41 [pgbackrest/pgbackrest] PR #2921: Remove support for PostgreSQL 9.6. "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-16 15:42 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-17 09:22 ` Re: [pgbackrest/pgbackrest] PR #2921 (approved): Remove support for PostgreSQL 9.6. "pgstef (@pgstef)" <noreply+pgstef@github.com>
2026-11-17 15:10 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-17 15:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-17 15:14 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>
2026-11-17 15:21 ` "dwsteele (@dwsteele)" <noreply+dwsteele@github.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox