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

Commit c717525

Browse files
committed
pg_basebackup: Fix check for MINIMUM_VERSION_FOR_WAL_SUMMARIES
MINIMUM_VERSION_FOR_WAL_SUMMARIES is used to check if the directory pg_wal/summaries/ should be created in a base backup, but its condition was reversed: pg_wal/summaries/ would be created when taking base backups from backends of v16 and older versions, but it should be created in base backups taken from backends of v17 and newer versions. Author: Artur Zakirov Reviewed-by: Yugo Nagata, Nazir Bilal Yavuz Discussion: https://postgr.es/m/CAKNkYnzkkQ0gb_ZmLTY0r2-qV1q6imXgcCWxdA6UoA6yJkujGg@mail.gmail.com
1 parent 40bbc8c commit c717525

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/bin/pg_basebackup/pg_basebackup.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -700,14 +700,12 @@ StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier,
700700
/*
701701
* For newer server versions, likewise create pg_wal/summaries
702702
*/
703-
if (PQserverVersion(conn) < MINIMUM_VERSION_FOR_WAL_SUMMARIES)
703+
if (PQserverVersion(conn) >= MINIMUM_VERSION_FOR_WAL_SUMMARIES)
704704
{
705705
char summarydir[MAXPGPATH];
706706

707707
snprintf(summarydir, sizeof(summarydir), "%s/%s/summaries",
708-
basedir,
709-
PQserverVersion(conn) < MINIMUM_VERSION_FOR_PG_WAL ?
710-
"pg_xlog" : "pg_wal");
708+
basedir, "pg_wal");
711709

712710
if (pg_mkdir_p(summarydir, pg_dir_create_mode) != 0 &&
713711
errno != EEXIST)

0 commit comments

Comments
 (0)