From: Andrew Dunstan <andrew@dunslane.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Race condition in recovery?
Date: Mon, 14 Jun 2021 15:46:57 -0400
Message-ID: <e9947bcd-20ee-027c-f0fe-01f736b7e345@dunslane.net> (raw)
In-Reply-To: <6981f25c-4d48-5781-67a1-0d71fded37bd@dunslane.net>
References: <CA+TgmobANgehu3155Pds=39do9izsOjgVwSeKZ0avrSNQdjDOQ@mail.gmail.com>
<20210611.104036.2233408362728572267.horikyota.ntt@gmail.com>
<1832766.1623376398@sss.pgh.pa.us>
<20210611.151459.1951886846697638472.horikyota.ntt@gmail.com>
<CAFiTN-srU8=ND8z2wV8G+vhYZ4dMeWWNrFd0Cq0X9mDaL2ntAw@mail.gmail.com>
<1880685.1623422805@sss.pgh.pa.us>
<YMRm4lpl3kAOFih6@paquier.xyz>
<38830da5-ae00-2262-0f0d-e6b25d9df921@dunslane.net>
<ec794e40-7900-44f8-8ba8-2ba846c597c5@dunslane.net>
<2178605.1623507624@sss.pgh.pa.us>
<CA+TgmobS+schgskbVasepUvfHbL_rY7i6SCXN3p=2aut9o+NUA@mail.gmail.com>
<f21d59d0-592f-7d68-3774-4417d51bbf48@dunslane.net>
<CA+TgmoaYEiYNw74_s+no=j-5NpJYzmVi4mVp1w=sECs4gPCVpQ@mail.gmail.com>
<ca284859-8d90-1192-65b0-319843cd6711@dunslane.net>
<6981f25c-4d48-5781-67a1-0d71fded37bd@dunslane.net>
On 6/14/21 3:32 PM, Andrew Dunstan wrote:
> On 6/14/21 1:50 PM, Andrew Dunstan wrote:
>> On 6/14/21 1:11 PM, Robert Haas wrote:
>>> On Mon, Jun 14, 2021 at 12:56 PM Andrew Dunstan <andrew@dunslane.net> wrote:
>>>> $^X is not at all broken.
>>>>
>>>> The explanation here is pretty simple - the argument to perl2host is
>>>> meant to be a directory. If we're going to accomodate plain files then
>>>> we have some more work to do in TestLib.
>>> This explanation seems to contradict the documentation in TestLib.pm,
>>> which makes no mention of any such restriction.
>> Heres a snippet:
>>
>>
>> sub perl2host
>> {
>> my ($subject) = @_;
>> ...
>> if (chdir $subject)
>>
>>
>> Last time I looked you can't chdir to anything except a directory.
>
>
> Actually, I take it back, it does work for a file. I'll change it. I
> probably did this when something else wasn't working.
So, will you feel happier with this applied? I haven't tested it yet but
I'm confident it will work.
inline patch 1: src/test/recovery/t/025_stuck_on_old_timeline.pl (+7/-5 lines) download inline-1.patchdiff --git a/src/test/recovery/t/025_stuck_on_old_timeline.pl b/src/test/recovery/t/025_stuck_on_old_timeline.plindex e4e58cb8ab..3e19bc4c50 100644--- a/src/test/recovery/t/025_stuck_on_old_timeline.pl+++ b/src/test/recovery/t/025_stuck_on_old_timeline.pl@@ -24,11 +24,11 @@ my $node_primary = get_new_node('primary');
# the timeline history file reaches the archive but before any of the WAL files
# get there.
$node_primary->init(allows_streaming => 1, has_archiving => 1);
-my $perlbin = $^X;-if ($^O eq 'msys')-{- $perlbin = TestLib::perl2host(dirname($^X)) . '\\' . basename($^X);-}++# Note: consistent use of forward slashes here avoids any escaping problems+# that arise from use of backslashes. That means we need to double-quote all+# the paths in the archive_command+my $perlbin = TestLib::perl2host(^X);
$perlbin =~ s!\\!/!g if $TestLib::windows_os;
my $archivedir_primary = $node_primary->archive_dir;
$archivedir_primary =~ s!\\!/!g if $TestLib::windows_os;
@@ -36,6 +36,8 @@ $node_primary->append_conf('postgresql.conf', qq(
archive_command = '"$perlbin" "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
wal_keep_size=128MB
));
+# make sure that Msys perl doesn't complain about difficulty in setting locale+# when called this way.
local $ENV{PERL_BADLANG}=0;
$node_primary->start;
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
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: andrew@dunslane.net, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, michael@paquier.xyz, dilipbalaut@gmail.com, horikyota.ntt@gmail.com, hlinnaka@iki.fi
Subject: Re: Race condition in recovery?
In-Reply-To: <e9947bcd-20ee-027c-f0fe-01f736b7e345@dunslane.net>
References: <CA+TgmobANgehu3155Pds=39do9izsOjgVwSeKZ0avrSNQdjDOQ@mail.gmail.com> <20210611.104036.2233408362728572267.horikyota.ntt@gmail.com> <1832766.1623376398@sss.pgh.pa.us> <20210611.151459.1951886846697638472.horikyota.ntt@gmail.com> <CAFiTN-srU8=ND8z2wV8G+vhYZ4dMeWWNrFd0Cq0X9mDaL2ntAw@mail.gmail.com> <1880685.1623422805@sss.pgh.pa.us> <YMRm4lpl3kAOFih6@paquier.xyz> <38830da5-ae00-2262-0f0d-e6b25d9df921@dunslane.net> <ec794e40-7900-44f8-8ba8-2ba846c597c5@dunslane.net> <2178605.1623507624@sss.pgh.pa.us> <CA+TgmobS+schgskbVasepUvfHbL_rY7i6SCXN3p=2aut9o+NUA@mail.gmail.com> <f21d59d0-592f-7d68-3774-4417d51bbf48@dunslane.net> <CA+TgmoaYEiYNw74_s+no=j-5NpJYzmVi4mVp1w=sECs4gPCVpQ@mail.gmail.com> <ca284859-8d90-1192-65b0-319843cd6711@dunslane.net> <6981f25c-4d48-5781-67a1-0d71fded37bd@dunslane.net> <e9947bcd-20ee-027c-f0fe-01f736b7e345@dunslane.net>
* 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