Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit453e0e3

Browse files
committed
Minor code cleanup for perform_base_backup().
Merge two calls to sendDir() that are exactly the same except forthe fifth argument. Adjust comments to match.Also, don't bother checking whether tblspc_map_file is NULL. Weinitialize 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 parent1fa0929 commit453e0e3

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
XLogRecPtrendptr;
270270
TimeLineIDendtli;
271271
StringInfolabelfile;
272-
StringInfotblspc_map_file=NULL;
272+
StringInfotblspc_map_file;
273273
backup_manifest_infomanifest;
274274
intdatadirpathlen;
275275
List*tablespaces=NIL;
@@ -424,25 +424,23 @@ perform_base_backup(basebackup_options *opt)
424424
if (ti->path==NULL)
425425
{
426426
structstatstatbuf;
427+
boolsendtblspclinks= 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)

[8]ページ先頭

©2009-2025 Movatter.jp