pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Move the server's backup manifest code to a separate file.
2+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2020-04-21 2117c3cb3d  Fix duplicate typedef from commit 0d8c9c121.
* pgsql: Move the server's backup manifest code to a separate file.
@ 2020-04-20 18:41 Robert Haas <rhaas@postgresql.org>
  2020-04-20 20:48 ` Re: pgsql: Move the server's backup manifest code to a separate file. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Robert Haas @ 2020-04-20 18:41 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Move the server's backup manifest code to a separate file.

basebackup.c is already a pretty big and complicated file, so it
makes more sense to keep the backup manifest support routines
in a separate file, for clarity and ease of maintenance.

Discussion: http://postgr.es/m/CA+TgmoavRak5OdP76P8eJExDYhPEKWjMb0sxW7dF01dWFgE=uA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/079ac29d4dafe581748ceca523aa90c8ce8b035b

Modified Files
--------------
src/backend/replication/Makefile          |   1 +
src/backend/replication/backup_manifest.c | 375 ++++++++++++++++++++++++++++
src/backend/replication/basebackup.c      | 391 +-----------------------------
src/include/replication/backup_manifest.h |  51 ++++
4 files changed, 429 insertions(+), 389 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsql: Move the server's backup manifest code to a separate file.
  2020-04-20 18:41 pgsql: Move the server's backup manifest code to a separate file. Robert Haas <rhaas@postgresql.org>
@ 2020-04-20 20:48 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2020-04-20 20:48 UTC (permalink / raw)
  To: Robert Haas <rhaas@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Robert Haas <rhaas@postgresql.org> writes:
> Move the server's backup manifest code to a separate file.

This broke the build for me (with gcc 4.4.7):

In file included from basebackup.c:34:
../../../src/include/replication/backup_manifest.h:36: error: redefinition of typedef 'manifest_info'
../../../src/include/replication/basebackup.h:34: note: previous declaration of 'manifest_info' was here
make[3]: *** [basebackup.o] Error 1

Not really sure why the buildfarm isn't showing the same.
But this in basebackup.h sure looks like an antipattern:

struct manifest_info;
typedef struct manifest_info manifest_info;

The usual thing, if you don't want to actually include the typedef,
is more like

struct manifest_info;
...
extern int64 sendTablespace(char *path, char *oid, bool sizeonly,
                            struct manifest_info *manifest);

Also a comment along the lines of "avoid including foo.h"
is standard practice.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-04-20 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 18:41 pgsql: Move the server's backup manifest code to a separate file. Robert Haas <rhaas@postgresql.org>
2020-04-20 20:48 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox