Skip to content

Commit 278c942

Browse files
committed
pg_basebackup: Skip only the *contents* of pg_replslot.
Include the directory itself. Fujii Masao
1 parent 32001ab commit 278c942

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/backend/replication/basebackup.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,10 +862,6 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces)
862862
if (strcmp(de->d_name, BACKUP_LABEL_FILE) == 0)
863863
continue;
864864

865-
/* Skip pg_replslot, not useful to copy */
866-
if (strcmp(de->d_name, "pg_replslot") == 0)
867-
continue;
868-
869865
/*
870866
* Check if the postmaster has signaled us to exit, and abort with an
871867
* error in that case. The error handler further up will call
@@ -920,6 +916,18 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces)
920916
continue;
921917
}
922918

919+
/*
920+
* Skip pg_replslot, not useful to copy. But include it as an empty
921+
* directory anyway, so we get permissions right.
922+
*/
923+
if (strcmp(de->d_name, "pg_replslot") == 0)
924+
{
925+
if (!sizeonly)
926+
_tarWriteHeader(pathbuf + basepathlen + 1, NULL, &statbuf);
927+
size += 512; /* Size of the header just added */
928+
continue;
929+
}
930+
923931
/*
924932
* We can skip pg_xlog, the WAL segments need to be fetched from the
925933
* WAL archive anyway. But include it as an empty directory anyway, so

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy