Re: pgsql: Add regression test for recovery pause.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Fujii Masao <fujii(at)postgresql(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add regression test for recovery pause.
Date: 2021-06-02 22:25:40
Message-ID: b87f072b-e9aa-1246-d7f8-a3b68a474ce3@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers


On 6/2/21 5:26 PM, Tom Lane wrote:
> Fujii Masao <fujii(at)postgresql(dot)org> writes:
>> Add regression test for recovery pause.
> Buildfarm member jacana doesn't like this patch:
>
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=jacana&dt=2021-06-02%2012%3A00%3A44
>
> the symptom being
>
> Jun 02 09:05:17 t/005_replay_delay..................# poll_query_until timed out executing this query:
> Jun 02 09:05:17 # SELECT '0/3002A20'::pg_lsn < pg_last_wal_receive_lsn()
> Jun 02 09:05:17 # expecting this output:
> Jun 02 09:05:17 # t
> Jun 02 09:05:17 # last actual query output:
> Jun 02 09:05:17 #
> Jun 02 09:05:17 # with stderr:
> Jun 02 09:05:17 # ERROR: syntax error at or near "pg_lsn"
> Jun 02 09:05:17 # LINE 1: SELECT '0\\3002A20';pg_lsn < pg_last_wal_receive_lsn()
> Jun 02 09:05:17 # ^
>
> Checking the postmaster log confirms that what the backend is getting is
>
> 2021-06-02 08:58:01.073 EDT [60b78059.f84:4] 005_replay_delay.pl ERROR: syntax error at or near "pg_lsn" at character 20
> 2021-06-02 08:58:01.073 EDT [60b78059.f84:5] 005_replay_delay.pl STATEMENT: SELECT '0\\3002A20';pg_lsn < pg_last_wal_receive_lsn()
>
> It sort of looks like something has decided that the pg_lsn constant
> is a search path and made a lame attempt to convert it to Windows
> style. I doubt our own code is doing that, so I'm inclined to blame
> IPC::Run thinking it can mangle the command string it's given.
> I wonder whether jacana has got a freshly-installed version of IPC::Run.
>
> Another interesting question is how come we managed to get this far
> in the tests. There is a nearly, but not quite, identical delay
> query in 002_archiving.pl, which already ran successfully:
>
> # Wait until necessary replay has been done on standby
> my $caughtup_query =
> "SELECT '$current_lsn'::pg_lsn <= pg_last_wal_replay_lsn()";
> $node_standby->poll_query_until('postgres', $caughtup_query)
> or die "Timed out while waiting for standby to catch up";
>
> I wonder whether the fact that 002 uses '<=' not '<' could be
> at all related. (I also wonder which one is correct as a means
> of waiting for replay; they are not both correct.)
>
> In any case, letting IPC::Run munge SQL commands seems completely
> unacceptable. We can't plan on working around that every time.
>
>

Looks to me like we're getting munged by the msys shell, and unlike on
msys2 there isn't a way to disable it:
https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line

c.f. commit 73ff3a0abbb

Maybe a robust solution would be to have the query piped to psql on its
stdin rather than on the command line. poll_query_until looks on a quick
check like the only place in PostgresNode where we use "psql -c"

I'll experiment a bit tomorrow.

cheers

andrew

--

Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2021-06-02 22:47:32 pgsql: Revert most of 39b66a91bd
Previous Message Tom Lane 2021-06-02 21:26:45 Re: pgsql: Add regression test for recovery pause.

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2021-06-02 22:50:17 Re: security_definer_search_path GUC
Previous Message Tom Lane 2021-06-02 21:36:48 Re: improve installation short version