aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/xlog.h
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-09-26 11:15:47 +0900
committerMichael Paquier <michael@paquier.xyz>2022-09-26 11:15:47 +0900
commit7d708093b7400327658a30d1aa1d5e284d37622c (patch)
treeee2cbc99967484634c55100d4c8399f4452a8cef /src/include/access/xlog.h
parent216f9c1ab3a4f333632ce576e1dc1e3643427eb8 (diff)
downloadpostgresql-7d708093b7400327658a30d1aa1d5e284d37622c.tar.gz
postgresql-7d708093b7400327658a30d1aa1d5e284d37622c.zip
Refactor creation of backup_label and backup history files
This change simplifies some of the logic related to the generation and creation of the backup_label and backup history files, which has become unnecessarily complicated since the removal of the exclusive backup mode in commit 39969e2. The code was previously generating the contents of these files as a string (start phase for the backup_label and stop phase for the backup history file), one problem being that the contents of the backup_label string were scanned to grab some of its internal contents at the stop phase. This commit changes the logic so as we store the data required to build these files in an intermediate structure named BackupState. The backup_label file and backup history file strings are generated when they are ready to be sent back to the client. Both files are now generated with the same code path. While on it, this commit renames some variables for clarity. Two new files named xlogbackup.{c,h} are introduced in this commit, to remove from xlog.c some of the logic around base backups. Note that more could be moved to this new set of files. Author: Bharath Rupireddy, Michael Paquier Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/CALj2ACXWwTDgJqCjdaPyfR7djwm6SrybGcrZyrvojzcsmt4FFw@mail.gmail.com
Diffstat (limited to 'src/include/access/xlog.h')
-rw-r--r--src/include/access/xlog.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 3dbfa6b5932..dce265098e3 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -11,6 +11,7 @@
#ifndef XLOG_H
#define XLOG_H
+#include "access/xlogbackup.h"
#include "access/xlogdefs.h"
#include "access/xlogreader.h"
#include "datatype/timestamp.h"
@@ -277,11 +278,10 @@ typedef enum SessionBackupState
SESSION_BACKUP_RUNNING,
} SessionBackupState;
-extern XLogRecPtr do_pg_backup_start(const char *backupidstr, bool fast,
- TimeLineID *starttli_p, StringInfo labelfile,
- List **tablespaces, StringInfo tblspcmapfile);
-extern XLogRecPtr do_pg_backup_stop(char *labelfile, bool waitforarchive,
- TimeLineID *stoptli_p);
+extern void do_pg_backup_start(const char *backupidstr, bool fast,
+ List **tablespaces, BackupState *state,
+ StringInfo tblspcmapfile);
+extern void do_pg_backup_stop(BackupState *state, bool waitforarchive);
extern void do_pg_abort_backup(int code, Datum arg);
extern void register_persistent_abort_backup_handler(void);
extern SessionBackupState get_backup_status(void);