diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/basebackup.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index 9776858f03..ee9e3686b7 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -907,14 +907,17 @@ sendTablespace(char *path, bool sizeonly) { int64 size; char pathbuf[MAXPGPATH]; + char subdirbuf[MAXPGPATH]; struct stat statbuf; /* * 'path' points to the tablespace location, but we only want to include * the version directory in it that belongs to us. */ - snprintf(pathbuf, sizeof(pathbuf), "%s/%s", path, - TABLESPACE_VERSION_DIRECTORY); + snprintf(subdirbuf, sizeof(subdirbuf), "%s_%s", + TABLESPACE_VERSION_DIRECTORY, PGXCNodeName); + snprintf(pathbuf, sizeof(pathbuf), "%s/%s_%s", path, + TABLESPACE_VERSION_DIRECTORY, PGXCNodeName); /* * Store a directory entry in the tar file so we get the permissions @@ -932,8 +935,7 @@ sendTablespace(char *path, bool sizeonly) return 0; } - size = _tarWriteHeader(TABLESPACE_VERSION_DIRECTORY, NULL, &statbuf, - sizeonly); + size = _tarWriteHeader(subdirbuf, NULL, &statbuf, sizeonly); /* Send all the files in the tablespace version directory */ size += sendDir(pathbuf, strlen(path), sizeonly, NIL, true); |