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

From Bharath Rupireddy
Subject Re: Move backup-related code to xlogbackup.c/.h
Date
Msg-id CALj2ACXqwhYAL8AxMNBxrOLK_AU3-cv4JGHyq4xKX2jKcvV3xg@mail.gmail.com
Whole thread Raw
In response to Re: Move backup-related code to xlogbackup.c/.h  (Andres Freund <andres@anarazel.de>)
Responses Re: Move backup-related code to xlogbackup.c/.h  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Thu, Oct 6, 2022 at 4:50 AM Andres Freund <andres@anarazel.de> wrote:
>
> I'm doubtful it's a good idea to expose these to outside of xlog.c - they are
> very low level, and it's very easy to break stuff by using them wrongly.

Hm. Here's the v3 patch set without exposing WAL insert lock related
functions. Please have a look.

On Thu, Oct 6, 2022 at 4:22 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> Can we also replace the relevant code with calls to these functions in
> 0001?  That way, we can more easily review the changes you are making to
> this code separately from the large patch that just moves the code.

Done. Please have a look at 0001.

On Wed, Oct 5, 2022 at 11:28 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> On 2022-Oct-05, Michael Paquier wrote:
>
> > And FWIW, the SQL interfaces for pg_backup_start() and
> > pg_backup_stop() could stay in xlogfuncs.c.  This has the advantage to
> > centralize in the same file all the SQL-function-specific checks.
>
> As I recall, that has the disadvantage that the API exposure is a bit
> higher -- I mean, with the patch as originally posted, there was less
> cross-inclusion of header files, but that is gone in the version Bharat
> posted as reply to this.  I'm not sure if that's caused by *this*
> comment, or even that it's terribly significant, but it seems worth
> considering at least.

FWIW, I'm attaching 0003 patch for moving backup functions from
xlogfuncs.c to xlogbackup.c. It's natural to have them there when
we're moving backup related things, this also reduces backup code
footprint. We can leave xlogfuncs.c for WAL related SQL-callable
functions.

Please review the attached v3 patch set.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: "Drouvot, Bertrand"
Date:
Subject: Re: Record SET session in VariableSetStmt
Next
From: Julien Rouhaud
Date:
Subject: Re: Record SET session in VariableSetStmt