1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-25 00:16:54 +02:00

Support configurable WAL segment size.

PostgreSQL 11 introduces configurable WAL segment sizes, from 1MB to 1GB.

There are two areas that needed to be updated to support this: building the archive-get queue and checking that WAL has been archived after a backup.  Both operations require the WAL segment size to properly build a list.

Checking the archive after a backup is still implemented in Perl and has an active database connection, so just get the WAL segment size from the database.

The archive-get command does not have a connection to the database, so get the WAL segment size from pg_control instead.  This requires a deeper inspection of pg_control than has been done in the past, so it seemed best to copy the relevant data structures from each version of PostgreSQL and build a generic interface layer to address them.  While this approach is a bit verbose, it has the advantage of being relatively simple, and can easily be updated for new versions of PostgreSQL.

Since the integration tests generate pg_control files for testing, teach Perl how to generate files with the correct offsets for both 32-bit and 64-bit architectures.
This commit is contained in:
David Steele
2018-09-25 10:24:42 +01:00
parent c0b0b4e541
commit d038b9a029
68 changed files with 4949 additions and 486 deletions

View File

@ -4,6 +4,11 @@ PostreSQL Version Constants
#ifndef POSTGRES_VERSION_H
#define POSTGRES_VERSION_H
/***********************************************************************************************************************************
PostgreSQL name
***********************************************************************************************************************************/
#define PG_NAME "PostgreSQL"
/***********************************************************************************************************************************
PostgreSQL version constants
***********************************************************************************************************************************/
@ -19,4 +24,19 @@ PostgreSQL version constants
#define PG_VERSION_10 100000
#define PG_VERSION_11 110000
/***********************************************************************************************************************************
PostgreSQL version string constants for use in error messages
***********************************************************************************************************************************/
#define PG_VERSION_83_STR "8.3"
#define PG_VERSION_84_STR "8.4"
#define PG_VERSION_90_STR "9.0"
#define PG_VERSION_91_STR "9.1"
#define PG_VERSION_92_STR "9.2"
#define PG_VERSION_93_STR "9.3"
#define PG_VERSION_94_STR "9.4"
#define PG_VERSION_95_STR "9.5"
#define PG_VERSION_96_STR "9.6"
#define PG_VERSION_10_STR "10"
#define PG_VERSION_11_STR "11"
#endif