Move basebackup code to new directory src/backend/backup

Reviewed by David Steele and Justin Pryzby

Discussion: http://postgr.es/m/CA+TgmoafqboATDSoXHz8VLrSwK_MDhjthK4hEpYjqf9_1Fmczw%40mail.gmail.com
This commit is contained in:
Robert Haas 2022-08-10 14:03:23 -04:00
parent 309857f9c1
commit a8c0128697
23 changed files with 73 additions and 53 deletions

View File

@ -11,8 +11,8 @@
#include "postgres.h"
#include "access/xact.h"
#include "backup/basebackup_target.h"
#include "miscadmin.h"
#include "replication/basebackup_target.h"
#include "storage/fd.h"
#include "utils/acl.h"
#include "utils/guc.h"

View File

@ -17,7 +17,8 @@ subdir = src/backend
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
SUBDIRS = access bootstrap catalog parser commands executor foreign lib libpq \
SUBDIRS = access backup bootstrap catalog parser commands executor \
foreign lib libpq \
main nodes optimizer partitioning port postmaster \
regex replication rewrite \
statistics storage tcop tsearch utils $(top_builddir)/src/timezone \

View File

@ -63,6 +63,7 @@
#include "access/xlogreader.h"
#include "access/xlogrecovery.h"
#include "access/xlogutils.h"
#include "backup/basebackup.h"
#include "catalog/catversion.h"
#include "catalog/pg_control.h"
#include "catalog/pg_database.h"
@ -77,7 +78,6 @@
#include "postmaster/bgwriter.h"
#include "postmaster/startup.h"
#include "postmaster/walwriter.h"
#include "replication/basebackup.h"
#include "replication/logical.h"
#include "replication/origin.h"
#include "replication/slot.h"

View File

@ -40,6 +40,7 @@
#include "access/xlogreader.h"
#include "access/xlogrecovery.h"
#include "access/xlogutils.h"
#include "backup/basebackup.h"
#include "catalog/pg_control.h"
#include "commands/tablespace.h"
#include "common/file_utils.h"
@ -47,7 +48,6 @@
#include "pgstat.h"
#include "postmaster/bgwriter.h"
#include "postmaster/startup.h"
#include "replication/basebackup.h"
#include "replication/walreceiver.h"
#include "storage/fd.h"
#include "storage/ipc.h"

View File

@ -0,0 +1,30 @@
#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for src/backend/backup
#
# IDENTIFICATION
# src/backend/backup/Makefile
#
#-------------------------------------------------------------------------
subdir = src/backend/backup
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
OBJS = \
backup_manifest.o \
basebackup.o \
basebackup_copy.o \
basebackup_gzip.o \
basebackup_lz4.o \
basebackup_zstd.o \
basebackup_progress.o \
basebackup_server.o \
basebackup_sink.o \
basebackup_target.o \
basebackup_throttle.o
include $(top_srcdir)/src/backend/common.mk

View File

@ -6,18 +6,18 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/backup_manifest.c
* src/backend/backup/backup_manifest.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/timeline.h"
#include "backup/backup_manifest.h"
#include "backup/basebackup_sink.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "mb/pg_wchar.h"
#include "replication/backup_manifest.h"
#include "replication/basebackup_sink.h"
#include "utils/builtins.h"
#include "utils/json.h"

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup.c
* src/backend/backup/basebackup.c
*
*-------------------------------------------------------------------------
*/
@ -17,9 +17,13 @@
#include <time.h>
#include "access/xlog_internal.h" /* for pg_backup_start/stop */
#include "backup/backup_manifest.h"
#include "backup/basebackup.h"
#include "backup/basebackup_sink.h"
#include "backup/basebackup_target.h"
#include "commands/defrem.h"
#include "common/compression.h"
#include "common/file_perm.h"
#include "commands/defrem.h"
#include "lib/stringinfo.h"
#include "miscadmin.h"
#include "nodes/pg_list.h"
@ -27,10 +31,6 @@
#include "pgtar.h"
#include "port.h"
#include "postmaster/syslogger.h"
#include "replication/basebackup.h"
#include "replication/basebackup_sink.h"
#include "replication/basebackup_target.h"
#include "replication/backup_manifest.h"
#include "replication/walsender.h"
#include "replication/walsender_private.h"
#include "storage/bufpage.h"

View File

@ -19,19 +19,19 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup_copy.c
* src/backend/backup/basebackup_copy.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/tupdesc.h"
#include "backup/basebackup.h"
#include "backup/basebackup_sink.h"
#include "catalog/pg_type_d.h"
#include "executor/executor.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "replication/basebackup.h"
#include "replication/basebackup_sink.h"
#include "tcop/dest.h"
#include "utils/builtins.h"
#include "utils/timestamp.h"

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup_gzip.c
* src/backend/backup/basebackup_gzip.c
*
*-------------------------------------------------------------------------
*/
@ -16,7 +16,7 @@
#include <zlib.h>
#endif
#include "replication/basebackup_sink.h"
#include "backup/basebackup_sink.h"
#ifdef HAVE_LIBZ
typedef struct bbsink_gzip

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup_lz4.c
* src/backend/backup/basebackup_lz4.c
*
*-------------------------------------------------------------------------
*/
@ -16,7 +16,7 @@
#include <lz4frame.h>
#endif
#include "replication/basebackup_sink.h"
#include "backup/basebackup_sink.h"
#ifdef USE_LZ4

View File

@ -25,16 +25,16 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup_progress.c
* src/backend/backup/basebackup_progress.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "backup/basebackup.h"
#include "backup/basebackup_sink.h"
#include "commands/progress.h"
#include "miscadmin.h"
#include "replication/basebackup.h"
#include "replication/basebackup_sink.h"
#include "pgstat.h"
#include "storage/latch.h"
#include "utils/timestamp.h"

View File

@ -4,17 +4,17 @@
* store basebackup archives on the server
*
* IDENTIFICATION
* src/backend/replication/basebackup_server.c
* src/backend/backup/basebackup_server.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/xact.h"
#include "backup/basebackup.h"
#include "backup/basebackup_sink.h"
#include "catalog/pg_authid.h"
#include "miscadmin.h"
#include "replication/basebackup.h"
#include "replication/basebackup_sink.h"
#include "storage/fd.h"
#include "utils/acl.h"
#include "utils/timestamp.h"

View File

@ -5,14 +5,14 @@
*
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* src/backend/replication/basebackup_sink.c
* src/backend/backup/basebackup_sink.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "replication/basebackup_sink.h"
#include "backup/basebackup_sink.h"
/*
* Forward begin_backup callback.

View File

@ -9,13 +9,13 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup_target.c
* src/backend/backup/basebackup_target.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "replication/basebackup_target.h"
#include "backup/basebackup_target.h"
#include "utils/memutils.h"
typedef struct BaseBackupTargetType

View File

@ -8,14 +8,14 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup_throttle.c
* src/backend/backup/basebackup_throttle.c
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "backup/basebackup_sink.h"
#include "miscadmin.h"
#include "replication/basebackup_sink.h"
#include "pgstat.h"
#include "storage/latch.h"
#include "utils/timestamp.h"

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* IDENTIFICATION
* src/backend/replication/basebackup_zstd.c
* src/backend/backup/basebackup_zstd.c
*
*-------------------------------------------------------------------------
*/
@ -16,7 +16,7 @@
#include <zstd.h>
#endif
#include "replication/basebackup_sink.h"
#include "backup/basebackup_sink.h"
#ifdef USE_ZSTD

View File

@ -15,17 +15,6 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I. -I$(srcdir) $(CPPFLAGS)
OBJS = \
backup_manifest.o \
basebackup.o \
basebackup_copy.o \
basebackup_gzip.o \
basebackup_lz4.o \
basebackup_zstd.o \
basebackup_progress.o \
basebackup_server.o \
basebackup_sink.o \
basebackup_target.o \
basebackup_throttle.o \
repl_gram.o \
slot.o \
slotfuncs.o \

View File

@ -57,6 +57,7 @@
#include "access/xlogreader.h"
#include "access/xlogrecovery.h"
#include "access/xlogutils.h"
#include "backup/basebackup.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_type.h"
#include "commands/dbcommands.h"
@ -68,7 +69,6 @@
#include "nodes/replnodes.h"
#include "pgstat.h"
#include "postmaster/interrupt.h"
#include "replication/basebackup.h"
#include "replication/decode.h"
#include "replication/logical.h"
#include "replication/slot.h"

View File

@ -28,6 +28,7 @@
#endif
#include "access/xlog_internal.h"
#include "backup/basebackup.h"
#include "bbstreamer.h"
#include "common/compression.h"
#include "common/file_perm.h"
@ -37,7 +38,6 @@
#include "fe_utils/recovery_gen.h"
#include "getopt_long.h"
#include "receivelog.h"
#include "replication/basebackup.h"
#include "streamutil.h"
#define ERRCODE_DATA_CORRUPTED "XX001"

View File

@ -5,16 +5,16 @@
*
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* src/include/replication/backup_manifest.h
* src/include/backup/backup_manifest.h
*
*-------------------------------------------------------------------------
*/
#ifndef BACKUP_MANIFEST_H
#define BACKUP_MANIFEST_H
#include "backup/basebackup_sink.h"
#include "common/checksum_helper.h"
#include "pgtime.h"
#include "replication/basebackup_sink.h"
#include "storage/buffile.h"
typedef enum manifest_option

View File

@ -5,7 +5,7 @@
*
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* src/include/replication/basebackup.h
* src/include/backup/basebackup.h
*
*-------------------------------------------------------------------------
*/

View File

@ -19,7 +19,7 @@
*
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* src/include/replication/basebackup_sink.h
* src/include/backup/basebackup_sink.h
*
*-------------------------------------------------------------------------
*/

View File

@ -5,14 +5,14 @@
*
* Portions Copyright (c) 2010-2022, PostgreSQL Global Development Group
*
* src/include/replication/basebackup_target.h
* src/include/backup/basebackup_target.h
*
*-------------------------------------------------------------------------
*/
#ifndef BASEBACKUP_TARGET_H
#define BASEBACKUP_TARGET_H
#include "replication/basebackup_sink.h"
#include "backup/basebackup_sink.h"
struct BaseBackupTargetHandle;
typedef struct BaseBackupTargetHandle BaseBackupTargetHandle;