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 20221013094204.o4zhy56toudmcbzn@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  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On 2022-Oct-13, Bharath Rupireddy wrote:

> On Wed, Oct 12, 2022 at 1:04 PM Alvaro Herrera <alvherre@alvh.no-ip.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/



pgsql-hackers by date:

Previous
From: "shiy.fnst@fujitsu.com"
Date:
Subject: RE: [RFC] building postgres with meson - v13
Next
From: Konstantin Knizhnik
Date:
Subject: Lack of PageSetLSN in heap_xlog_visible