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

From Alvaro Herrera
Subject Re: Crash after a call to pg_backup_start()
Date
Msg-id 20221022075606.nh535vg447js2vic@alvherre.pgsql
Whole thread Raw
In response to Re: Crash after a call to pg_backup_start()  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 2022-Oct-21, Michael Paquier wrote:

> On Fri, Oct 21, 2022 at 05:53:25PM +0800, Richard Guo wrote:

> >     /* These conditions can not be both true */
> 
> If you do that, it would be a bit easier to read as of the following
> assertion instead?  Like:
> Assert(!during_backup_start ||
>        sessionBackupState == SESSION_BACKUP_NONE);

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.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/

Attachment

pgsql-hackers by date:

Previous
From: Zhang Mingli
Date:
Subject: doubt about FullTransactionIdAdvance()
Next
From: Alvaro Herrera
Date:
Subject: Re: Missing update of all_hasnulls in BRIN opclasses