aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgresNode.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/perl/PostgresNode.pm')
-rw-r--r--src/test/perl/PostgresNode.pm34
1 files changed, 27 insertions, 7 deletions
diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm
index 0634aefd208..81deed98430 100644
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -698,12 +698,24 @@ sub start
my $port = $self->port;
my $pgdata = $self->data_dir;
my $name = $self->name;
+ my $ret;
+
BAIL_OUT("node \"$name\" is already running") if defined $self->{_pid};
+
print("### Starting node \"$name\"\n");
- # Note: We set the cluster_name here, not in postgresql.conf (in
- # sub init) so that it does not get copied to standbys.
- my $ret = TestLib::system_log('pg_ctl', '-D', $self->data_dir, '-l',
- $self->logfile, '-o', "--cluster-name=$name", 'start');
+
+ {
+ # Temporarily unset PGAPPNAME so that the server doesn't
+ # inherit it. Otherwise this could affect libpqwalreceiver
+ # connections in confusing ways.
+ local %ENV = %ENV;
+ delete $ENV{PGAPPNAME};
+
+ # Note: We set the cluster_name here, not in postgresql.conf (in
+ # sub init) so that it does not get copied to standbys.
+ $ret = TestLib::system_log('pg_ctl', '-D', $self->data_dir, '-l',
+ $self->logfile, '-o', "--cluster-name=$name", 'start');
+ }
if ($ret != 0)
{
@@ -776,9 +788,17 @@ sub restart
my $pgdata = $self->data_dir;
my $logfile = $self->logfile;
my $name = $self->name;
+
print "### Restarting node \"$name\"\n";
- TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
- 'restart');
+
+ {
+ local %ENV = %ENV;
+ delete $ENV{PGAPPNAME};
+
+ TestLib::system_or_bail('pg_ctl', '-D', $pgdata, '-l', $logfile,
+ 'restart');
+ }
+
$self->_update_pid(1);
return;
}
@@ -835,7 +855,7 @@ sub enable_streaming
print "### Enabling streaming replication for node \"$name\"\n";
$self->append_conf(
'postgresql.conf', qq(
-primary_conninfo='$root_connstr application_name=$name'
+primary_conninfo='$root_connstr'
));
$self->set_standby_mode();
return;