Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6fc2feb

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 01e9e93 commit 6fc2feb

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
@@ -538,8 +538,11 @@ sub append_conf
538538
=item $node->backup(backup_name)
539539
540540
Create a hot backup with B<pg_basebackup> in subdirectory B<backup_name> of
541-
B<< $node->backup_dir >>, including the WAL. WAL files
542-
fetched at the end of the backup, not streamed.
541+
B<< $node->backup_dir >>, including the WAL.
542+
543+
By default, WAL files are fetched at the end of the backup, not streamed.
544+
You can adjust that and other things by passing an array of additional
545+
B<pg_basebackup> command line options in the keyword parameter backup_options.
543546
544547
You'll have to configure a suitable B<max_wal_senders> on the
545548
target server since it isn't done by default.
@@ -548,15 +551,16 @@ target server since it isn't done by default.
548551

549552
sub backup
550553
{
551-
my ($self, $backup_name) = @_;
554+
my ($self, $backup_name, %params) = @_;
552555
my $backup_path = $self->backup_dir . '/' . $backup_name;
553556
my $name = $self->name;
554557

555558
print "# Taking pg_basebackup $backup_name from node \"$name\"\n";
556559
TestLib::system_or_bail(
557560
'pg_basebackup', '-D', $backup_path, '-h',
558561
$self->host, '-p', $self->port, '--checkpoint',
559-
'fast', '--no-sync');
562+
'fast', '--no-sync',
563+
@{ $params{backup_options} });
560564
print "# Backup finished\n";
561565
return;
562566
}

0 commit comments

Comments
 (0)