From 39969e2a1e4d7f5a37f3ef37d53bbfe171e7d77a Mon Sep 17 00:00:00 2001 From: Stephen Frost Date: Wed, 6 Apr 2022 14:41:03 -0400 Subject: Remove exclusive backup mode Exclusive-mode backups have been deprecated since 9.6 (when non-exclusive backups were introduced) due to the issues they can cause should the system crash while one is running and generally because non-exclusive provides a much better interface. Further, exclusive backup mode wasn't really being tested (nor was most of the related code- like being able to log in just to stop an exclusive backup and the bits of the state machine related to that) and having to possibly deal with an exclusive backup and the backup_label file existing during pg_basebackup, pg_rewind, etc, added other complexities that we are better off without. This patch removes the exclusive backup mode, the various special cases for dealing with it, and greatly simplifies the online backup code and documentation. Authors: David Steele, Nathan Bossart Reviewed-by: Chapman Flack Discussion: https://postgr.es/m/ac7339ca-3718-3c93-929f-99e725d1172c@pgmasters.net https://postgr.es/m/CAHg+QDfiM+WU61tF6=nPZocMZvHDzCK47Kneyb0ZRULYzV5sKQ@mail.gmail.com --- src/test/perl/PostgreSQL/Test/Cluster.pm | 56 +------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) (limited to 'src/test/perl/PostgreSQL/Test/Cluster.pm') diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index b4ebc999356..1452297210e 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -638,25 +638,6 @@ sub backup return; } -=item $node->backup_fs_hot(backup_name) - -Create a backup with a filesystem level copy in subdirectory B of -B<< $node->backup_dir >>, including WAL. - -Archiving must be enabled, as B and B are -used. This is not checked or enforced. - -The backup name is passed as the backup label to B. - -=cut - -sub backup_fs_hot -{ - my ($self, $backup_name) = @_; - $self->_backup_fs($backup_name, 1); - return; -} - =item $node->backup_fs_cold(backup_name) Create a backup with a filesystem level copy in subdirectory B of @@ -670,53 +651,18 @@ Use B or B if you want to back up a running server. sub backup_fs_cold { my ($self, $backup_name) = @_; - $self->_backup_fs($backup_name, 0); - return; -} - - -# Common sub of backup_fs_hot and backup_fs_cold -sub _backup_fs -{ - my ($self, $backup_name, $hot) = @_; - my $backup_path = $self->backup_dir . '/' . $backup_name; - my $port = $self->port; - my $name = $self->name; - - print "# Taking filesystem backup $backup_name from node \"$name\"\n"; - - if ($hot) - { - my $stdout = $self->safe_psql('postgres', - "SELECT * FROM pg_start_backup('$backup_name');"); - print "# pg_start_backup: $stdout\n"; - } PostgreSQL::Test::RecursiveCopy::copypath( $self->data_dir, - $backup_path, + $self->backup_dir . '/' . $backup_name, filterfn => sub { my $src = shift; return ($src ne 'log' and $src ne 'postmaster.pid'); }); - if ($hot) - { - - # We ignore pg_stop_backup's return value. We also assume archiving - # is enabled; otherwise the caller will have to copy the remaining - # segments. - my $stdout = - $self->safe_psql('postgres', 'SELECT * FROM pg_stop_backup();'); - print "# pg_stop_backup: $stdout\n"; - } - - print "# Backup finished\n"; return; } - - =pod =item $node->init_from_backup(root_node, backup_name) -- cgit v1.2.3