Skip to content

Commit 38982b8

Browse files
committed
Allow PostgresNode.pm's backup method to accept backup_options.
Partial back-port of commit 081876d. 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
1 parent f0f879e commit 38982b8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/test/perl/PostgresNode.pm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,11 @@ sub append_conf
546546
=item $node->backup(backup_name)
547547
548548
Create a hot backup with B<pg_basebackup> in subdirectory B<backup_name> of
549-
B<< $node->backup_dir >>, including the WAL. WAL files
550-
fetched at the end of the backup, not streamed.
549+
B<< $node->backup_dir >>, including the WAL.
550+
551+
By default, WAL files are fetched at the end of the backup, not streamed.
552+
You can adjust that and other things by passing an array of additional
553+
B<pg_basebackup> command line options in the keyword parameter backup_options.
551554
552555
You'll have to configure a suitable B<max_wal_senders> on the
553556
target server since it isn't done by default.
@@ -556,15 +559,16 @@ target server since it isn't done by default.
556559

557560
sub backup
558561
{
559-
my ($self, $backup_name) = @_;
562+
my ($self, $backup_name, %params) = @_;
560563
my $backup_path = $self->backup_dir . '/' . $backup_name;
561564
my $name = $self->name;
562565

563566
print "# Taking pg_basebackup $backup_name from node \"$name\"\n";
564567
TestLib::system_or_bail(
565568
'pg_basebackup', '-D', $backup_path, '-h',
566569
$self->host, '-p', $self->port, '--checkpoint',
567-
'fast', '--no-sync');
570+
'fast', '--no-sync',
571+
@{ $params{backup_options} });
568572
print "# Backup finished\n";
569573
return;
570574
}

0 commit comments

Comments
 (0)