diff options
author | Fujii Masao <fujii@postgresql.org> | 2020-04-09 22:37:11 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2020-04-09 22:37:11 +0900 |
commit | 1ec50a81ec0acd452c7520de19e607a6de8fba5e (patch) | |
tree | a1f9d015632bd37548233b72734ba3536a5131b5 | |
parent | 5c71362174eb56676f8b91c73ec066dd5513fd4b (diff) | |
download | postgresql-1ec50a81ec0acd452c7520de19e607a6de8fba5e.tar.gz postgresql-1ec50a81ec0acd452c7520de19e607a6de8fba5e.zip |
Exclude backup_manifest file that existed in database, from BASE_BACKUP.
If there is already a backup_manifest file in the database cluster,
it belongs to the past backup that was used to start this server.
It is not correct for the backup being taken now. So this commit
changes pg_basebackup so that it always skips such backup_manifest
file. The backup_manifest file for the current backup will be injected
separately if users want it.
Author: Fujii Masao
Reviewed-by: Robert Haas
Discussion: https://postgr.es/m/78f76a3d-1a28-a97d-0394-5c96985dd1c0@oss.nttdata.com
-rw-r--r-- | src/backend/replication/basebackup.c | 8 | ||||
-rw-r--r-- | src/bin/pg_rewind/filemap.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index 5d94b9c2291..50a9e9c2804 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -266,6 +266,14 @@ static const struct exclude_list_item excludeFiles[] = {BACKUP_LABEL_FILE, false}, {TABLESPACE_MAP, false}, + /* + * If there's a backup_manifest, it belongs to a backup that was used to + * start this server. It is *not* correct for this backup. Our + * backup_manifest is injected into the backup separately if users want + * it. + */ + {"backup_manifest", false}, + {"postmaster.pid", false}, {"postmaster.opts", false}, diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c index 9088f1f80fc..254efee0be3 100644 --- a/src/bin/pg_rewind/filemap.c +++ b/src/bin/pg_rewind/filemap.c @@ -113,6 +113,14 @@ static const struct exclude_list_item excludeFiles[] = {"backup_label", false}, /* defined as BACKUP_LABEL_FILE */ {"tablespace_map", false}, /* defined as TABLESPACE_MAP */ + /* + * If there's a backup_manifest, it belongs to a backup that was used to + * start this server. It is *not* correct for this backup. Our + * backup_manifest is injected into the backup separately if users want + * it. + */ + {"backup_manifest", false}, + {"postmaster.pid", false}, {"postmaster.opts", false}, |