mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-31 10:07:23 +02:00
Allow PostgresNode.pm's backup method to accept backup_options.
Partial back-port of commit 081876d75e
.
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
This commit is contained in:
parent
f0f879e106
commit
38982b8b7b
@ -546,8 +546,11 @@ sub append_conf
|
|||||||
=item $node->backup(backup_name)
|
=item $node->backup(backup_name)
|
||||||
|
|
||||||
Create a hot backup with B<pg_basebackup> in subdirectory B<backup_name> of
|
Create a hot backup with B<pg_basebackup> in subdirectory B<backup_name> of
|
||||||
B<< $node->backup_dir >>, including the WAL. WAL files
|
B<< $node->backup_dir >>, including the WAL.
|
||||||
fetched at the end of the backup, not streamed.
|
|
||||||
|
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
|
You'll have to configure a suitable B<max_wal_senders> on the
|
||||||
target server since it isn't done by default.
|
target server since it isn't done by default.
|
||||||
@ -556,7 +559,7 @@ target server since it isn't done by default.
|
|||||||
|
|
||||||
sub backup
|
sub backup
|
||||||
{
|
{
|
||||||
my ($self, $backup_name) = @_;
|
my ($self, $backup_name, %params) = @_;
|
||||||
my $backup_path = $self->backup_dir . '/' . $backup_name;
|
my $backup_path = $self->backup_dir . '/' . $backup_name;
|
||||||
my $name = $self->name;
|
my $name = $self->name;
|
||||||
|
|
||||||
@ -564,7 +567,8 @@ sub backup
|
|||||||
TestLib::system_or_bail(
|
TestLib::system_or_bail(
|
||||||
'pg_basebackup', '-D', $backup_path, '-h',
|
'pg_basebackup', '-D', $backup_path, '-h',
|
||||||
$self->host, '-p', $self->port, '--checkpoint',
|
$self->host, '-p', $self->port, '--checkpoint',
|
||||||
'fast', '--no-sync');
|
'fast', '--no-sync',
|
||||||
|
@{ $params{backup_options} });
|
||||||
print "# Backup finished\n";
|
print "# Backup finished\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user