Re: pgsql: Add 'basebackup_to_shell' contrib module. - Mailing list pgsql-hackers

From Andres Freund
Subject Re: pgsql: Add 'basebackup_to_shell' contrib module.
Date
Msg-id 20220331021717.xusjlknpbs7szyv6@alap3.anarazel.de
Whole thread Raw
In response to Re: pgsql: Add 'basebackup_to_shell' contrib module.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Add 'basebackup_to_shell' contrib module.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2022-03-30 22:07:48 -0400, Tom Lane wrote:
> So ... none of the Windows buildfarm members actually like this
> test script.  They're all showing failures along the lines of
> 
> not ok 2 - fails if basebackup_to_shell.command is not set: matches
> 
> #   Failed test 'fails if basebackup_to_shell.command is not set: matches'
> #   at t/001_basic.pl line 38.
> #                   'pg_basebackup: error: connection to server at "127.0.0.1", port 55358 failed: FATAL:  SSPI
authenticationfailed for user "backupuser"
 
> # '
> #     doesn't match '(?^:shell command for backup is not configured)'
> 
> Does the CI setup not account for this issue?

On windows CI sets
    # Avoids port conflicts between concurrent tap test runs
    PG_TEST_USE_UNIX_SOCKETS: 1

because I've otherwise seen a lot of spurious tap test failures - Cluster.pm
get_free_port() is racy, as it admits:
XXX A port available now may become unavailable by the time we start
the desired service.

The only alternative is to not use parallelism when running tap tests, but
that makes test runs even slower - and windows is already the bottleneck for
cfbot.

I assume SSPI doesn't work over unix sockets? Oh. Maybe it's not even that -
we only enable it when not using unix sockets:

# Internal method to set up trusted pg_hba.conf for replication.  Not
# documented because you shouldn't use it, it's called automatically if needed.
sub set_replication_conf
{
    my ($self) = @_;
    my $pgdata = $self->data_dir;

    $self->host eq $test_pghost
      or croak "set_replication_conf only works with the default host";

    open my $hba, '>>', "$pgdata/pg_hba.conf";
    print $hba "\n# Allow replication (set up by PostgreSQL::Test::Cluster.pm)\n";
    if ($PostgreSQL::Test::Utils::windows_os && !$PostgreSQL::Test::Utils::use_unix_sockets)
    {
        print $hba
          "host replication all $test_localhost/32 sspi include_realm=1 map=regress\n";
    }
    close $hba;
    return;
}

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Add 'basebackup_to_shell' contrib module.
Next
From: "shiy.fnst@fujitsu.com"
Date:
Subject: RE: Logical replication timeout problem