summaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2021-06-09 12:28:39 -0400
committerRobert Haas <rhaas@postgresql.org>2021-06-09 12:28:39 -0400
commit99a0a2ada8c584e7d7796190a5966600f44c037f (patch)
tree4de6408199103a2b3cbdfdec241c0e438342484e /src/test/perl/PostgresNode.pm
parent6bfcc7d0d19a32fe44a8671aa5ecca9e5b39221a (diff)
Allow PostgresNode.pm's backup method to accept backup_options.
Partial back-port of commit 081876d75ea15c3bd2ee5ba64a794fd8ea46d794. A test case for a pending bug fix needs this capability, but the code on 9.6 is significantly different, so I'm only back-patching this change as far as v10. We'll have to work around the problem another way in v9.6. Discussion: http://postgr.es/m/CAFiTN-tcivNvL0Rg6rD7_CErNfE75H7+gh9WbMxjbgsattja1Q@mail.gmail.com
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 37a07351edd..68f0958ac35 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -538,8 +538,11 @@ sub append_conf
=item $node->backup(backup_name)
Create a hot backup with B<pg_basebackup> in subdirectory B<backup_name> of
-B<< $node->backup_dir >>, including the WAL. WAL files
-fetched at the end of the backup, not streamed.
+B<< $node->backup_dir >>, including the WAL.
+
+By default, WAL files are fetched at the end of the backup, not streamed.
+You can adjust that and other things by passing an array of additional
+B<pg_basebackup> command line options in the keyword parameter backup_options.
You'll have to configure a suitable B<max_wal_senders> on the
target server since it isn't done by default.
@@ -548,7 +551,7 @@ target server since it isn't done by default.
sub backup
{
- my ($self, $backup_name) = @_;
+ my ($self, $backup_name, %params) = @_;
my $backup_path = $self->backup_dir . '/' . $backup_name;
my $name = $self->name;
@@ -556,7 +559,8 @@ sub backup
TestLib::system_or_bail(
'pg_basebackup', '-D', $backup_path, '-h',
$self->host, '-p', $self->port, '--checkpoint',
- 'fast', '--no-sync');
+ 'fast', '--no-sync',
+ @{ $params{backup_options} });
print "# Backup finished\n";
return;
}