Skip to content

Commit 453e0e3

Browse files
committed
Minor code cleanup for perform_base_backup().
Merge two calls to sendDir() that are exactly the same except for the fifth argument. Adjust comments to match. Also, don't bother checking whether tblspc_map_file is NULL. We initialize it in all cases, so it can't be. Patch by me, reviewed by Amit Kapila and Kyotaro Horiguchi. Discussion: http://postgr.es/m/CA+TgmoYq+59SJ2zBbP891ngWPA9fymOqntqYcweSDYXS2a620A@mail.gmail.com
1 parent 1fa0929 commit 453e0e3

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/backend/replication/basebackup.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ perform_base_backup(basebackup_options *opt)
269269
XLogRecPtr endptr;
270270
TimeLineID endtli;
271271
StringInfo labelfile;
272-
StringInfo tblspc_map_file = NULL;
272+
StringInfo tblspc_map_file;
273273
backup_manifest_info manifest;
274274
int datadirpathlen;
275275
List *tablespaces = NIL;
@@ -424,25 +424,23 @@ perform_base_backup(basebackup_options *opt)
424424
if (ti->path == NULL)
425425
{
426426
struct stat statbuf;
427+
bool sendtblspclinks = true;
427428

428429
/* In the main tar, include the backup_label first... */
429430
sendFileWithContent(BACKUP_LABEL_FILE, labelfile->data,
430431
&manifest);
431432

432-
/*
433-
* Send tablespace_map file if required and then the bulk of
434-
* the files.
435-
*/
436-
if (tblspc_map_file && opt->sendtblspcmapfile)
433+
/* Then the tablespace_map file, if required... */
434+
if (opt->sendtblspcmapfile)
437435
{
438436
sendFileWithContent(TABLESPACE_MAP, tblspc_map_file->data,
439437
&manifest);
440-
sendDir(".", 1, false, tablespaces, false,
441-
&manifest, NULL);
438+
sendtblspclinks = false;
442439
}
443-
else
444-
sendDir(".", 1, false, tablespaces, true,
445-
&manifest, NULL);
440+
441+
/* Then the bulk of the files... */
442+
sendDir(".", 1, false, tablespaces, sendtblspclinks,
443+
&manifest, NULL);
446444

447445
/* ... and pg_control after everything else. */
448446
if (lstat(XLOG_CONTROL_FILE, &statbuf) != 0)

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