Re: pgsql: Add 'basebackup_to_shell' contrib module.
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Nathan Bossart <nathandbossart@gmail.com>, Andrew Dunstan <andrew@dunslane.net>, Thomas Munro <thomas.munro@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Magnus Hagander <magnus@hagander.net>
Date: 2022-03-31T02:17:17Z
Lists: 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 authentication failed 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
Commits
-
Print information about type of test and subdirectory before running tests.
- 28bdfa2adfc6 15.0 landed
-
In basebackup_to_shell tests, properly set up pg_hba.conf.
- fea1cc49e4ab 15.0 landed
-
Add .gitignore for basebackup_to_shell.
- f8e0d900afed 15.0 landed
-
basebackup_to_shell: Add TAP test.
- 027fa0fd7261 15.0 landed
-
Document basebackup_to_shell.required_role.
- 26a0c025e233 15.0 landed
-
Add 'basebackup_to_shell' contrib module.
- c6306db24bd9 15.0 cited