Re: Move backup-related code to xlogbackup.c/.h - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Move backup-related code to xlogbackup.c/.h
Date
Msg-id 20221019084825.5kykycolcmgqesun@alvherre.pgsql
Whole thread Raw
In response to Re: Move backup-related code to xlogbackup.c/.h  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Move backup-related code to xlogbackup.c/.h
List pgsql-hackers
On 2022-Oct-14, Bharath Rupireddy wrote:

> On Fri, Oct 14, 2022 at 1:54 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > But alternatively, we could just remove emit_warning as a flag and have
> > the warning be emitted always; then we can use the boolean for the other
> > purpose.  I don't think the extra WARNING thrown during backup set-up is
> > going to be a problem, since it will mostly never be seen anyway (and if
> > you do see it, it's not a lie.)
> 
> +1 for this.

OK, pushed 0001, but I modified it some more, because the flag is not
really a "quick exit" optimization but actually critical for
correctness; so I reworked the function to have an if block around it
rather than an early return, and I added an assert about the flag and
session backup state.  CI was green for it and on manual testing it
seems to work correctly.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"No es bueno caminar con un hombre muerto"



pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf
Next
From: Alvaro Herrera
Date:
Subject: Re: Move backup-related code to xlogbackup.c/.h