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-13 09:42:04
Message-ID: 20221013094204.o4zhy56toudmcbzn@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Oct-13, Bharath Rupireddy wrote:

> On Wed, Oct 12, 2022 at 1:04 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:

> > You added some commentary that these functions are tailor-made for
> > internal operations, and then declared them in the most public header
> > function that xlog has? I think at the bare minimum, these prototypes
> > should be in xlog_internal.h, not xlog.h.
>
> I removed such comments. These are functions used by xlogbackup.c to
> call back into xlog.c similar to the call back functions defined in
> xlog.h for xlogrecovery.c. And, most of the XLogCtl set/get sort of
> function declarations are in xlog.h. So, I'm retaining them in xlog.h.

As I see it, xlog.h is a header that exports XLOG manipulations to the
outside world (everything that produces WAL, as well as stuff that
controls operation); xlog_internal is the header that exports xlog*.c
internal stuff for other xlog*.c files and specialized frontends to use.
These new functions are internal to xlogbackup.c and xlog.c, so IMO they
belong in xlog_internal.h.

Stuff that is used from xlog.c only by xlogrecovery.c should also appear
in xlog_internal.h only, not xlog.h, so I suggest not to take that as
precedent. Also, that file (xlogrecovery.c) is pretty new so we haven't
had time to nail down the .h layout yet.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2022-10-13 09:50:37 Lack of PageSetLSN in heap_xlog_visible
Previous Message shiy.fnst@fujitsu.com 2022-10-13 09:24:51 RE: [RFC] building postgres with meson - v13