]> granicus.if.org Git - postgresql/commitdiff
Set cluster_name for PostgresNode.pm instances
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 8 Feb 2019 07:38:54 +0000 (08:38 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 27 Feb 2019 09:59:25 +0000 (10:59 +0100)
This can help identifying test instances more easily at run time, and
it also provides some minimal test coverage for the cluster_name
feature.

Reviewed-by: Euler Taveira <euler@timbira.com.br>
Discussion: https://www.postgresql.org/message-id/flat/1257eaee-4874-e791-e83a-46720c72cac7@2ndquadrant.com

src/test/perl/PostgresNode.pm

index 8a2c6fc12216af4b892adcf570bf406161740f2e..0634aefd2088f51ad51609ef9f8f89785ca26000 100644 (file)
@@ -700,8 +700,10 @@ sub start
        my $name   = $self->name;
        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, 'start');
+               $self->logfile, '-o', "--cluster-name=$name", 'start');
 
        if ($ret != 0)
        {