Re: Crash after a call to pg_backup_start() - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Crash after a call to pg_backup_start()
Date
Msg-id Y1YgTH3bt65czqkg@paquier.xyz
Whole thread Raw
In response to Re: Crash after a call to pg_backup_start()  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Crash after a call to pg_backup_start()  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Mon, Oct 24, 2022 at 11:42:58AM +0900, Kyotaro Horiguchi wrote:
> At Sat, 22 Oct 2022 09:56:06 +0200, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote in
>> My intention here was that the Assert should be inside the block, that
>> is, we already know that at least one is true, and we want to make sure
>> that they are not *both* true.
>>
>> AFAICT the attached patch also fixes the bug without making the assert
>> weaker.

On the contrary, it seems to me that putting the assertion within the
if() block makes the assertion weaker, because we would never check
for an incorrect state after do_pg_abort_backup() is registered (aka
any pg_backup_start() call) when not entering in this if() block.

Saying that, if you feel otherwise I am fine with your conclusion as
well, so feel free to solve this issue as you see fit.  :p
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation
Next
From: Julien Rouhaud
Date:
Subject: Re: Allow file inclusion in pg_hba and pg_ident files