1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-06 08:49:29 +02:00

PostgreSQL 16 Support.

Add catalog version and WAL magic for PostgreSQL 16.

The GUC to force parallel mode has be renamed so update that in the tests.
This commit is contained in:
David Steele
2023-04-27 10:30:50 +03:00
committed by GitHub
parent 39059dc4e7
commit 3fc3690dd7
15 changed files with 89 additions and 12 deletions

View File

@@ -507,9 +507,13 @@ sub containerBuild
$strScript .=
" echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg main" .
"\" >> /etc/apt/sources.list.d/pgdg.list && \\\n" .
($strOS eq VM_U22 ?
" echo \"deb http://apt.postgresql.org/pub/repos/apt/ \$(lsb_release -s -c)-pgdg-snapshot main 16\"" .
" >> /etc/apt/sources.list.d/pgdg.list && \\\n" : '') .
" wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \\\n" .
" apt-get update && \\\n" .
" apt-get install -y --no-install-recommends postgresql-common libpq-dev && \\\n" .
" apt-get install -y --no-install-recommends" .
($strOS eq VM_U22 ? " -t \$(lsb_release -s -c)-pgdg-snapshot" : '') . " postgresql-common libpq-dev && \\\n" .
" sed -i 's/^\\#create\\_main\\_cluster.*\$/create\\_main\\_cluster \\= false/' " .
"/etc/postgresql-common/createcluster.conf";
}
@@ -525,8 +529,10 @@ sub containerBuild
}
else
{
$strScript .= " apt-get install -y --no-install-recommends";
}
$strScript .=
" apt-get install -y --no-install-recommends" .
($strOS eq VM_U22 ? " -t \$(lsb_release -s -c)-pgdg-snapshot" : '');
}
# Construct list of databases to install
foreach my $strDbVersion (@{$oOS->{&VM_DB}})

View File

@@ -35,6 +35,8 @@ use constant PG_VERSION_14 => '14';
push @EXPORT, qw(PG_VERSION_14);
use constant PG_VERSION_15 => '15';
push @EXPORT, qw(PG_VERSION_15);
use constant PG_VERSION_16 => '16';
push @EXPORT, qw(PG_VERSION_16);
####################################################################################################################################
# versionSupport
@@ -47,7 +49,7 @@ sub versionSupport
my ($strOperation) = logDebugParam(__PACKAGE__ . '->versionSupport');
my @strySupportVersion = (PG_VERSION_93, PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, PG_VERSION_10, PG_VERSION_11,
PG_VERSION_12, PG_VERSION_13, PG_VERSION_14, PG_VERSION_15);
PG_VERSION_12, PG_VERSION_13, PG_VERSION_14, PG_VERSION_15, PG_VERSION_16);
# Return from function and log return values if any
return logDebugReturn

View File

@@ -262,6 +262,7 @@ my $oyVm =
PG_VERSION_13,
PG_VERSION_14,
PG_VERSION_15,
PG_VERSION_16,
],
&VM_DB_TEST =>
@@ -269,6 +270,7 @@ my $oyVm =
PG_VERSION_95,
PG_VERSION_96,
PG_VERSION_15,
PG_VERSION_16,
],
},
};

View File

@@ -436,7 +436,16 @@ sub clusterStart
# works since pg_stop_backup() is marked parallel safe and will error if run in a worker.
if ($self->pgVersion() >= PG_VERSION_96)
{
$strCommand .= " -c force_parallel_mode='on' -c max_parallel_workers_per_gather=2";
if ($self->pgVersion() >= PG_VERSION_16)
{
$strCommand .= " -c debug_parallel_query='on'";
}
else
{
$strCommand .= " -c force_parallel_mode='on'";
}
$strCommand .= " -c max_parallel_workers_per_gather=2";
}
$strCommand .=

View File

@@ -254,6 +254,7 @@ sub dbCatalogVersion
&PG_VERSION_13 => 202007201,
&PG_VERSION_14 => 202105121,
&PG_VERSION_15 => 202209061,
&PG_VERSION_16 => 202304110,
};
if (!defined($hCatalogVersion->{$strPgVersion}))
@@ -295,6 +296,7 @@ sub dbControlVersion
&PG_VERSION_13 => 1300,
&PG_VERSION_14 => 1300,
&PG_VERSION_15 => 1300,
&PG_VERSION_16 => 1300,
};
if (!defined($hControlVersion->{$strPgVersion}))

View File

@@ -62,6 +62,7 @@ sub run
{pg => '13', dst => 'db-standby', tls => 1, stg => GCS, enc => 0, cmp => ZST, rt => 1, bnd => 1, bi => 1},
{pg => '14', dst => 'backup', tls => 0, stg => POSIX, enc => 1, cmp => LZ4, rt => 2, bnd => 0, bi => 0},
{pg => '15', dst => 'db-standby', tls => 0, stg => AZURE, enc => 0, cmp => NONE, rt => 2, bnd => 1, bi => 1},
{pg => '16', dst => 'db-standby', tls => 0, stg => S3, enc => 1, cmp => NONE, rt => 1, bnd => 0, bi => 0},
)
{
# Only run tests for this pg version