From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org, Noah Misch <noah@leadboat.com>
Subject: Re: Too-long socket paths are breaking several buildfarm members
Date: Mon, 4 Jul 2022 10:34:42 +0900
Message-ID: <YsJDslK5br7D8wi8@paquier.xyz> (raw)
In-Reply-To: <1410025.1656890531@sss.pgh.pa.us>
References: <1410025.1656890531@sss.pgh.pa.us>
On Sun, Jul 03, 2022 at 07:22:11PM -0400, Tom Lane wrote:
> That path name is 3 bytes over the platform limit. Evidently,
> "REL_15_STABLE" is just enough longer than "HEAD" to make this fail,
> whereas we didn't see the problem as long as the test case only
> ran in HEAD.
That tells enough about UNIXSOCK_PATH_BUFLEN. It looks like test.sh
has been using for ages /tmp/pg_upgrade_check* as socket directory to
counter this issue.
> Members butterflyfish, massasauga, and myna likewise have yet to pass
> this test in REL_15_STABLE, though they're perfectly happy in HEAD.
> They are returning cut-down logs that don't allow diagnosing for
> certain, but a reasonable bet is that it's the same kind of problem.
Hmm. That's possible.
> I think that the conversion of pg_upgrade's test script to TAP
> form missed a bet. IIRC, we have mechanism somewhere to ensure
> that test socket path names are created under /tmp, or someplace else
> that's not subject to possibly-long paths of installation directories.
> That's evidently not being used here.
There is PostgreSQL::Test::Utils::tempdir_short for that, which is
what all the nodes created in Cluster.pm use for
unix_socket_directories. One way to address the issue would be to
pass that to pg_upgrade with --socketdir, as of the attached.
--
Michael
Attachments:upgrade-tap-shorttemp.patch (text/x-diff, 1.6K) downloaddiff --git a/src/bin/pg_upgrade/t/002_pg_upgrade.pl b/src/bin/pg_upgrade/t/002_pg_upgrade.plindex 67e0be6856..8dbda0950e 100644--- a/src/bin/pg_upgrade/t/002_pg_upgrade.pl+++ b/src/bin/pg_upgrade/t/002_pg_upgrade.pl@@ -216,6 +216,9 @@ chdir ${PostgreSQL::Test::Utils::tmp_check};
# Upgrade the instance.
$oldnode->stop;
+# Use a short path for socket directories.+my $socketdir = PostgreSQL::Test::Utils::tempdir_short;+
# Cause a failure at the start of pg_upgrade, this should create the logging
# directory pg_upgrade_output.d but leave it around. Keep --check for an
# early exit.
@@ -228,6 +231,7 @@ command_fails(
'-B', $newbindir,
'-p', $oldnode->port,
'-P', $newnode->port,
+ '-s', $socketdir,
'--check'
],
'run of pg_upgrade --check for new instance with incorrect binary path');
@@ -241,7 +245,8 @@ command_ok(
'pg_upgrade', '--no-sync', '-d', $oldnode->data_dir,
'-D', $newnode->data_dir, '-b', $oldbindir,
'-B', $newbindir, '-p', $oldnode->port,
- '-P', $newnode->port, '--check'+ '-P', $newnode->port, '-s', $socketdir,+ '--check'
],
'run of pg_upgrade --check for new instance');
ok(!-d $newnode->data_dir . "/pg_upgrade_output.d",
@@ -253,7 +258,7 @@ command_ok(
'pg_upgrade', '--no-sync', '-d', $oldnode->data_dir,
'-D', $newnode->data_dir, '-b', $oldbindir,
'-B', $newbindir, '-p', $oldnode->port,
- '-P', $newnode->port+ '-P', $newnode->port, '-s', $socketdir,
],
'run of pg_upgrade for new instance');
ok( !-d $newnode->data_dir . "/pg_upgrade_output.d",
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, noah@leadboat.com
Subject: Re: Too-long socket paths are breaking several buildfarm members
In-Reply-To: <YsJDslK5br7D8wi8@paquier.xyz>
References: <1410025.1656890531@sss.pgh.pa.us> <YsJDslK5br7D8wi8@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox