Skip to content

Commit 83ef28e

Browse files
committed
Disable fetch wal-method for pg_basebackup with Percona features
As it may clash with encrypted WAL streaming. Hide the fetch option from the usage output and throw an error if it is used.
1 parent a5e6a8c commit 83ef28e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,12 @@ tablespace_list_append(const char *arg)
396396
static void
397397
usage(void)
398398
{
399+
#ifdef PERCONA_EXT
400+
#define WAL_METHODS "none|stream"
401+
#else
402+
#define WAL_METHODS "none|fetch|stream"
403+
#endif
404+
399405
printf(_("%s takes a base backup of a running PostgreSQL server.\n\n"),
400406
progname);
401407
printf(_("Usage:\n"));
@@ -414,7 +420,7 @@ usage(void)
414420
printf(_(" -T, --tablespace-mapping=OLDDIR=NEWDIR\n"
415421
" relocate tablespace in OLDDIR to NEWDIR\n"));
416422
printf(_(" --waldir=WALDIR location for the write-ahead log directory\n"));
417-
printf(_(" -X, --wal-method=none|fetch|stream\n"
423+
printf(_(" -X, --wal-method=" WAL_METHODS "\n"
418424
" include required WAL files with specified method\n"));
419425
printf(_(" -z, --gzip compress tar output\n"));
420426
printf(_(" -Z, --compress=[{client|server}-]METHOD[:DETAIL]\n"
@@ -2548,6 +2554,9 @@ main(int argc, char **argv)
25482554
else if (strcmp(optarg, "f") == 0 ||
25492555
strcmp(optarg, "fetch") == 0)
25502556
{
2557+
#ifdef PERCONA_EXT
2558+
pg_fatal("\"fetch\" wal-method is not supported with Percona features, must be \"stream\" or \"none\"");
2559+
#endif
25512560
includewal = FETCH_WAL;
25522561
}
25532562
else if (strcmp(optarg, "s") == 0 ||

0 commit comments

Comments
 (0)