Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7d70809

Browse files
committed
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
1 parent 216f9c1 commit 7d70809

File tree

9 files changed

+292
-202
lines changed

9 files changed

+292
-202
lines changed

src/backend/access/transam/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ OBJS = \
2929
xact.o \
3030
xlog.o \
3131
xlogarchive.o \
32+
xlogbackup.o \
3233
xlogfuncs.o \
3334
xloginsert.o \
3435
xlogprefetcher.o \

src/backend/access/transam/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ backend_sources += files(
1515
'xact.c',
1616
'xlog.c',
1717
'xlogarchive.c',
18+
'xlogbackup.c',
1819
'xlogfuncs.c',
1920
'xloginsert.c',
2021
'xlogprefetcher.c',

0 commit comments

Comments
 (0)