Re: Race condition in recovery? - Mailing list pgsql-hackers
From | Andrew Dunstan |
---|---|
Subject | Re: Race condition in recovery? |
Date | |
Msg-id | f21d59d0-592f-7d68-3774-4417d51bbf48@dunslane.net Whole thread Raw |
In response to | Re: Race condition in recovery? (Robert Haas <robertmhaas@gmail.com>) |
Responses |
Re: Race condition in recovery?
|
List | pgsql-hackers |
On 6/14/21 11:52 AM, Robert Haas wrote: > On Sat, Jun 12, 2021 at 10:20 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Andrew Dunstan <andrew@dunslane.net> writes: >>> I have pushed a fix, tested on a replica of fairywren/drongo, >> This bit seems a bit random: >> >> # WAL segment, this is enough to guarantee that the history file was >> # archived. >> my $archive_wait_query = >> - "SELECT '$walfile_to_be_archived' <= last_archived_wal FROM pg_stat_archiver;"; >> + "SELECT coalesce('$walfile_to_be_archived' <= last_archived_wal, false) " . >> + "FROM pg_stat_archiver"; >> $node_standby->poll_query_until('postgres', $archive_wait_query) >> or die "Timed out while waiting for WAL segment to be archived"; >> my $last_archived_wal_file = $walfile_to_be_archived; >> >> I wonder whether that is a workaround for the poll_query_until bug >> I proposed to fix at [1]. This has been reverted. > I found that a bit random too, but it wasn't the only part of the > patch I found a bit random. Like, what can this possibly be doing? > > +if ($^O eq 'msys') > +{ > + $perlbin = TestLib::perl2host(dirname($^X)) . '\\' . basename($^X); > +} > > The idea here is apparently that on msys, the directory name that is > part of $^X needs to be passed through perl2host, but the file name > that is part of the same $^X needs to NOT be passed through perl2host. > Is $^X really that broken? If so, I think some comments are in order. $^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. > +local $ENV{PERL_BADLANG}=0; > > Similarly here. There's not a single other reference to PERL_BADLANG > in the repository, so if we need this one here, there should be a > comment explaining why this is different from all the places where we > don't need it. Here's why this is different: this is the only place that we invoke the msys perl in this way (i.e. from a non-msys aware environment - the binaries we build are not msys-aware). We need to do that if for no other reason than that it might well be the only perl available. Doing so makes it complain loudly about missing locale info. Setting this variable makes it shut up. I can add a comment on that if you like. > On those occasions when I commit TAP test cases, I do try to think > about whether they are going to be portable, but I find these kinds of > changes indistinguishable from magic. Part of the trouble is that I've been living and breathing some of these issues so much recently that I forget that what might be fairly obvious to me isn't to others. I assure you there is not the faintest touch of pixy dust involved. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com
pgsql-hackers by date: