aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-04-11 15:56:01 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-04-11 15:56:01 -0400
commit9de692c10176e2af00dc915b122e07bd6903185c (patch)
treeaf5cc8f6e8a96f3ca6f60b07cf7b124accc3a132 /src/backend/access/transam/xlog.c
parent5e70d8b5d18b0a71528dc6f11ade31a9d10e00cb (diff)
downloadpostgresql-9de692c10176e2af00dc915b122e07bd6903185c.tar.gz
postgresql-9de692c10176e2af00dc915b122e07bd6903185c.zip
Remove dead code in do_pg_backup_start().
As of commit 39969e2a1, no caller of do_pg_backup_start() passes NULL for labelfile or tblspcmapfile, nor is it plausible that any would do so in the future. Remove the code that coped with that case, as (a) it's dead and (b) it causes Coverity to bleat about possibly leaked storage. While here, do some janitorial work on the function's header comment.
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index a7814d40198..5eabd32cf6a 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -8037,23 +8037,26 @@ issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli)
* function. It creates the necessary starting checkpoint and constructs the
* backup label and tablespace map.
*
- * The backup label and tablespace map contents are returned in *labelfile and
+ * Input parameters are "backupidstr" (the backup label string) and "fast"
+ * (if true, we do the checkpoint in immediate mode to make it faster).
+ *
+ * The backup label and tablespace map contents are appended to *labelfile and
* *tblspcmapfile, and the caller is responsible for including them in the
- * backup archive as 'backup_label' and 'tablespace_map'. There can be many
- * backups active at the same time.
+ * backup archive as 'backup_label' and 'tablespace_map'.
+ * tblspcmapfile is required mainly for tar format in windows as native windows
+ * utilities are not able to create symlinks while extracting files from tar.
+ * However for consistency and platform-independence, we do it the same way
+ * everywhere.
*
* If "tablespaces" isn't NULL, it receives a list of tablespaceinfo structs
* describing the cluster's tablespaces.
*
- * tblspcmapfile is required mainly for tar format in windows as native windows
- * utilities are not able to create symlinks while extracting files from tar.
- * However for consistency, the same is used for all platforms.
- *
* Returns the minimum WAL location that must be present to restore from this
* backup, and the corresponding timeline ID in *starttli_p.
*
* Every successfully started backup must be stopped by calling
- * do_pg_backup_stop() or do_pg_abort_backup().
+ * do_pg_backup_stop() or do_pg_abort_backup(). There can be many
+ * backups active at the same time.
*
* It is the responsibility of the caller of this function to verify the
* permissions of the calling user!
@@ -8244,12 +8247,8 @@ do_pg_backup_start(const char *backupidstr, bool fast, TimeLineID *starttli_p,
XLogFileName(xlogfilename, starttli, _logSegNo, wal_segment_size);
/*
- * Construct tablespace_map file. If caller isn't interested in this,
- * we make a local StringInfo.
+ * Construct tablespace_map file.
*/
- if (tblspcmapfile == NULL)
- tblspcmapfile = makeStringInfo();
-
datadirpathlen = strlen(DataDir);
/* Collect information about all tablespaces */
@@ -8350,11 +8349,8 @@ do_pg_backup_start(const char *backupidstr, bool fast, TimeLineID *starttli_p,
FreeDir(tblspcdir);
/*
- * Construct backup label file. If caller isn't interested in this,
- * we make a local StringInfo.
+ * Construct backup label file.
*/
- if (labelfile == NULL)
- labelfile = makeStringInfo();
/* Use the log timezone here, not the session timezone */
stamp_time = (pg_time_t) time(NULL);