Re: Move backup-related code to xlogbackup.c/.h

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Michael Paquier <michael(at)paquier(dot)xyz>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Move backup-related code to xlogbackup.c/.h
Date: 2022-10-19 08:48:25
Message-ID: 20221019084825.5kykycolcmgqesun@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Oct-14, Bharath Rupireddy wrote:

> On Fri, Oct 14, 2022 at 1:54 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2022-10-19 09:00:29 Re: Move backup-related code to xlogbackup.c/.h
Previous Message Drouvot, Bertrand 2022-10-19 08:45:44 Re: Patch proposal: make use of regular expressions for the username in pg_hba.conf