Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loYO4-0000gH-JF for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Jun 2021 21:26:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1loYO3-0007G1-Cc for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Jun 2021 21:26:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loYO3-0007Ft-50 for pgsql-hackers@lists.postgresql.org; Wed, 02 Jun 2021 21:26:51 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loYO0-0003xo-I8; Wed, 02 Jun 2021 21:26:50 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 152LQjfE191472; Wed, 2 Jun 2021 17:26:45 -0400 From: Tom Lane To: Fujii Masao cc: Andrew Dunstan , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Add regression test for recovery pause. In-reply-to: References: Comments: In-reply-to Fujii Masao message dated "Wed, 02 Jun 2021 03:20:51 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <191470.1622669205.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Jun 2021 17:26:45 -0400 Message-ID: <191471.1622669205@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Fujii Masao 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=3Djacana&dt=3D2021= -06-02%2012%3A00%3A44 the symptom being Jun 02 09:05:17 t/005_replay_delay..................# poll_query_until tim= ed 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: s= yntax 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 =3D "SELECT '$current_lsn'::pg_lsn <=3D 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 '<=3D' 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