pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <fujii@postgresql.org>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Add regression test for recovery pause.
Date: Wed, 02 Jun 2021 17:26:45 -0400
Message-ID: <191471.1622669205@sss.pgh.pa.us> (raw)
In-Reply-To: <E1loHR5-0003G8-TJ@gemulon.postgresql.org>
References: <E1loHR5-0003G8-TJ@gemulon.postgresql.org>

Fujii Masao <fujii@postgresql.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.

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <191471.1622669205@sss.pgh.pa.us>
Permalink:  ../191471.1622669205@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/191471.1622669205@sss.pgh.pa.us

 · 

reply

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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, fujii@postgresql.org, andrew@dunslane.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: pgsql: Add regression test for recovery pause.
  In-Reply-To: <191471.1622669205@sss.pgh.pa.us>
  References: <E1loHR5-0003G8-TJ@gemulon.postgresql.org> <191471.1622669205@sss.pgh.pa.us>

* 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