Re: recovery test failures on hoverfly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: recovery test failures on hoverfly
Date: 2021-06-11 22:28:41
Message-ID: 2130215.1623450521@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> Michael Paquier <michael(at)paquier(dot)xyz> writes:
>> This is the same problem as c757a3da and 6d41dd0, where we write a
>> query to a pipe but the kill, causing a failure, makes the test fail
>> with a SIGPIPE in IPC::Run as a query is sent down to a pipe.

> The precedent of the previous fixes would seem to suggest seeing if
> we can replace 'SELECT 1' with "undef". Not sure if that'll work
> without annoying changes to poll_query_until, though.

I noticed that elver failed this same way today, so that got me
annoyed enough to pursue a fix. Using "undef" as poll_query_until's
input almost works, except it turns out that it fails to notice psql
connection failures in that case! It is *only* looking at psql's
stdout, not at either stderr or the exit status, which seems seriously
bogus in its own right; not least because poll_query_until's own
documentation claims it will continue waiting after an error, which
is exactly what it's not doing. So I propose the attached.

(I first tried to make it check $result == 0, but it seems there are a
lot of cases where psql returns status 1 in these tests. That seems
pretty bogus too, but probably beta is no time to change that
behavior.)

regards, tom lane

Attachment Content-Type Size
use-undef-in-poll_query_until-for-restart.patch text/x-diff 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-06-11 22:39:02 Re: Fdw batch insert error out when set batch_size > 65535
Previous Message Peter Geoghegan 2021-06-11 22:28:01 Re: Teaching users how they can get the most out of HOT in Postgres 14